[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp LowerGC.cpp Reg2Mem.cpp SCCP.cpp

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



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.609 -> 1.610
LowerGC.cpp updated: 1.18 -> 1.19
Reg2Mem.cpp updated: 1.9 -> 1.10
SCCP.cpp updated: 1.152 -> 1.153
---
Log message:

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


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

 InstructionCombining.cpp |   10 +++++-----
 LowerGC.cpp              |    2 +-
 Reg2Mem.cpp              |    2 +-
 SCCP.cpp                 |    8 ++++----
 4 files changed, 11 insertions(+), 11 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.609 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.610
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.609	Sat Jan 27 17:08:34 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Tue Jan 30 14:08:38 2007
@@ -7234,7 +7234,7 @@
 
   // Check to see if we are changing the return type...
   if (OldRetTy != FT->getReturnType()) {
-    if (Callee->isExternal() && !Caller->use_empty() && 
+    if (Callee->isDeclaration() && !Caller->use_empty() && 
         OldRetTy != FT->getReturnType() &&
         // Conversion is ok if changing from pointer to int of same size.
         !(isa<PointerType>(FT->getReturnType()) &&
@@ -7270,11 +7270,11 @@
        ParamTy->getPrimitiveSizeInBits() >= ActTy->getPrimitiveSizeInBits()) ||
       (c && ParamTy->getPrimitiveSizeInBits() >= ActTy->getPrimitiveSizeInBits()
        && c->getSExtValue() > 0);
-    if (Callee->isExternal() && !isConvertible) return false;
+    if (Callee->isDeclaration() && !isConvertible) return false;
   }
 
   if (FT->getNumParams() < NumActualArgs && !FT->isVarArg() &&
-      Callee->isExternal())
+      Callee->isDeclaration())
     return false;   // Do not delete arguments unless we have a function body...
 
   // Okay, we decided that this is a safe thing to do: go ahead and start
@@ -8102,14 +8102,14 @@
 
     // Instcombine load (constant global) into the value loaded.
     if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Op))
-      if (GV->isConstant() && !GV->isExternal())
+      if (GV->isConstant() && !GV->isDeclaration())
         return ReplaceInstUsesWith(LI, GV->getInitializer());
 
     // Instcombine load (constantexpr_GEP global, 0, ...) into the value loaded.
     if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Op))
       if (CE->getOpcode() == Instruction::GetElementPtr) {
         if (GlobalVariable *GV = dyn_cast<GlobalVariable>(CE->getOperand(0)))
-          if (GV->isConstant() && !GV->isExternal())
+          if (GV->isConstant() && !GV->isDeclaration())
             if (Constant *V = 
                ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE))
               return ReplaceInstUsesWith(LI, V);


Index: llvm/lib/Transforms/Scalar/LowerGC.cpp
diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.18 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.19
--- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.18	Sun Jan  7 00:56:34 2007
+++ llvm/lib/Transforms/Scalar/LowerGC.cpp	Tue Jan 30 14:08:38 2007
@@ -130,7 +130,7 @@
                                      GlobalValue::LinkOnceLinkage,
                                      Constant::getNullValue(PRLTy),
                                      "llvm_gc_root_chain", &M);
-    } else if (RootChain->hasExternalLinkage() && RootChain->isExternal()) {
+    } else if (RootChain->hasExternalLinkage() && RootChain->isDeclaration()) {
       RootChain->setInitializer(Constant::getNullValue(PRLTy));
       RootChain->setLinkage(GlobalValue::LinkOnceLinkage);
     }


Index: llvm/lib/Transforms/Scalar/Reg2Mem.cpp
diff -u llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.9 llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.10
--- llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.9	Tue Dec 19 15:40:18 2006
+++ llvm/lib/Transforms/Scalar/Reg2Mem.cpp	Tue Jan 30 14:08:38 2007
@@ -49,7 +49,7 @@
     }
 
     virtual bool runOnFunction(Function &F) {
-      if (!F.isExternal()) {
+      if (!F.isDeclaration()) {
         //give us a clean block
 	BasicBlock* bbold = &F.getEntryBlock();
 	BasicBlock* bbnew = new BasicBlock("allocablock", &F, &F.getEntryBlock());


Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.152 llvm/lib/Transforms/Scalar/SCCP.cpp:1.153
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.152	Fri Jan 12 18:42:58 2007
+++ llvm/lib/Transforms/Scalar/SCCP.cpp	Tue Jan 30 14:08:38 2007
@@ -1021,7 +1021,7 @@
     // Transform load (constant global) into the value loaded.
     if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Ptr)) {
       if (GV->isConstant()) {
-        if (!GV->isExternal()) {
+        if (!GV->isDeclaration()) {
           markConstant(IV, &I, GV->getInitializer());
           return;
         }
@@ -1040,7 +1040,7 @@
     if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr))
       if (CE->getOpcode() == Instruction::GetElementPtr)
     if (GlobalVariable *GV = dyn_cast<GlobalVariable>(CE->getOperand(0)))
-      if (GV->isConstant() && !GV->isExternal())
+      if (GV->isConstant() && !GV->isDeclaration())
         if (Constant *V =
              ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE)) {
           markConstant(IV, &I, V);
@@ -1088,7 +1088,7 @@
     return;
   }
 
-  if (F == 0 || !F->isExternal() || !canConstantFoldCallTo(F)) {
+  if (F == 0 || !F->isDeclaration() || !canConstantFoldCallTo(F)) {
     markOverdefined(IV, I);
     return;
   }
@@ -1486,7 +1486,7 @@
   hash_map<Value*, LatticeVal> &Values = Solver.getValueMapping();
   for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
     if (!F->hasInternalLinkage() || AddressIsTaken(F)) {
-      if (!F->isExternal())
+      if (!F->isDeclaration())
         Solver.MarkBlockExecutable(F->begin());
       for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
            AI != E; ++AI)






More information about the llvm-commits mailing list