diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-02-06 04:51:19 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-02-06 04:51:19 +0000 |
| commit | a5e4d30942a5489d8889c58f420f3fa48f6a468d (patch) | |
| tree | 83f253829a9d5f780e88a7bd341b3feb6d8a0da2 /clang/CodeGen/ModuleBuilder.cpp | |
| parent | 73451846a7970922e2eeb6e1d8c875ea01e1af08 (diff) | |
| download | bcm5719-llvm-a5e4d30942a5489d8889c58f420f3fa48f6a468d.tar.gz bcm5719-llvm-a5e4d30942a5489d8889c58f420f3fa48f6a468d.zip | |
Finish off the refactoring of type handling stuff. Now we recompile every
tag decl after it has been completed
llvm-svn: 46798
Diffstat (limited to 'clang/CodeGen/ModuleBuilder.cpp')
| -rw-r--r-- | clang/CodeGen/ModuleBuilder.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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<TypeDecl>(D)); + assert(isa<TypeDecl>(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); + } + }; } |

