[cfe-commits] r46788 - /cfe/trunk/Sema/SemaDecl.cpp

Chris Lattner sabre at nondot.org
Tue Feb 5 16:51:33 PST 2008


Author: lattner
Date: Tue Feb  5 18:51:33 2008
New Revision: 46788

URL: http://llvm.org/viewvc/llvm-project?rev=46788&view=rev
Log:
inform astconsumer about tagdecls as they are defined.

Modified:
    cfe/trunk/Sema/SemaDecl.cpp

Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=46788&r1=46787&r2=46788&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Tue Feb  5 18:51:33 2008
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "Sema.h"
+#include "clang/AST/ASTConsumer.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Builtins.h"
 #include "clang/AST/Decl.h"
@@ -23,7 +24,7 @@
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/SourceManager.h"
 // FIXME: layering (ideally, Sema shouldn't be dependent on Lex API's)
-#include "clang/Lex/Preprocessor.h" 
+#include "clang/Lex/Preprocessor.h"
 #include "clang/Lex/HeaderSearch.h" 
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallSet.h"
@@ -1248,7 +1249,7 @@
     Name->setFETokenInfo(New);
     S->AddDecl(New);
   }
-
+  
   return New;
 }
 
@@ -1460,9 +1461,10 @@
   }
  
   // Okay, we successfully defined 'Record'.
-  if (Record)
+  if (Record) {
     Record->defineBody(&RecFields[0], RecFields.size());
-  else {
+    Consumer.HandleTagDeclDefinition(Record);
+  } else {
     ObjCIvarDecl **ClsFields = reinterpret_cast<ObjCIvarDecl**>(&RecFields[0]);
     if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(EnclosingDecl))
       ID->addInstanceVariablesToClass(ClsFields, RecFields.size(), RBrac);
@@ -1705,6 +1707,7 @@
   }
   
   Enum->defineElements(EltList, BestType);
+  Consumer.HandleTagDeclDefinition(Enum);
 }
 
 Sema::DeclTy* Sema::ActOnLinkageSpec(SourceLocation Loc,





More information about the cfe-commits mailing list