Revert r70630. Go back to appending ".b" to internal globals when shrinking
authorNick Lewycky <nicholas@mxc.ca>
Sun, 3 May 2009 03:49:08 +0000 (03:49 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sun, 3 May 2009 03:49:08 +0000 (03:49 +0000)
them to bool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70653 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/GlobalOpt.cpp

index c46677dcdf7407c66e7dde934796ed9d77449c56..b804e2b35876b0bcbcb8e685d5a79dd20785cf94 100644 (file)
@@ -1549,12 +1549,10 @@ 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(),
-                                             "",
+         GlobalValue::InternalLinkage, ConstantInt::getFalse(),
+                                             GV->getName()+".b",
                                              (Module *)NULL,
                                              GV->isThreadLocal());
-  NewGV->takeName(GV);
   GV->getParent()->getGlobalList().insert(GV, NewGV);
 
   Constant *InitVal = GV->getInitializer();