diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-01-30 20:08:39 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-01-30 20:08:39 +0000 |
commit | 5cbf985dcbc89fba3208e7baf8b6f488b06d3ec9 (patch) | |
tree | 7207871f6b243dd1575dd474b14ed7e05be6b9e7 /lib/VMCore | |
parent | 2574fe5a226e9806cde064b0919c461babc3bf29 (diff) | |
download | external_llvm-5cbf985dcbc89fba3208e7baf8b6f488b06d3ec9.zip external_llvm-5cbf985dcbc89fba3208e7baf8b6f488b06d3ec9.tar.gz external_llvm-5cbf985dcbc89fba3208e7baf8b6f488b06d3ec9.tar.bz2 |
For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/Mangler.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/Module.cpp | 2 | ||||
-rw-r--r-- | lib/VMCore/Pass.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/PassManager.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/SymbolTable.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/Verifier.cpp | 12 |
7 files changed, 17 insertions, 17 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 97dc16c..4fe3c02 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -925,7 +925,7 @@ void AssemblyWriter::printFunction(const Function *F) { if (AnnotationWriter) AnnotationWriter->emitFunctionAnnot(F, Out); - if (F->isExternal()) + if (F->isDeclaration()) switch (F->getLinkage()) { case GlobalValue::DLLImportLinkage: Out << "declare dllimport "; break; case GlobalValue::ExternalWeakLinkage: Out << "declare extern_weak "; break; @@ -996,7 +996,7 @@ void AssemblyWriter::printFunction(const Function *F) { if (F->getAlignment()) Out << " align " << F->getAlignment(); - if (F->isExternal()) { + if (F->isDeclaration()) { Out << "\n"; } else { Out << " {"; diff --git a/lib/VMCore/Mangler.cpp b/lib/VMCore/Mangler.cpp index b3211a3..353732f 100644 --- a/lib/VMCore/Mangler.cpp +++ b/lib/VMCore/Mangler.cpp @@ -170,8 +170,8 @@ void Mangler::InsertName(GlobalValue *GV, GV->hasDLLImportLinkage()) && (ExistingValue->hasExternalLinkage() || ExistingValue->hasDLLImportLinkage()) && - GV->isExternal() && - ExistingValue->isExternal()) { + GV->isDeclaration() && + ExistingValue->isDeclaration()) { // If the two globals both have external inkage, and are both external, // don't mangle either of them, we just have some silly type mismatch. } else { diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 45f7522..d8c7356 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -250,7 +250,7 @@ Function *Module::getNamedFunction(const std::string &Name) const { const Function *Found = 0; for (const_iterator I = begin(), E = end(); I != E; ++I) if (I->getName() == Name) - if (I->isExternal()) + if (I->isDeclaration()) Found = I; else return const_cast<Function*>(&(*I)); diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index 3f3dbdf..2e27015 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -76,7 +76,7 @@ bool FunctionPass::runOnModule(Module &M) { bool Changed = doInitialization(M); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isExternal()) // Passes are not run on external functions! + if (!I->isDeclaration()) // Passes are not run on external functions! Changed |= runOnFunction(*I); return Changed | doFinalization(M); @@ -85,7 +85,7 @@ bool FunctionPass::runOnModule(Module &M) { // run - On a function, we simply initialize, run the function, then finalize. // bool FunctionPass::run(Function &F) { - if (F.isExternal()) return false;// Passes are not run on external functions! + if (F.isDeclaration()) return false;// Passes are not run on external functions! bool Changed = doInitialization(*F.getParent()); Changed |= runOnFunction(F); diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index d72f8ca..ac4602a 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -751,7 +751,7 @@ Pass *AnalysisResolver::getAnalysisToUpdate(AnalysisID ID, bool dir) const { bool BBPassManager::runOnFunction(Function &F) { - if (F.isExternal()) + if (F.isDeclaration()) return false; bool Changed = doInitialization(F); @@ -952,7 +952,7 @@ bool FPPassManager::runOnFunction(Function &F) { bool Changed = false; - if (F.isExternal()) + if (F.isDeclaration()) return false; std::string Msg1 = "Executing Pass '"; diff --git a/lib/VMCore/SymbolTable.cpp b/lib/VMCore/SymbolTable.cpp index c20366c..2edd3eb 100644 --- a/lib/VMCore/SymbolTable.cpp +++ b/lib/VMCore/SymbolTable.cpp @@ -255,11 +255,11 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType, GlobalValue *NewGV = dyn_cast<GlobalValue>(V.second); if (ExistGV && NewGV) { - assert((ExistGV->isExternal() || NewGV->isExternal()) && + assert((ExistGV->isDeclaration() || NewGV->isDeclaration()) && "Two planes folded together with overlapping value names!"); // Make sure that ExistGV is the one we want to keep! - if (!NewGV->isExternal()) + if (!NewGV->isDeclaration()) std::swap(NewGV, ExistGV); // Ok we have two external global values. Make all uses of the new diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 4f67889..59be4a4 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -132,7 +132,7 @@ namespace { // Anonymous namespace for class visitGlobalValue(*I); // Check to make sure function prototypes are okay. - if (I->isExternal()) visitFunction(*I); + if (I->isDeclaration()) visitFunction(*I); } for (Module::global_iterator I = M.global_begin(), E = M.global_end(); @@ -274,14 +274,14 @@ namespace { // Anonymous namespace for class void Verifier::visitGlobalValue(GlobalValue &GV) { - Assert1(!GV.isExternal() || + Assert1(!GV.isDeclaration() || GV.hasExternalLinkage() || GV.hasDLLImportLinkage() || GV.hasExternalWeakLinkage(), "Global is external, but doesn't have external or dllimport or weak linkage!", &GV); - Assert1(!GV.hasDLLImportLinkage() || GV.isExternal(), + Assert1(!GV.hasDLLImportLinkage() || GV.isDeclaration(), "Global is marked as dllimport, but not external", &GV); Assert1(!GV.hasAppendingLinkage() || isa<GlobalVariable>(GV), @@ -369,7 +369,7 @@ void Verifier::visitFunction(Function &F) { "Functions cannot take aggregates as arguments by value!", I); } - if (!F.isExternal()) { + if (!F.isDeclaration()) { // Verify that this function (which has a body) is not named "llvm.*". It // is not legal to define intrinsics. if (F.getName().size() >= 5) @@ -968,7 +968,7 @@ void Verifier::visitInstruction(Instruction &I) { /// void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) { Function *IF = CI.getCalledFunction(); - Assert1(IF->isExternal(), "Intrinsic functions should never be defined!", IF); + Assert1(IF->isDeclaration(), "Intrinsic functions should never be defined!", IF); #define GET_INTRINSIC_VERIFIER #include "llvm/Intrinsics.gen" @@ -1070,7 +1070,7 @@ FunctionPass *llvm::createVerifierPass(VerifierFailureAction action) { // verifyFunction - Create bool llvm::verifyFunction(const Function &f, VerifierFailureAction action) { Function &F = const_cast<Function&>(f); - assert(!F.isExternal() && "Cannot verify external functions"); + assert(!F.isDeclaration() && "Cannot verify external functions"); FunctionPassManager FPM(new ExistingModuleProvider(F.getParent())); Verifier *V = new Verifier(action); |