diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-07-27 00:06:09 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-07-27 00:06:09 +0000 |
| commit | e80159da05f33afda83857c61515957baa4c15a4 (patch) | |
| tree | 08f61f64c815e207d8f93c03879fa9ecaba7a4c2 | |
| parent | 35ffe331b958d873bfdc75d5785a0a6fba7a9b48 (diff) | |
| download | bcm5719-llvm-e80159da05f33afda83857c61515957baa4c15a4.tar.gz bcm5719-llvm-e80159da05f33afda83857c61515957baa4c15a4.zip | |
remove QualType::getCanonicalType. Also make
QualType::ReadBackpatch public so that FieldDecl doesn't need
to be a friend of QualType.
llvm-svn: 54115
| -rw-r--r-- | clang/include/clang/AST/Decl.h | 1 | ||||
| -rw-r--r-- | clang/include/clang/AST/Type.h | 21 |
2 files changed, 4 insertions, 18 deletions
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h index a3713d5f3dc..0b9ac624505 100644 --- a/clang/include/clang/AST/Decl.h +++ b/clang/include/clang/AST/Decl.h @@ -543,7 +543,6 @@ public: 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; } diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index 1b2519459a0..40d550a0acf 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -167,10 +167,6 @@ public: 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 @@ public: /// 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 @@ public: // 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 @@ inline QualType QualType::getUnqualifiedType() const { /// 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; } |

