[cfe-commits] r92246 - in /cfe/trunk: include/clang/AST/ include/clang/Frontend/ lib/AST/ lib/CodeGen/ lib/Frontend/ lib/Sema/

Anders Carlsson andersca at mac.com
Mon Dec 28 23:07:37 PST 2009


Author: andersca
Date: Tue Dec 29 01:07:36 2009
New Revision: 92246

URL: http://llvm.org/viewvc/llvm-project?rev=92246&view=rev
Log:
Get rid of FixedWidthIntType, as suggested by Chris and Eli.

Modified:
    cfe/trunk/include/clang/AST/ASTContext.h
    cfe/trunk/include/clang/AST/Type.h
    cfe/trunk/include/clang/AST/TypeLoc.h
    cfe/trunk/include/clang/AST/TypeNodes.def
    cfe/trunk/include/clang/Frontend/PCHBitCodes.h
    cfe/trunk/include/clang/Frontend/TypeXML.def
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/AST/Type.cpp
    cfe/trunk/lib/AST/TypePrinter.cpp
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
    cfe/trunk/lib/CodeGen/Mangle.cpp
    cfe/trunk/lib/Frontend/PCHReader.cpp
    cfe/trunk/lib/Frontend/PCHWriter.cpp
    cfe/trunk/lib/Sema/Sema.cpp
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp
    cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
    cfe/trunk/lib/Sema/TreeTransform.h

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Tue Dec 29 01:07:36 2009
@@ -115,9 +115,6 @@
   /// \brief Mapping from ObjCContainers to their ObjCImplementations.
   llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
 
-  llvm::DenseMap<unsigned, FixedWidthIntType*> SignedFixedWidthIntTypes;
-  llvm::DenseMap<unsigned, FixedWidthIntType*> UnsignedFixedWidthIntTypes;
-
   /// BuiltinVaListType - built-in va list type.
   /// This is initially null and set by Sema::LazilyCreateBuiltin when
   /// a builtin that takes a valist is encountered.
@@ -725,8 +722,6 @@
   void setBuiltinVaListType(QualType T);
   QualType getBuiltinVaListType() const { return BuiltinVaListType; }
 
-  QualType getFixedWidthIntType(unsigned Width, bool Signed);
-
   /// getCVRQualifiedType - Returns a type with additional const,
   /// volatile, or restrict qualifiers.
   QualType getCVRQualifiedType(QualType T, unsigned CVR) {

Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Tue Dec 29 01:07:36 2009
@@ -1049,28 +1049,6 @@
   static bool classof(const BuiltinType *) { return true; }
 };
 
-/// FixedWidthIntType - Used for arbitrary width types that we either don't
-/// want to or can't map to named integer types.  These always have a lower
-/// integer rank than builtin types of the same width.
-class FixedWidthIntType : public Type {
-private:
-  unsigned Width;
-  bool Signed;
-public:
-  FixedWidthIntType(unsigned W, bool S) : Type(FixedWidthInt, QualType(), false),
-                                          Width(W), Signed(S) {}
-
-  unsigned getWidth() const { return Width; }
-  bool isSigned() const { return Signed; }
-  const char *getName() const;
-
-  bool isSugared() const { return false; }
-  QualType desugar() const { return QualType(this, 0); }
-
-  static bool classof(const Type *T) { return T->getTypeClass() == FixedWidthInt; }
-  static bool classof(const FixedWidthIntType *) { return true; }
-};
-
 /// ComplexType - C99 6.2.5p11 - Complex values.  This supports the C99 complex
 /// types (_Complex float etc) as well as the GCC integer complex extensions.
 ///

Modified: cfe/trunk/include/clang/AST/TypeLoc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/TypeLoc.h (original)
+++ cfe/trunk/include/clang/AST/TypeLoc.h Tue Dec 29 01:07:36 2009
@@ -1023,13 +1023,6 @@
                                      DependentSizedExtVectorType> {
 };
 
-// FIXME: I'm not sure how you actually specify these;  with attributes?
-class FixedWidthIntTypeLoc :
-    public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
-                                     FixedWidthIntTypeLoc,
-                                     FixedWidthIntType> {
-};
-
 // FIXME: location of the '_Complex' keyword.
 class ComplexTypeLoc : public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
                                                         ComplexTypeLoc,

Modified: cfe/trunk/include/clang/AST/TypeNodes.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeNodes.def?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/TypeNodes.def (original)
+++ cfe/trunk/include/clang/AST/TypeNodes.def Tue Dec 29 01:07:36 2009
@@ -52,7 +52,6 @@
 #endif
 
 TYPE(Builtin, Type)
-TYPE(FixedWidthInt, Type)
 TYPE(Complex, Type)
 TYPE(Pointer, Type)
 TYPE(BlockPointer, Type)
@@ -92,7 +91,6 @@
 #ifdef LEAF_TYPE
 LEAF_TYPE(Enum)
 LEAF_TYPE(Builtin)
-LEAF_TYPE(FixedWidthInt)
 LEAF_TYPE(ObjCInterface)
 LEAF_TYPE(TemplateTypeParm)
 #undef LEAF_TYPE

Modified: cfe/trunk/include/clang/Frontend/PCHBitCodes.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/PCHBitCodes.h?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/include/clang/Frontend/PCHBitCodes.h (original)
+++ cfe/trunk/include/clang/Frontend/PCHBitCodes.h Tue Dec 29 01:07:36 2009
@@ -357,8 +357,6 @@
     enum TypeCode {
       /// \brief An ExtQualType record.
       TYPE_EXT_QUAL                 = 1,
-      /// \brief A FixedWidthIntType record.
-      TYPE_FIXED_WIDTH_INT          = 2,
       /// \brief A ComplexType record.
       TYPE_COMPLEX                  = 3,
       /// \brief A PointerType record.

Modified: cfe/trunk/include/clang/Frontend/TypeXML.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/TypeXML.def?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/include/clang/Frontend/TypeXML.def (original)
+++ cfe/trunk/include/clang/Frontend/TypeXML.def Tue Dec 29 01:07:36 2009
@@ -103,12 +103,6 @@
   END_ENUM_XML
 END_NODE_XML
 
-NODE_XML(FixedWidthIntType, "FixedWidthIntType")
-  ID_ATTRIBUTE_XML
-  ATTRIBUTE_XML(getWidth(), "width")                    // unsigned
-  ATTRIBUTE_XML(isSigned(), "is_signed")                // boolean
-END_NODE_XML
-
 NODE_XML(PointerType, "PointerType")    
   ID_ATTRIBUTE_XML
   TYPE_ATTRIBUTE_XML(getPointeeType())

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue Dec 29 01:07:36 2009
@@ -694,13 +694,6 @@
       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 @@
   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 @@
   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 @@
 
     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 @@
 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

Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Tue Dec 29 01:07:36 2009
@@ -387,8 +387,6 @@
     // 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::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::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 @@
   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 @@
            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 @@
     // 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 @@
       return true;
     return false;
   }
-  if (isa<FixedWidthIntType>(CanonicalType))
-    return true;
   return isa<PointerType>(CanonicalType) ||
          isa<BlockPointerType>(CanonicalType) ||
          isa<MemberPointerType>(CanonicalType) ||

Modified: cfe/trunk/lib/AST/TypePrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypePrinter.cpp?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/AST/TypePrinter.cpp (original)
+++ cfe/trunk/lib/AST/TypePrinter.cpp Tue Dec 29 01:07:36 2009
@@ -94,21 +94,6 @@
   }
 }
 
-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;

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Dec 29 01:07:36 2009
@@ -917,7 +917,6 @@
   // FIXME: Handle these.
   case Type::ExtVector:
   case Type::Vector:
-  case Type::FixedWidthInt:
     return llvm::DIType();
       
   case Type::ObjCObjectPointer:
@@ -1101,7 +1100,7 @@
     EltTys.push_back(FieldTy);
     FieldOffset += FieldSize;
 
-    FType = CGM.getContext().getFixedWidthIntType(32, true); // Int32Ty;
+    FType = CGM.getContext().IntTy;
     FieldTy = CGDebugInfo::getOrCreateType(FType, Unit);
     FieldSize = CGM.getContext().getTypeSize(FType);
     FieldAlign = CGM.getContext().getTypeAlign(FType);
@@ -1112,7 +1111,7 @@
     EltTys.push_back(FieldTy);
     FieldOffset += FieldSize;
 
-    FType = CGM.getContext().getFixedWidthIntType(32, true); // Int32Ty;
+    FType = CGM.getContext().IntTy;
     FieldTy = CGDebugInfo::getOrCreateType(FType, Unit);
     FieldSize = CGM.getContext().getTypeSize(FType);
     FieldAlign = CGM.getContext().getTypeAlign(FType);
@@ -1278,7 +1277,7 @@
     EltTys.push_back(FieldTy);
     FieldOffset += FieldSize;
 
-    FType = CGM.getContext().getFixedWidthIntType(32, true); // Int32Ty;
+    FType = CGM.getContext().IntTy;
     FieldTy = CGDebugInfo::getOrCreateType(FType, Unit);
     FieldSize = CGM.getContext().getTypeSize(FType);
     FieldAlign = CGM.getContext().getTypeAlign(FType);
@@ -1289,7 +1288,7 @@
     EltTys.push_back(FieldTy);
     FieldOffset += FieldSize;
 
-    FType = CGM.getContext().getFixedWidthIntType(32, true); // Int32Ty;
+    FType = CGM.getContext().IntTy;
     FieldTy = CGDebugInfo::getOrCreateType(FType, Unit);
     FieldSize = CGM.getContext().getTypeSize(FType);
     FieldAlign = CGM.getContext().getTypeAlign(FType);

Modified: cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTypes.cpp?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenTypes.cpp Tue Dec 29 01:07:36 2009
@@ -254,9 +254,6 @@
     assert(0 && "Unknown builtin type!");
     break;
   }
-  case Type::FixedWidthInt:
-    return llvm::IntegerType::get(getLLVMContext(),
-                                  cast<FixedWidthIntType>(T)->getWidth());
   case Type::Complex: {
     const llvm::Type *EltTy =
       ConvertTypeRecursive(cast<ComplexType>(Ty).getElementType());

Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Tue Dec 29 01:07:36 2009
@@ -994,10 +994,6 @@
   mangleType(T->getPointeeType());
 }
 
-void CXXNameMangler::mangleType(const FixedWidthIntType *T) {
-  assert(false && "can't mangle arbitary-precision integer type yet");
-}
-
 void CXXNameMangler::mangleType(const TemplateSpecializationType *T) {
   TemplateDecl *TD = T->getTemplateName().getAsTemplateDecl();
   assert(TD && "FIXME: Support dependent template names!");

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Tue Dec 29 01:07:36 2009
@@ -1761,11 +1761,6 @@
     return Context->getQualifiedType(Base, Quals);
   }
 
-  case pch::TYPE_FIXED_WIDTH_INT: {
-    assert(Record.size() == 2 && "Incorrect encoding of fixed-width int type");
-    return Context->getFixedWidthIntType(Record[0], Record[1]);
-  }
-
   case pch::TYPE_COMPLEX: {
     assert(Record.size() == 1 && "Incorrect encoding of complex type");
     QualType ElemType = GetType(Record[0]);
@@ -1987,9 +1982,6 @@
 void TypeLocReader::VisitBuiltinTypeLoc(BuiltinTypeLoc TL) {
   TL.setNameLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
 }
-void TypeLocReader::VisitFixedWidthIntTypeLoc(FixedWidthIntTypeLoc TL) {
-  TL.setNameLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
-}
 void TypeLocReader::VisitComplexTypeLoc(ComplexTypeLoc TL) {
   TL.setNameLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
 }

Modified: cfe/trunk/lib/Frontend/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriter.cpp?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriter.cpp Tue Dec 29 01:07:36 2009
@@ -69,12 +69,6 @@
   assert(false && "Built-in types are never serialized");
 }
 
-void PCHTypeWriter::VisitFixedWidthIntType(const FixedWidthIntType *T) {
-  Record.push_back(T->getWidth());
-  Record.push_back(T->isSigned());
-  Code = pch::TYPE_FIXED_WIDTH_INT;
-}
-
 void PCHTypeWriter::VisitComplexType(const ComplexType *T) {
   Writer.AddTypeRef(T->getElementType(), Record);
   Code = pch::TYPE_COMPLEX;
@@ -283,9 +277,6 @@
 void TypeLocWriter::VisitBuiltinTypeLoc(BuiltinTypeLoc TL) {
   Writer.AddSourceLocation(TL.getNameLoc(), Record);
 }
-void TypeLocWriter::VisitFixedWidthIntTypeLoc(FixedWidthIntTypeLoc TL) {
-  Writer.AddSourceLocation(TL.getNameLoc(), Record);
-}
 void TypeLocWriter::VisitComplexTypeLoc(ComplexTypeLoc TL) {
   Writer.AddSourceLocation(TL.getNameLoc(), Record);
 }
@@ -559,7 +550,6 @@
   // Decls and Types block.
   BLOCK(DECLTYPES_BLOCK);
   RECORD(TYPE_EXT_QUAL);
-  RECORD(TYPE_FIXED_WIDTH_INT);
   RECORD(TYPE_COMPLEX);
   RECORD(TYPE_POINTER);
   RECORD(TYPE_BLOCK_POINTER);

Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Tue Dec 29 01:07:36 2009
@@ -389,12 +389,6 @@
     return true;
   }
 
-  if (const FixedWidthIntType *FWIT = dyn_cast<FixedWidthIntType>(T)) {
-    BitWidth = FWIT->getWidth();
-    Signed = FWIT->isSigned();
-    return true;
-  }
-
   return false;
 }
 
@@ -655,8 +649,7 @@
     }
 
     // If the target is integral, always warn.
-    if ((TargetBT && TargetBT->isInteger()) ||
-        isa<FixedWidthIntType>(Target))
+    if ((TargetBT && TargetBT->isInteger()))
       // TODO: don't warn for integer values?
       return DiagnoseImpCast(S, E, T, diag::warn_impcast_float_integer);
 

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Tue Dec 29 01:07:36 2009
@@ -1614,7 +1614,10 @@
       S.Diag(Attr.getLoc(), diag::err_unsupported_machine_mode) << Name;
       return;
     }
-    NewTy = S.Context.getFixedWidthIntType(128, OldTy->isSignedIntegerType());
+    if (OldTy->isSignedIntegerType())
+      NewTy = S.Context.Int128Ty;
+    else
+      NewTy = S.Context.UnsignedInt128Ty;
     break;
   }
 

Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Tue Dec 29 01:07:36 2009
@@ -2401,7 +2401,6 @@
 
   // None of these types have any template parameters in them.
   case Type::Builtin:
-  case Type::FixedWidthInt:
   case Type::VariableArray:
   case Type::FunctionNoProto:
   case Type::Record:

Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=92246&r1=92245&r2=92246&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Tue Dec 29 01:07:36 2009
@@ -2134,13 +2134,6 @@
 }
 
 template<typename Derived>
-QualType
-TreeTransform<Derived>::TransformFixedWidthIntType(TypeLocBuilder &TLB,
-                                                   FixedWidthIntTypeLoc T) {
-  return TransformTypeSpecType(TLB, T);
-}
-
-template<typename Derived>
 QualType TreeTransform<Derived>::TransformComplexType(TypeLocBuilder &TLB,
                                                       ComplexTypeLoc T) {
   // FIXME: recurse?
@@ -5255,9 +5248,6 @@
       break;
     }
 
-  if (SizeType.isNull())
-    SizeType = SemaRef.Context.getFixedWidthIntType(Size->getBitWidth(), false);
-
   IntegerLiteral ArraySize(*Size, SizeType, /*FIXME*/BracketsRange.getBegin());
   return SemaRef.BuildArrayType(ElementType, SizeMod, &ArraySize,
                                 IndexTypeQuals, BracketsRange,





More information about the cfe-commits mailing list