mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-01 00:25:01 +00:00
Add a debug printout, fix a crash on kc++
llvm-svn: 23450
This commit is contained in:
parent
7283d69b9f
commit
c1fe36502e
@ -320,7 +320,9 @@ static bool CleanupConstantGlobalUsers(Value *V, Constant *Init) {
|
||||
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 @@ static bool EvaluateStaticConstructor(Function *F) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user