Finish off the refactoring of type handling stuff. Now we recompile every

tag decl after it has been completed

llvm-svn: 46798
This commit is contained in:
Chris Lattner 2008-02-06 04:51:19 +00:00
parent 73451846a7
commit a5e4d30942
2 changed files with 18 additions and 3 deletions

View File

@ -71,9 +71,19 @@ namespace {
// FIXME: implement C++ linkage, C linkage works mostly by C // FIXME: implement C++ linkage, C linkage works mostly by C
// language reuse already. // language reuse already.
} else { } 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);
}
}; };
} }

View File

@ -1,4 +1,4 @@
// RUN: clang -emit-llvm %s // RUN: clang -emit-llvm <%s
struct FileName { struct FileName {
struct FileName *next; struct FileName *next;
@ -10,7 +10,12 @@ struct ieeeExternal {
} *exthead; } *exthead;
void f() void test1()
{ {
struct ieeeExternal *exttmp = exthead; struct ieeeExternal *exttmp = exthead;
} }
struct MpegEncContext;
typedef struct MpegEncContext {int pb;} MpegEncContext;
static void test2(void) {MpegEncContext s; s.pb;}