summaryrefslogtreecommitdiff
path: root/lib/CodeGen/ShadowStackCollector.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2008-08-08 19:39:37 +0000
committerEric Christopher <echristo@apple.com>2008-08-08 19:39:37 +0000
commit7a61d701c0870642e075e90b6a1ad03a8ac9bc67 (patch)
treee0930f7b8a66648b8a93e802cd415f24bdf3891f /lib/CodeGen/ShadowStackCollector.cpp
parentd9cc749318cc9ab4f36efe8a44201a72adbda2b2 (diff)
Have IRBuilder take a template argument on whether or not to preserve
names. This can save a lot of allocations if you aren't going to be looking at the output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54546 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ShadowStackCollector.cpp')
-rw-r--r--lib/CodeGen/ShadowStackCollector.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/CodeGen/ShadowStackCollector.cpp b/lib/CodeGen/ShadowStackCollector.cpp
index 568fe44c30..4d275a6eb9 100644
--- a/lib/CodeGen/ShadowStackCollector.cpp
+++ b/lib/CodeGen/ShadowStackCollector.cpp
@@ -61,9 +61,9 @@ namespace {
Constant *GetFrameMap(Function &F);
const Type* GetConcreteStackEntryType(Function &F);
void CollectRoots(Function &F);
- static GetElementPtrInst *CreateGEP(IRBuilder &B, Value *BasePtr,
+ static GetElementPtrInst *CreateGEP(IRBuilder<> &B, Value *BasePtr,
int Idx1, const char *Name);
- static GetElementPtrInst *CreateGEP(IRBuilder &B, Value *BasePtr,
+ static GetElementPtrInst *CreateGEP(IRBuilder<> &B, Value *BasePtr,
int Idx1, int Idx2, const char *Name);
};
@@ -89,13 +89,13 @@ namespace {
// State.
int State;
Function::iterator StateBB, StateE;
- IRBuilder Builder;
+ IRBuilder<> Builder;
public:
EscapeEnumerator(Function &F, const char *N = "cleanup")
: F(F), CleanupBBName(N), State(0) {}
- IRBuilder *Next() {
+ IRBuilder<> *Next() {
switch (State) {
default:
return 0;
@@ -341,7 +341,7 @@ void ShadowStackCollector::CollectRoots(Function &F) {
}
GetElementPtrInst *
-ShadowStackCollector::CreateGEP(IRBuilder &B, Value *BasePtr,
+ShadowStackCollector::CreateGEP(IRBuilder<> &B, Value *BasePtr,
int Idx, int Idx2, const char *Name) {
Value *Indices[] = { ConstantInt::get(Type::Int32Ty, 0),
ConstantInt::get(Type::Int32Ty, Idx),
@@ -354,7 +354,7 @@ ShadowStackCollector::CreateGEP(IRBuilder &B, Value *BasePtr,
}
GetElementPtrInst *
-ShadowStackCollector::CreateGEP(IRBuilder &B, Value *BasePtr,
+ShadowStackCollector::CreateGEP(IRBuilder<> &B, Value *BasePtr,
int Idx, const char *Name) {
Value *Indices[] = { ConstantInt::get(Type::Int32Ty, 0),
ConstantInt::get(Type::Int32Ty, Idx) };
@@ -381,7 +381,7 @@ bool ShadowStackCollector::performCustomLowering(Function &F) {
// Build the shadow stack entry at the very start of the function.
BasicBlock::iterator IP = F.getEntryBlock().begin();
- IRBuilder AtEntry(IP->getParent(), IP);
+ IRBuilder<> AtEntry(IP->getParent(), IP);
Instruction *StackEntry = AtEntry.CreateAlloca(ConcreteStackEntryTy, 0,
"gc_frame");
@@ -419,7 +419,7 @@ bool ShadowStackCollector::performCustomLowering(Function &F) {
// For each instruction that escapes...
EscapeEnumerator EE(F, "gc_cleanup");
- while (IRBuilder *AtExit = EE.Next()) {
+ while (IRBuilder<> *AtExit = EE.Next()) {
// Pop the entry from the shadow stack. Don't reuse CurrentHead from
// AtEntry, since that would make the value live for the entire function.
Instruction *EntryNextPtr2 = CreateGEP(*AtExit, StackEntry, 0, 0,