[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Mangler.cpp Module.cpp Pass.cpp PassManager.cpp SymbolTable.cpp Verifier.cpp

Reid Spencer reid at x10sys.com
Tue Jan 30 12:10:01 PST 2007



Changes in directory llvm/lib/VMCore:

AsmWriter.cpp updated: 1.256 -> 1.257
Mangler.cpp updated: 1.30 -> 1.31
Module.cpp updated: 1.73 -> 1.74
Pass.cpp updated: 1.83 -> 1.84
PassManager.cpp updated: 1.131 -> 1.132
SymbolTable.cpp updated: 1.65 -> 1.66
Verifier.cpp updated: 1.187 -> 1.188
---
Log message:

For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.


---
Diffs of the changes:  (+17 -17)

 AsmWriter.cpp   |    4 ++--
 Mangler.cpp     |    4 ++--
 Module.cpp      |    2 +-
 Pass.cpp        |    4 ++--
 PassManager.cpp |    4 ++--
 SymbolTable.cpp |    4 ++--
 Verifier.cpp    |   12 ++++++------
 7 files changed, 17 insertions(+), 17 deletions(-)


Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.256 llvm/lib/VMCore/AsmWriter.cpp:1.257
--- llvm/lib/VMCore/AsmWriter.cpp:1.256	Sun Jan 28 07:31:35 2007
+++ llvm/lib/VMCore/AsmWriter.cpp	Tue Jan 30 14:08:38 2007
@@ -925,7 +925,7 @@
 
   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 @@
   if (F->getAlignment())
     Out << " align " << F->getAlignment();
 
-  if (F->isExternal()) {
+  if (F->isDeclaration()) {
     Out << "\n";
   } else {
     Out << " {";


Index: llvm/lib/VMCore/Mangler.cpp
diff -u llvm/lib/VMCore/Mangler.cpp:1.30 llvm/lib/VMCore/Mangler.cpp:1.31
--- llvm/lib/VMCore/Mangler.cpp:1.30	Thu Sep 14 13:23:27 2006
+++ llvm/lib/VMCore/Mangler.cpp	Tue Jan 30 14:08:38 2007
@@ -170,8 +170,8 @@
                 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 {


Index: llvm/lib/VMCore/Module.cpp
diff -u llvm/lib/VMCore/Module.cpp:1.73 llvm/lib/VMCore/Module.cpp:1.74
--- llvm/lib/VMCore/Module.cpp:1.73	Fri Jan 26 02:07:57 2007
+++ llvm/lib/VMCore/Module.cpp	Tue Jan 30 14:08:38 2007
@@ -250,7 +250,7 @@
   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));


Index: llvm/lib/VMCore/Pass.cpp
diff -u llvm/lib/VMCore/Pass.cpp:1.83 llvm/lib/VMCore/Pass.cpp:1.84
--- llvm/lib/VMCore/Pass.cpp:1.83	Fri Jan  5 16:47:07 2007
+++ llvm/lib/VMCore/Pass.cpp	Tue Jan 30 14:08:38 2007
@@ -76,7 +76,7 @@
   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 @@
 // 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);


Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.131 llvm/lib/VMCore/PassManager.cpp:1.132
--- llvm/lib/VMCore/PassManager.cpp:1.131	Mon Jan 29 17:10:37 2007
+++ llvm/lib/VMCore/PassManager.cpp	Tue Jan 30 14:08:38 2007
@@ -751,7 +751,7 @@
 bool
 BBPassManager::runOnFunction(Function &F) {
 
-  if (F.isExternal())
+  if (F.isDeclaration())
     return false;
 
   bool Changed = doInitialization(F);
@@ -952,7 +952,7 @@
 
   bool Changed = false;
 
-  if (F.isExternal())
+  if (F.isDeclaration())
     return false;
 
   std::string Msg1 = "Executing Pass '";


Index: llvm/lib/VMCore/SymbolTable.cpp
diff -u llvm/lib/VMCore/SymbolTable.cpp:1.65 llvm/lib/VMCore/SymbolTable.cpp:1.66
--- llvm/lib/VMCore/SymbolTable.cpp:1.65	Sat Jan  6 01:24:44 2007
+++ llvm/lib/VMCore/SymbolTable.cpp	Tue Jan 30 14:08:38 2007
@@ -255,11 +255,11 @@
         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


Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.187 llvm/lib/VMCore/Verifier.cpp:1.188
--- llvm/lib/VMCore/Verifier.cpp:1.187	Sun Jan 28 07:31:35 2007
+++ llvm/lib/VMCore/Verifier.cpp	Tue Jan 30 14:08:38 2007
@@ -132,7 +132,7 @@
         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 @@
 
 
 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 @@
             "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::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 @@
 // 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);






More information about the llvm-commits mailing list