diff options
author | Chris Lattner <sabre@nondot.org> | 2008-07-26 22:37:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-07-26 22:37:01 +0000 |
commit | 9619662a1d42e2008b865d3459c0677e149dad1b (patch) | |
tree | 0714b13525e4c45644753ff246259e78f6775fd5 /lib/CodeGen/CodeGenTypes.cpp | |
parent | 8b51fd76319d8b71f401cc6ad56e6f4f7be77958 (diff) |
remove uses of QualType::getCanonicalType() from codegen for PR2189
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenTypes.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 41ec2dd0f7..db053aebb8 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -94,16 +94,18 @@ const llvm::Type *CodeGenTypes::ConvertType(QualType T) { } const llvm::Type *CodeGenTypes::ConvertTypeRecursive(QualType T) { + T = Context.getCanonicalType(T);; + // See if type is already cached. llvm::DenseMap<Type *, llvm::PATypeHolder>::iterator - I = TypeCache.find(T.getCanonicalType().getTypePtr()); + I = TypeCache.find(T.getTypePtr()); // If type is found in map and this is not a definition for a opaque // place holder type then use it. Otherwise, convert type T. if (I != TypeCache.end()) return I->second.get(); const llvm::Type *ResultType = ConvertNewType(T); - TypeCache.insert(std::make_pair(T.getCanonicalType().getTypePtr(), + TypeCache.insert(std::make_pair(T.getTypePtr(), llvm::PATypeHolder(ResultType))); return ResultType; } @@ -184,7 +186,7 @@ static const llvm::Type* getTypeForFormat(const llvm::fltSemantics &format) { } const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { - const clang::Type &Ty = *T.getCanonicalType(); + const clang::Type &Ty = *Context.getCanonicalType(T); switch (Ty.getTypeClass()) { case Type::TypeName: // typedef isn't canonical. |