diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-02-02 04:43:11 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-02-02 04:43:11 +0000 |
| commit | ce6ae5cb06602f519077ffd83e06b25fdc8f18f8 (patch) | |
| tree | 808987c9d1ea483a5db856d26ecdf9ddd4988c86 /clang/CodeGen/CodeGenModule.cpp | |
| parent | efd142a92081d25766cccb493f0580d0d05ec19e (diff) | |
| download | bcm5719-llvm-ce6ae5cb06602f519077ffd83e06b25fdc8f18f8.tar.gz bcm5719-llvm-ce6ae5cb06602f519077ffd83e06b25fdc8f18f8.zip | |
fix codegen on static variables which have multiple decl nodes. These
should be merged just like normal globals. This fixes this testcase
that Anders provided:
static struct s a;
static struct s *ap1 = &a;
static struct s a = { 10 };
llvm-svn: 46661
Diffstat (limited to 'clang/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/CodeGen/CodeGenModule.cpp b/clang/CodeGen/CodeGenModule.cpp index ee84f954c56..edf3dc42831 100644 --- a/clang/CodeGen/CodeGenModule.cpp +++ b/clang/CodeGen/CodeGenModule.cpp @@ -134,7 +134,7 @@ llvm::Constant *CodeGenModule::GetAddrOfGlobalVar(const VarDecl *D, const llvm::Type *Ty = getTypes().ConvertTypeForMem(D->getType()); // Check to see if the global already exists. - llvm::GlobalVariable *GV = getModule().getGlobalVariable(D->getName()); + llvm::GlobalVariable *GV = getModule().getGlobalVariable(D->getName(), true); // If it doesn't already exist, just create and return an entry. if (GV == 0) { |

