[cfe-commits] r54115 - in /cfe/trunk/include/clang/AST: Decl.h Type.h

Chris Lattner sabre at nondot.org
Sat Jul 26 17:06:09 PDT 2008


Author: lattner
Date: Sat Jul 26 19:06:09 2008
New Revision: 54115

URL: http://llvm.org/viewvc/llvm-project?rev=54115&view=rev
Log:
remove QualType::getCanonicalType.  Also make 
QualType::ReadBackpatch public so that FieldDecl doesn't need
to be a friend of QualType.

Modified:
    cfe/trunk/include/clang/AST/Decl.h
    cfe/trunk/include/clang/AST/Type.h

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

==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Sat Jul 26 19:06:09 2008
@@ -543,7 +543,6 @@
                            QualType T, Expr *BW = NULL);
 
   QualType getType() const { return DeclType; }
-  QualType getCanonicalType() const { return DeclType.getCanonicalType(); }
   
   bool isBitField() const { return BitWidth != NULL; }
   Expr *getBitWidth() const { return BitWidth; }

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

==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Sat Jul 26 19:06:09 2008
@@ -167,10 +167,6 @@
     ID.AddPointer(getAsOpaquePtr());
   }
 
-//private:
-  /// getCanonicalType - Return the canonical version of this type, with the
-  /// appropriate type qualifiers on it.
-  inline QualType getCanonicalType() const;
 public:
   
   /// getAddressSpace - Return the address space of this type.
@@ -182,9 +178,7 @@
   /// Read - Deserialize a QualType from Bitcode.
   static QualType ReadVal(llvm::Deserializer& D);
   
-private:
   void ReadBackpatch(llvm::Deserializer& D);
-  friend class FieldDecl;
 };
 
 } // end clang.
@@ -1265,14 +1259,6 @@
 
 // Inline function definitions.
 
-/// getCanonicalType - Return the canonical version of this type, with the
-/// appropriate type qualifiers on it.
-inline QualType QualType::getCanonicalType() const {
-  QualType CanType = getTypePtr()->getCanonicalTypeInternal();
-  return QualType(CanType.getTypePtr(),
-                  getCVRQualifiers() | CanType.getCVRQualifiers());
-}
-
 /// getUnqualifiedType - Return the type without any qualifiers.
 inline QualType QualType::getUnqualifiedType() const {
   Type *TP = getTypePtr();
@@ -1283,11 +1269,12 @@
 
 /// getAddressSpace - Return the address space of this type.
 inline unsigned QualType::getAddressSpace() const {
-  if (const ArrayType *AT = dyn_cast<ArrayType>(getCanonicalType()))
+  QualType CT = getTypePtr()->getCanonicalTypeInternal();
+  if (const ArrayType *AT = dyn_cast<ArrayType>(CT))
     return AT->getBaseType().getAddressSpace();
-  if (const RecordType *RT = dyn_cast<RecordType>(getCanonicalType()))
+  if (const RecordType *RT = dyn_cast<RecordType>(CT))
     return RT->getAddressSpace();
-  if (const ASQualType *ASQT = dyn_cast<ASQualType>(getCanonicalType()))
+  if (const ASQualType *ASQT = dyn_cast<ASQualType>(CT))
     return ASQT->getAddressSpace();
   return 0;
 }





More information about the cfe-commits mailing list