Push LLVMContext through GlobalVariables and IRBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2009-07-08 01:26:06 +00:00
parent 8b8d31e3ec
commit 3d29df3e8a
21 changed files with 114 additions and 75 deletions

View File

@@ -516,7 +516,8 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc,
}
if (GV == 0) {
GV = new GlobalVariable(Ty, false, GlobalValue::ExternalLinkage, 0, Name,
GV = new GlobalVariable(Context, Ty, false,
GlobalValue::ExternalLinkage, 0, Name,
M, false, AddrSpace);
} else {
if (GV->getType()->getElementType() != Ty)
@@ -607,7 +608,7 @@ GlobalValue *LLParser::GetGlobalVal(const std::string &Name, const Type *Ty,
FwdVal = Function::Create(FT, GlobalValue::ExternalWeakLinkage, Name, M);
} else {
FwdVal = new GlobalVariable(PTy->getElementType(), false,
FwdVal = new GlobalVariable(Context, PTy->getElementType(), false,
GlobalValue::ExternalWeakLinkage, 0, Name, M);
}
@@ -651,7 +652,7 @@ GlobalValue *LLParser::GetGlobalVal(unsigned ID, const Type *Ty, LocTy Loc) {
}
FwdVal = Function::Create(FT, GlobalValue::ExternalWeakLinkage, "", M);
} else {
FwdVal = new GlobalVariable(PTy->getElementType(), false,
FwdVal = new GlobalVariable(Context, PTy->getElementType(), false,
GlobalValue::ExternalWeakLinkage, 0, "", M);
}