diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-22 00:24:57 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-22 00:24:57 +0000 |
commit | 47db941fd3e5a698c4417e38686ff6da6b2d81ee (patch) | |
tree | f1bc8ce05f4b4c0c6f5eb775c3e5b12eda35e2f1 /llvm/lib/Transforms/IPO/ExtractGV.cpp | |
parent | 4565ef5b65b7d0b778b41836d70b806196cc8e24 (diff) | |
download | llvm-47db941fd3e5a698c4417e38686ff6da6b2d81ee.zip llvm-47db941fd3e5a698c4417e38686ff6da6b2d81ee.tar.gz llvm-47db941fd3e5a698c4417e38686ff6da6b2d81ee.tar.bz2 |
Get rid of the Pass+Context magic.
llvm-svn: 76702
Diffstat (limited to 'llvm/lib/Transforms/IPO/ExtractGV.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/ExtractGV.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/ExtractGV.cpp b/llvm/lib/Transforms/IPO/ExtractGV.cpp index fa3a055..57cd1ca 100644 --- a/llvm/lib/Transforms/IPO/ExtractGV.cpp +++ b/llvm/lib/Transforms/IPO/ExtractGV.cpp @@ -44,7 +44,6 @@ namespace { return false; // Nothing to extract } - Context = &M.getContext(); if (deleteStuff) return deleteGV(); @@ -87,6 +86,8 @@ namespace { } bool isolateGV(Module &M) { + LLVMContext &Context = M.getContext(); + // Mark all globals internal // FIXME: what should we do with private linkage? for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) @@ -102,14 +103,14 @@ namespace { // by putting them in the used array { std::vector<Constant *> AUGs; - const Type *SBP= Context->getPointerTypeUnqual(Type::Int8Ty); + const Type *SBP= Context.getPointerTypeUnqual(Type::Int8Ty); for (std::vector<GlobalValue*>::iterator GI = Named.begin(), GE = Named.end(); GI != GE; ++GI) { (*GI)->setLinkage(GlobalValue::ExternalLinkage); - AUGs.push_back(Context->getConstantExprBitCast(*GI, SBP)); + AUGs.push_back(Context.getConstantExprBitCast(*GI, SBP)); } - ArrayType *AT = Context->getArrayType(SBP, AUGs.size()); - Constant *Init = Context->getConstantArray(AT, AUGs); + ArrayType *AT = Context.getArrayType(SBP, AUGs.size()); + Constant *Init = Context.getConstantArray(AT, AUGs); GlobalValue *gv = new GlobalVariable(M, AT, false, GlobalValue::AppendingLinkage, Init, "llvm.used"); |