aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AsmParser
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-16 01:18:09 +0000
committerChris Lattner <sabre@nondot.org>2004-07-16 01:18:09 +0000
commita2d4b3cfebb3fdfa0a792371cf882a65571e0a4a (patch)
tree2ddc1db570457029b20dd22b4073f331838eccd2 /lib/AsmParser
parentb406eadfe3ef0e70ec7f68cca3d45628bf1c19f8 (diff)
downloadexternal_llvm-a2d4b3cfebb3fdfa0a792371cf882a65571e0a4a.zip
external_llvm-a2d4b3cfebb3fdfa0a792371cf882a65571e0a4a.tar.gz
external_llvm-a2d4b3cfebb3fdfa0a792371cf882a65571e0a4a.tar.bz2
Fix the regressions handling unnamed global variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r--lib/AsmParser/llvmAsmParser.y7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 5029ef8..699ef8f 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -561,6 +561,7 @@ static void ParseGlobalVariable(char *NameStr,GlobalValue::LinkageTypes Linkage,
GV->setInitializer(Initializer);
GV->setLinkage(Linkage);
GV->setConstant(isConstantGlobal);
+ InsertValue(GV, CurModule.Values);
return;
}
@@ -595,8 +596,10 @@ static void ParseGlobalVariable(char *NameStr,GlobalValue::LinkageTypes Linkage,
}
// Otherwise there is no existing GV to use, create one now.
- new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
- CurModule.CurrentModule);
+ GlobalVariable *GV =
+ new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
+ CurModule.CurrentModule);
+ InsertValue(GV, CurModule.Values);
}
// setTypeName - Set the specified type to the name given. The name may be