diff options
-rw-r--r-- | clang/AST/ASTContext.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/AST/ASTContext.cpp b/clang/AST/ASTContext.cpp index 740d6e56fab..899dfdecb6a 100644 --- a/clang/AST/ASTContext.cpp +++ b/clang/AST/ASTContext.cpp @@ -717,17 +717,14 @@ QualType ASTContext::getTypeOfType(QualType tofType) { /// getTagDeclType - Return the unique reference to the type for the /// specified TagDecl (struct/union/class/enum) decl. QualType ASTContext::getTagDeclType(TagDecl *Decl) { - // FIXME: This method currently accepts "Decl" to be NULL for use - // by the deserializer. This interface may wished to be changed - // in the future. - + assert (Decl); + // The decl stores the type cache. - if (Decl && Decl->TypeForDecl) return QualType(Decl->TypeForDecl, 0); + if (Decl->TypeForDecl) return QualType(Decl->TypeForDecl, 0); TagType* T = new TagType(Decl, QualType()); - Types.push_back(T); - - if (Decl) Decl->TypeForDecl = T; + Types.push_back(T); + Decl->TypeForDecl = T; return QualType(T, 0); } |