[llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp
Reid Spencer
reid at x10sys.com
Wed Apr 11 06:03:13 PDT 2007
Changes in directory llvm/tools/llvm2cpp:
CppWriter.cpp updated: 1.46 -> 1.47
---
Log message:
Make the generated code for ConstantInt nicer.
---
Diffs of the changes: (+2 -2)
CppWriter.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/tools/llvm2cpp/CppWriter.cpp
diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.46 llvm/tools/llvm2cpp/CppWriter.cpp:1.47
--- llvm/tools/llvm2cpp/CppWriter.cpp:1.46 Wed Apr 11 07:41:49 2007
+++ llvm/tools/llvm2cpp/CppWriter.cpp Wed Apr 11 08:02:56 2007
@@ -694,8 +694,8 @@
return;
}
if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
- Out << "ConstantInt* " << constName << " = ConstantInt::get("
- << "APInt(cast<IntegerType>(" << typeName << ")->getBitWidth(),"
+ Out << "ConstantInt* " << constName << " = ConstantInt::get(APInt("
+ << cast<IntegerType>(CI->getType())->getBitWidth() << ", "
<< " \"" << CI->getValue().toStringSigned(10) << "\", 10));";
} else if (isa<ConstantAggregateZero>(CV)) {
Out << "ConstantAggregateZero* " << constName
More information about the llvm-commits
mailing list