From: Nick Lewycky Date: Sat, 2 May 2009 16:21:50 +0000 (+0000) Subject: Don't append ".b" to the names of globals that are being shrunk to booleans. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=0e80b7cda155ef89dbac46d5d226bb333021b5f7;p=oota-llvm.git Don't append ".b" to the names of globals that are being shrunk to booleans. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70630 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index b804e2b3587..c46677dcdf7 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -1549,10 +1549,12 @@ static bool TryToShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) { // Create the new global, initializing it to false. GlobalVariable *NewGV = new GlobalVariable(Type::Int1Ty, false, - GlobalValue::InternalLinkage, ConstantInt::getFalse(), - GV->getName()+".b", + GlobalValue::InternalLinkage, + ConstantInt::getFalse(), + "", (Module *)NULL, GV->isThreadLocal()); + NewGV->takeName(GV); GV->getParent()->getGlobalList().insert(GV, NewGV); Constant *InitVal = GV->getInitializer();