aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-05-02 16:21:50 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-05-02 16:21:50 +0000
commit0e80b7cda155ef89dbac46d5d226bb333021b5f7 (patch)
treea9042927a080a489055be73fcf07db38bed91874 /lib/Transforms
parent1dcad96dc68c8a4565f10759bcabc634f61243e0 (diff)
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
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index b804e2b358..c46677dcdf 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();