diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-07-29 17:47:36 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-07-29 17:47:36 +0000 |
commit | 837fd272f8d3ed684a984fc92d09b6a0e5b407be (patch) | |
tree | d2c6510248a8690623e8e9a97a10b8537849d90a /clang/lib/CodeGen/ModuleBuilder.cpp | |
parent | fecbc8cff16c31f7481220672657eb2f67e81521 (diff) | |
download | bcm5719-llvm-837fd272f8d3ed684a984fc92d09b6a0e5b407be.tar.gz bcm5719-llvm-837fd272f8d3ed684a984fc92d09b6a0e5b407be.zip |
Fix codegen of chained declarations
- Killed useless CodeGenModule::EmitGlobalVarDeclarator, instead just
recurse on any ScopedDecl.
- Fix for <rdar://problem/6093838>
llvm-svn: 54162
Diffstat (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp')
-rw-r--r-- | clang/lib/CodeGen/ModuleBuilder.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp index b37b8d3f01b..3fa086fc6a7 100644 --- a/clang/lib/CodeGen/ModuleBuilder.cpp +++ b/clang/lib/CodeGen/ModuleBuilder.cpp @@ -64,7 +64,7 @@ namespace { // semantic analysis (to ensure all warnings and errors are emitted). if (Diags.hasErrorOccurred()) return; - + if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { Builder->EmitFunction(FD); } else if (isa<ObjCClassDecl>(D)){ @@ -86,8 +86,7 @@ namespace { } else if (ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)){ Builder->EmitObjCMethod(OMD); } else if (VarDecl *VD = dyn_cast<VarDecl>(D)) { - if (VD->isFileVarDecl()) - Builder->EmitGlobalVarDeclarator(VD); + Builder->EmitGlobalVar(VD); } else if (isa<ObjCClassDecl>(D) || isa<ObjCCategoryDecl>(D)) { // Forward declaration. Only used for type checking. } else if (ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)){ @@ -110,6 +109,12 @@ namespace { assert(isa<TypeDecl>(D) && "Unknown top level decl"); // TODO: handle debug info? } + + if (ScopedDecl *SD = dyn_cast<ScopedDecl>(D)) { + SD = SD->getNextDeclarator(); + if (SD) + HandleTopLevelDecl(SD); + } } /// HandleTagDeclDefinition - This callback is invoked each time a TagDecl |