aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-11-26 21:16:01 +0000
committerTed Kremenek <kremenek@apple.com>2007-11-26 21:16:01 +0000
commitd778f88d32b96a74c9edb7342c81357606a7cdc0 (patch)
tree44ab3cf4ab64ee4884faf63a5100531a259f10c4
parentebe668fac7553b9932e1936a997e96dc08c9cae4 (diff)
Reverted changed to getTagDeclType() introduced in patch 44089:
http://llvm.org/viewvc/llvm-project?view=rev&revision=44089 "Decl" once again can no longer be NULL, so the NULL checks are not needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44336 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--AST/ASTContext.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp
index 740d6e56fa..899dfdecb6 100644
--- a/AST/ASTContext.cpp
+++ b/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);
}