projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2cd43e4
)
Make the generated code for ConstantInt nicer.
author
Reid Spencer
<rspencer@reidspencer.com>
Wed, 11 Apr 2007 13:02:56 +0000
(13:02 +0000)
committer
Reid Spencer
<rspencer@reidspencer.com>
Wed, 11 Apr 2007 13:02:56 +0000
(13:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35902
91177308
-0d34-0410-b5e6-
96231b3b80d8
tools/llvm2cpp/CppWriter.cpp
patch
|
blob
|
history
diff --git
a/tools/llvm2cpp/CppWriter.cpp
b/tools/llvm2cpp/CppWriter.cpp
index 253375289ade61ba7c6acb85881ea5559c76a3a4..42a8560215a29c352c1a526f0ada577139a4f77c 100644
(file)
--- a/
tools/llvm2cpp/CppWriter.cpp
+++ b/
tools/llvm2cpp/CppWriter.cpp
@@
-694,8
+694,8
@@
void CppWriter::printConstant(const Constant *CV) {
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