diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-08 19:03:57 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-08 19:03:57 +0000 |
commit | e9b11b431308f4766b73cda93e38ec930c912122 (patch) | |
tree | d72fc321dc0c445f8880443050c0a03c2ccdf7d2 /lib/AsmParser/LLParser.cpp | |
parent | 515cdbe49d9bb5cd05be2713faaa7e2a66ddc3bc (diff) |
Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75025 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 8c30ab5a70..3927cf1e9e 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -516,9 +516,8 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc, } if (GV == 0) { - GV = new GlobalVariable(Context, Ty, false, - GlobalValue::ExternalLinkage, 0, Name, - M, false, AddrSpace); + GV = new GlobalVariable(*M, Ty, false, GlobalValue::ExternalLinkage, 0, + Name, 0, false, AddrSpace); } else { if (GV->getType()->getElementType() != Ty) return Error(TyLoc, @@ -608,8 +607,8 @@ GlobalValue *LLParser::GetGlobalVal(const std::string &Name, const Type *Ty, FwdVal = Function::Create(FT, GlobalValue::ExternalWeakLinkage, Name, M); } else { - FwdVal = new GlobalVariable(Context, PTy->getElementType(), false, - GlobalValue::ExternalWeakLinkage, 0, Name, M); + FwdVal = new GlobalVariable(*M, PTy->getElementType(), false, + GlobalValue::ExternalWeakLinkage, 0, Name); } ForwardRefVals[Name] = std::make_pair(FwdVal, Loc); @@ -652,8 +651,8 @@ GlobalValue *LLParser::GetGlobalVal(unsigned ID, const Type *Ty, LocTy Loc) { } FwdVal = Function::Create(FT, GlobalValue::ExternalWeakLinkage, "", M); } else { - FwdVal = new GlobalVariable(Context, PTy->getElementType(), false, - GlobalValue::ExternalWeakLinkage, 0, "", M); + FwdVal = new GlobalVariable(*M, PTy->getElementType(), false, + GlobalValue::ExternalWeakLinkage, 0, ""); } ForwardRefValIDs[ID] = std::make_pair(FwdVal, Loc); |