summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTContext.cpp28
-rw-r--r--clang/lib/AST/Type.cpp22
-rw-r--r--clang/lib/AST/TypePrinter.cpp15
3 files changed, 2 insertions, 63 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 13da4b8b130..4bfea2421cb 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -694,13 +694,6 @@ ASTContext::getTypeInfo(const Type *T) {
break;
}
break;
- case Type::FixedWidthInt:
- // FIXME: This isn't precisely correct; the width/alignment should depend
- // on the available types for the target
- Width = cast<FixedWidthIntType>(T)->getWidth();
- Width = std::max(llvm::NextPowerOf2(Width - 1), (uint64_t)8);
- Align = Width;
- break;
case Type::ObjCObjectPointer:
Width = Target.getPointerWidth(0);
Align = Target.getPointerAlign(0);
@@ -1274,15 +1267,6 @@ QualType ASTContext::getComplexType(QualType T) {
return QualType(New, 0);
}
-QualType ASTContext::getFixedWidthIntType(unsigned Width, bool Signed) {
- llvm::DenseMap<unsigned, FixedWidthIntType*> &Map = Signed ?
- SignedFixedWidthIntTypes : UnsignedFixedWidthIntTypes;
- FixedWidthIntType *&Entry = Map[Width];
- if (!Entry)
- Entry = new FixedWidthIntType(Width, Signed);
- return QualType(Entry, 0);
-}
-
/// getPointerType - Return the uniqued reference to the type for a pointer to
/// the specified type.
QualType ASTContext::getPointerType(QualType T) {
@@ -2689,12 +2673,6 @@ unsigned ASTContext::getIntegerRank(Type *T) {
if (T->isSpecificBuiltinType(BuiltinType::Char32))
T = getFromTargetType(Target.getChar32Type()).getTypePtr();
- // There are two things which impact the integer rank: the width, and
- // the ordering of builtins. The builtin ordering is encoded in the
- // bottom three bits; the width is encoded in the bits above that.
- if (FixedWidthIntType* FWIT = dyn_cast<FixedWidthIntType>(T))
- return FWIT->getWidth() << 3;
-
switch (cast<BuiltinType>(T)->getKind()) {
default: assert(0 && "getIntegerRank(): not a built-in integer");
case BuiltinType::Bool:
@@ -4507,9 +4485,6 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS) {
return QualType();
}
- case Type::FixedWidthInt:
- // Distinct fixed-width integers are not compatible.
- return QualType();
case Type::TemplateSpecialization:
assert(false && "Dependent types have no size");
break;
@@ -4525,9 +4500,6 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS) {
unsigned ASTContext::getIntWidth(QualType T) {
if (T->isBooleanType())
return 1;
- if (FixedWidthIntType *FWIT = dyn_cast<FixedWidthIntType>(T)) {
- return FWIT->getWidth();
- }
if (EnumType *ET = dyn_cast<EnumType>(T))
T = ET->getDecl()->getIntegerType();
// For builtin types, just use the standard type sizing method
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index bed7f9b6c7a..e0055f18782 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -387,8 +387,6 @@ bool Type::isIntegerType() const {
// FIXME: In C++, enum types are never integer types.
if (TT->getDecl()->isEnum() && TT->getDecl()->isDefinition())
return true;
- if (isa<FixedWidthIntType>(CanonicalType))
- return true;
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isIntegerType();
return false;
@@ -397,13 +395,11 @@ bool Type::isIntegerType() const {
bool Type::isIntegralType() const {
if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
return BT->getKind() >= BuiltinType::Bool &&
- BT->getKind() <= BuiltinType::LongLong;
+ BT->getKind() <= BuiltinType::Int128;
if (const TagType *TT = dyn_cast<TagType>(CanonicalType))
if (TT->getDecl()->isEnum() && TT->getDecl()->isDefinition())
return true; // Complete enum types are integral.
// FIXME: In C++, enum types are never integral.
- if (isa<FixedWidthIntType>(CanonicalType))
- return true;
return false;
}
@@ -453,16 +449,12 @@ bool Type::isAnyCharacterType() const {
bool Type::isSignedIntegerType() const {
if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType)) {
return BT->getKind() >= BuiltinType::Char_S &&
- BT->getKind() <= BuiltinType::LongLong;
+ BT->getKind() <= BuiltinType::Int128;
}
if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
return ET->getDecl()->getIntegerType()->isSignedIntegerType();
- if (const FixedWidthIntType *FWIT =
- dyn_cast<FixedWidthIntType>(CanonicalType))
- return FWIT->isSigned();
-
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isSignedIntegerType();
return false;
@@ -481,10 +473,6 @@ bool Type::isUnsignedIntegerType() const {
if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
- if (const FixedWidthIntType *FWIT =
- dyn_cast<FixedWidthIntType>(CanonicalType))
- return !FWIT->isSigned();
-
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isUnsignedIntegerType();
return false;
@@ -515,8 +503,6 @@ bool Type::isRealType() const {
BT->getKind() <= BuiltinType::LongDouble;
if (const TagType *TT = dyn_cast<TagType>(CanonicalType))
return TT->getDecl()->isEnum() && TT->getDecl()->isDefinition();
- if (isa<FixedWidthIntType>(CanonicalType))
- return true;
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isRealType();
return false;
@@ -530,8 +516,6 @@ bool Type::isArithmeticType() const {
// GCC allows forward declaration of enum types (forbid by C99 6.7.2.3p2).
// If a body isn't seen by the time we get here, return false.
return ET->getDecl()->isDefinition();
- if (isa<FixedWidthIntType>(CanonicalType))
- return true;
return isa<ComplexType>(CanonicalType) || isa<VectorType>(CanonicalType);
}
@@ -545,8 +529,6 @@ bool Type::isScalarType() const {
return true;
return false;
}
- if (isa<FixedWidthIntType>(CanonicalType))
- return true;
return isa<PointerType>(CanonicalType) ||
isa<BlockPointerType>(CanonicalType) ||
isa<MemberPointerType>(CanonicalType) ||
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp
index 4a2b9561729..818657c2a76 100644
--- a/clang/lib/AST/TypePrinter.cpp
+++ b/clang/lib/AST/TypePrinter.cpp
@@ -94,21 +94,6 @@ void TypePrinter::PrintBuiltin(const BuiltinType *T, std::string &S) {
}
}
-void TypePrinter::PrintFixedWidthInt(const FixedWidthIntType *T,
- std::string &S) {
- // FIXME: Once we get bitwidth attribute, write as
- // "int __attribute__((bitwidth(x)))".
- std::string prefix = "__clang_fixedwidth";
- prefix += llvm::utostr_32(T->getWidth());
- prefix += (char)(T->isSigned() ? 'S' : 'U');
- if (S.empty()) {
- S = prefix;
- } else {
- // Prefix the basic type, e.g. 'int X'.
- S = prefix + S;
- }
-}
-
void TypePrinter::PrintComplex(const ComplexType *T, std::string &S) {
Print(T->getElementType(), S);
S = "_Complex " + S;
OpenPOWER on IntegriCloud