[llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp
Reid Spencer
reid at x10sys.com
Sat Dec 30 22:03:32 PST 2006
Changes in directory llvm/tools/llvm2cpp:
CppWriter.cpp updated: 1.26 -> 1.27
---
Log message:
For PR950: http://llvm.org/PR950 :
Convert signed integer types to signless.
---
Diffs of the changes: (+14 -22)
CppWriter.cpp | 36 ++++++++++++++----------------------
1 files changed, 14 insertions(+), 22 deletions(-)
Index: llvm/tools/llvm2cpp/CppWriter.cpp
diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.26 llvm/tools/llvm2cpp/CppWriter.cpp:1.27
--- llvm/tools/llvm2cpp/CppWriter.cpp:1.26 Sat Dec 23 00:05:41 2006
+++ llvm/tools/llvm2cpp/CppWriter.cpp Sun Dec 31 00:02:26 2006
@@ -166,14 +166,10 @@
switch (Ty->getTypeID()) {
case Type::VoidTyID: prefix = "void_"; break;
case Type::BoolTyID: prefix = "bool_"; break;
- case Type::UByteTyID: prefix = "ubyte_"; break;
- case Type::SByteTyID: prefix = "sbyte_"; break;
- case Type::UShortTyID: prefix = "ushort_"; break;
- case Type::ShortTyID: prefix = "short_"; break;
- case Type::UIntTyID: prefix = "uint_"; break;
- case Type::IntTyID: prefix = "int_"; break;
- case Type::ULongTyID: prefix = "ulong_"; break;
- case Type::LongTyID: prefix = "long_"; break;
+ case Type::Int8TyID: prefix = "int8_"; break;
+ case Type::Int16TyID: prefix = "int16_"; break;
+ case Type::Int32TyID: prefix = "int32_"; break;
+ case Type::Int64TyID: prefix = "int64_"; break;
case Type::FloatTyID: prefix = "float_"; break;
case Type::DoubleTyID: prefix = "double_"; break;
case Type::LabelTyID: prefix = "label_"; break;
@@ -318,19 +314,15 @@
// First, handle the primitive types .. easy
if (Ty->isPrimitiveType()) {
switch (Ty->getTypeID()) {
- case Type::VoidTyID: return "Type::VoidTy";
- case Type::BoolTyID: return "Type::BoolTy";
- case Type::UByteTyID: return "Type::UByteTy";
- case Type::SByteTyID: return "Type::SByteTy";
- case Type::UShortTyID: return "Type::UShortTy";
- case Type::ShortTyID: return "Type::ShortTy";
- case Type::UIntTyID: return "Type::UIntTy";
- case Type::IntTyID: return "Type::IntTy";
- case Type::ULongTyID: return "Type::ULongTy";
- case Type::LongTyID: return "Type::LongTy";
- case Type::FloatTyID: return "Type::FloatTy";
- case Type::DoubleTyID: return "Type::DoubleTy";
- case Type::LabelTyID: return "Type::LabelTy";
+ case Type::VoidTyID: return "Type::VoidTy";
+ case Type::BoolTyID: return "Type::BoolTy";
+ case Type::Int8TyID: return "Type::Int8Ty";
+ case Type::Int16TyID: return "Type::Int16Ty";
+ case Type::Int32TyID: return "Type::Int32Ty";
+ case Type::Int64TyID: return "Type::Int64Ty";
+ case Type::FloatTyID: return "Type::FloatTy";
+ case Type::DoubleTyID: return "Type::DoubleTy";
+ case Type::LabelTyID: return "Type::LabelTy";
default:
error("Invalid primitive type");
break;
@@ -692,7 +684,7 @@
printCFP(CFP);
Out << ";";
} else if (const ConstantArray *CA = dyn_cast<ConstantArray>(CV)) {
- if (CA->isString() && CA->getType()->getElementType() == Type::SByteTy) {
+ if (CA->isString() && CA->getType()->getElementType() == Type::Int8Ty) {
Out << "Constant* " << constName << " = ConstantArray::get(\"";
printEscapedString(CA->getAsString());
// Determine if we want null termination or not.
More information about the llvm-commits
mailing list