aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-07-14 00:16:50 +0000
committerChris Lattner <sabre@nondot.org>2007-07-14 00:16:50 +0000
commit32b266cff60737fedff00e8e721f3474533835ef (patch)
tree6af9669c9dfc3923b591bab0d06143743907e694
parent06c8d963bcdd73797959d46b9f6d46661e7588a6 (diff)
In "int X,Y;", compile both X and Y.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39848 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CodeGen/CodeGenModule.cpp6
-rw-r--r--CodeGen/CodeGenModule.h1
-rw-r--r--CodeGen/ModuleBuilder.cpp2
3 files changed, 8 insertions, 1 deletions
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp
index b610d3eb27..4bf4b86bcb 100644
--- a/CodeGen/CodeGenModule.cpp
+++ b/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/CodeGen/CodeGenModule.h b/CodeGen/CodeGenModule.h
index 9d8547030e..fbebdcfcf5 100644
--- a/CodeGen/CodeGenModule.h
+++ b/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/CodeGen/ModuleBuilder.cpp b/CodeGen/ModuleBuilder.cpp
index e525514df5..4a5a470563 100644
--- a/CodeGen/ModuleBuilder.cpp
+++ b/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);
}