Use APInt conversion to string so the result is correct regardless of the
authorReid Spencer <rspencer@reidspencer.com>
Thu, 1 Mar 2007 21:00:32 +0000 (21:00 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Thu, 1 Mar 2007 21:00:32 +0000 (21:00 +0000)
bit width of the ConstantInt being converted.

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

lib/Transforms/IPO/ArgumentPromotion.cpp

index 7036a01f0900ec883d92f6e68552d05d75970e78..e1fe118686e902f83a8f14d02588662fa3d3b1f5 100644 (file)
@@ -515,7 +515,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
           std::string NewName = I->getName();
           for (unsigned i = 0, e = Operands.size(); i != e; ++i)
             if (ConstantInt *CI = dyn_cast<ConstantInt>(Operands[i]))
-              NewName += "."+itostr((int64_t)CI->getZExtValue());
+              NewName += "." + CI->getValue().toString(10);
             else
               NewName += ".x";
           TheArg->setName(NewName+".val");