[llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Sep 26 00:34:47 PDT 2005
Changes in directory llvm/lib/Transforms/IPO:
GlobalOpt.cpp updated: 1.50 -> 1.51
---
Log message:
Add a debug printout, fix a crash on kc++
---
Diffs of the changes: (+6 -1)
GlobalOpt.cpp | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletion(-)
Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.50 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.51
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.50 Mon Sep 26 01:52:44 2005
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Mon Sep 26 02:34:35 2005
@@ -320,7 +320,9 @@
Changed = true;
} else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) {
if (CE->getOpcode() == Instruction::GetElementPtr) {
- Constant *SubInit = ConstantFoldLoadThroughGEPConstantExpr(Init, CE);
+ Constant *SubInit = 0;
+ if (Init)
+ SubInit = ConstantFoldLoadThroughGEPConstantExpr(Init, CE);
Changed |= CleanupConstantGlobalUsers(CE, SubInit);
} else if (CE->getOpcode() == Instruction::Cast &&
isa<PointerType>(CE->getType())) {
@@ -1481,6 +1483,9 @@
for (std::map<Constant*, Constant*>::iterator I = MutatedMemory.begin(),
E = MutatedMemory.end(); I != E; ++I)
CommitValueTo(I->second, I->first);
+
+ DEBUG(std::cerr << "FULLY EVALUATED GLOBAL CTOR FUNCTION '" <<
+ F->getName() << "'\n");
return true;
}
More information about the llvm-commits
mailing list