From a5e4d30942a5489d8889c58f420f3fa48f6a468d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 6 Feb 2008 04:51:19 +0000 Subject: Finish off the refactoring of type handling stuff. Now we recompile every tag decl after it has been completed llvm-svn: 46798 --- clang/CodeGen/ModuleBuilder.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'clang/CodeGen/ModuleBuilder.cpp') diff --git a/clang/CodeGen/ModuleBuilder.cpp b/clang/CodeGen/ModuleBuilder.cpp index c59ef447e66..8d3207a19ce 100644 --- a/clang/CodeGen/ModuleBuilder.cpp +++ b/clang/CodeGen/ModuleBuilder.cpp @@ -71,9 +71,19 @@ namespace { // FIXME: implement C++ linkage, C linkage works mostly by C // language reuse already. } else { - Builder->EmitType(cast(D)); + assert(isa(D) && "Unknown top level decl"); + // TODO: handle debug info? } } + + /// HandleTagDeclDefinition - This callback is invoked each time a TagDecl + /// (e.g. struct, union, enum, class) is completed. This allows the client to + /// hack on the type, which can occur at any point in the file (because these + /// can be defined in declspecs). + virtual void HandleTagDeclDefinition(TagDecl *D) { + Builder->EmitType(D); + } + }; } -- cgit v1.2.3