[cfe-commits] r44336 - /cfe/trunk/AST/ASTContext.cpp
Ted Kremenek
kremenek at apple.com
Mon Nov 26 13:16:01 PST 2007
Author: kremenek
Date: Mon Nov 26 15:16:01 2007
New Revision: 44336
URL: http://llvm.org/viewvc/llvm-project?rev=44336&view=rev
Log:
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.
Modified:
cfe/trunk/AST/ASTContext.cpp
Modified: cfe/trunk/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/ASTContext.cpp?rev=44336&r1=44335&r2=44336&view=diff
==============================================================================
--- cfe/trunk/AST/ASTContext.cpp (original)
+++ cfe/trunk/AST/ASTContext.cpp Mon Nov 26 15:16:01 2007
@@ -717,17 +717,14 @@
/// 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);
}
More information about the cfe-commits
mailing list