diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-07-14 00:16:50 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-07-14 00:16:50 +0000 |
| commit | 6ee31f5df844f0fd52db01605742afbe552cdf1b (patch) | |
| tree | 39431865abd8bcc4858c52b371b12b27b9b463dd | |
| parent | 027f21dd72af5a76a6112501ada3eb4435e65f92 (diff) | |
| download | bcm5719-llvm-6ee31f5df844f0fd52db01605742afbe552cdf1b.tar.gz bcm5719-llvm-6ee31f5df844f0fd52db01605742afbe552cdf1b.zip | |
In "int X,Y;", compile both X and Y.
llvm-svn: 39848
| -rw-r--r-- | clang/CodeGen/CodeGenModule.cpp | 6 | ||||
| -rw-r--r-- | clang/CodeGen/CodeGenModule.h | 1 | ||||
| -rw-r--r-- | clang/CodeGen/ModuleBuilder.cpp | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/clang/CodeGen/CodeGenModule.cpp b/clang/CodeGen/CodeGenModule.cpp index b610d3eb27e..4bf4b86bcb6 100644 --- a/clang/CodeGen/CodeGenModule.cpp +++ b/clang/CodeGen/CodeGenModule.cpp @@ -88,6 +88,12 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) { } } +/// EmitGlobalVarDeclarator - Emit all the global vars attached to the specified +/// declarator chain. +void CodeGenModule::EmitGlobalVarDeclarator(const FileVarDecl *D) { + for (; D; D = cast_or_null<FileVarDecl>(D->getNextDeclarator())) + EmitGlobalVar(D); +} llvm::Function *CodeGenModule::getMemCpyFn() { if (MemCpyFn) return MemCpyFn; diff --git a/clang/CodeGen/CodeGenModule.h b/clang/CodeGen/CodeGenModule.h index 9d8547030ec..fbebdcfcf57 100644 --- a/clang/CodeGen/CodeGenModule.h +++ b/clang/CodeGen/CodeGenModule.h @@ -53,6 +53,7 @@ public: void EmitFunction(const FunctionDecl *FD); void EmitGlobalVar(const FileVarDecl *D); + void EmitGlobalVarDeclarator(const FileVarDecl *D); void PrintStats() {} }; diff --git a/clang/CodeGen/ModuleBuilder.cpp b/clang/CodeGen/ModuleBuilder.cpp index e525514df52..4a5a470563b 100644 --- a/clang/CodeGen/ModuleBuilder.cpp +++ b/clang/CodeGen/ModuleBuilder.cpp @@ -34,7 +34,7 @@ void clang::CodeGen::CodeGenFunction(BuilderTy *B, FunctionDecl *D) { /// CodeGenGlobalVar - Emit the specified global variable to LLVM. void clang::CodeGen::CodeGenGlobalVar(BuilderTy *Builder, FileVarDecl *D) { - static_cast<CodeGenModule*>(Builder)->EmitGlobalVar(D); + static_cast<CodeGenModule*>(Builder)->EmitGlobalVarDeclarator(D); } |

