summaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-11 18:21:29 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-11 18:21:29 +0000
commit4fe16d607d11e29d742208894909733f5ad01f8f (patch)
treea669ba57373e87d31c3af6f301fe4a61f773f4b3 /lib/Target
parent34dceb47573b0aedd188b5e72bb848ba29a4960f (diff)
downloadllvm-4fe16d607d11e29d742208894909733f5ad01f8f.tar.gz
llvm-4fe16d607d11e29d742208894909733f5ad01f8f.tar.bz2
llvm-4fe16d607d11e29d742208894909733f5ad01f8f.tar.xz
Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/CBackend/CBackend.cpp12
-rw-r--r--lib/Target/TargetData.cpp2
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 9517134c88..f945036a74 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -369,7 +369,7 @@ CWriter::printPrimitiveType(std::ostream &Out, const Type *Ty, bool isSigned,
assert(Ty->isPrimitiveType() && "Invalid type for printPrimitiveType");
switch (Ty->getTypeID()) {
case Type::VoidTyID: return Out << "void " << NameSoFar;
- case Type::BoolTyID: return Out << "bool " << NameSoFar;
+ case Type::Int1TyID: return Out << "bool " << NameSoFar;
case Type::Int8TyID:
return Out << (isSigned?"signed":"unsigned") << " char " << NameSoFar;
case Type::Int16TyID:
@@ -688,12 +688,12 @@ void CWriter::printConstant(Constant *CPV) {
Out << "(";
printCast(CE->getOpcode(), CE->getOperand(0)->getType(), CE->getType());
if (CE->getOpcode() == Instruction::SExt &&
- CE->getOperand(0)->getType() == Type::BoolTy) {
+ CE->getOperand(0)->getType() == Type::Int1Ty) {
// Make sure we really sext from bool here by subtracting from 0
Out << "0-";
}
printConstant(CE->getOperand(0));
- if (CE->getType() == Type::BoolTy &&
+ if (CE->getType() == Type::Int1Ty &&
(CE->getOpcode() == Instruction::Trunc ||
CE->getOpcode() == Instruction::FPToUI ||
CE->getOpcode() == Instruction::FPToSI ||
@@ -828,7 +828,7 @@ void CWriter::printConstant(Constant *CPV) {
if (ConstantInt *CI = dyn_cast<ConstantInt>(CPV)) {
const Type* Ty = CI->getType();
- if (Ty == Type::BoolTy)
+ if (Ty == Type::Int1Ty)
Out << (CI->getBoolValue() ? '1' : '0') ;
else {
Out << "((";
@@ -2256,12 +2256,12 @@ void CWriter::visitCastInst(CastInst &I) {
<< getFloatBitCastField(I.getType());
} else {
printCast(I.getOpcode(), SrcTy, DstTy);
- if (I.getOpcode() == Instruction::SExt && SrcTy == Type::BoolTy) {
+ if (I.getOpcode() == Instruction::SExt && SrcTy == Type::Int1Ty) {
// Make sure we really get a sext from bool by subtracing the bool from 0
Out << "0-";
}
writeOperand(I.getOperand(0));
- if (DstTy == Type::BoolTy &&
+ if (DstTy == Type::Int1Ty &&
(I.getOpcode() == Instruction::Trunc ||
I.getOpcode() == Instruction::FPToUI ||
I.getOpcode() == Instruction::FPToSI ||
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index db0ea2cb4c..59dc0dca50 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -241,7 +241,7 @@ static inline void getTypeInfo(const Type *Ty, const TargetData *TD,
uint64_t &Size, unsigned char &Alignment) {
assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!");
switch (Ty->getTypeID()) {
- case Type::BoolTyID: Size = 1; Alignment = TD->getBoolAlignment(); return;
+ case Type::Int1TyID: Size = 1; Alignment = TD->getBoolAlignment(); return;
case Type::VoidTyID:
case Type::Int8TyID: Size = 1; Alignment = TD->getByteAlignment(); return;
case Type::Int16TyID: Size = 2; Alignment = TD->getShortAlignment(); return;