diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-08 19:05:04 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-08 19:05:04 +0000 |
commit | c10c8d3e2ba225e14891b5c93bd79760a575da88 (patch) | |
tree | f1d918d117e789ba331f222cc2928490bfd52f26 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | fa04002254ffd2b1ff480461fc9e06593d7d5a35 (diff) | |
download | bcm5719-llvm-c10c8d3e2ba225e14891b5c93bd79760a575da88.tar.gz bcm5719-llvm-c10c8d3e2ba225e14891b5c93bd79760a575da88.zip |
Update for LLVM API change.
llvm-svn: 75028
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 8540028d4f2..041480f76ce 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -216,11 +216,10 @@ void CodeGenModule::EmitCtorList(const CtorList &Fns, const char *GlobalName) { if (!Ctors.empty()) { llvm::ArrayType *AT = llvm::ArrayType::get(CtorStructTy, Ctors.size()); - new llvm::GlobalVariable(TheModule.getContext(), AT, false, + new llvm::GlobalVariable(TheModule, AT, false, llvm::GlobalValue::AppendingLinkage, llvm::ConstantArray::get(AT, Ctors), - GlobalName, - &TheModule); + GlobalName); } } @@ -234,9 +233,9 @@ void CodeGenModule::EmitAnnotations() { Annotations.size()), Annotations); llvm::GlobalValue *gv = - new llvm::GlobalVariable(TheModule.getContext(), Array->getType(), false, + new llvm::GlobalVariable(TheModule, Array->getType(), false, llvm::GlobalValue::AppendingLinkage, Array, - "llvm.global.annotations", &TheModule); + "llvm.global.annotations"); gv->setSection("llvm.metadata"); } @@ -436,10 +435,10 @@ void CodeGenModule::EmitLLVMUsed() { llvm::ArrayType *ATy = llvm::ArrayType::get(i8PTy, UsedArray.size()); llvm::GlobalVariable *GV = - new llvm::GlobalVariable(getModule().getContext(), ATy, false, + new llvm::GlobalVariable(getModule(), ATy, false, llvm::GlobalValue::AppendingLinkage, llvm::ConstantArray::get(ATy, UsedArray), - "llvm.used", &getModule()); + "llvm.used"); GV->setSection("llvm.metadata"); } @@ -494,14 +493,14 @@ llvm::Constant *CodeGenModule::EmitAnnotateAttr(llvm::GlobalValue *GV, // created to hold the bytes of the strings. const char *StringPrefix = getContext().Target.getStringSymbolPrefix(true); llvm::GlobalValue *annoGV = - new llvm::GlobalVariable(M->getContext(), anno->getType(), false, + new llvm::GlobalVariable(*M, anno->getType(), false, llvm::GlobalValue::InternalLinkage, anno, - GV->getName() + StringPrefix, M); + GV->getName() + StringPrefix); // translation unit name string, emitted into the llvm.metadata section. llvm::GlobalValue *unitGV = - new llvm::GlobalVariable(M->getContext(), unit->getType(), false, + new llvm::GlobalVariable(*M, unit->getType(), false, llvm::GlobalValue::InternalLinkage, unit, - StringPrefix, M); + StringPrefix); // Create the ConstantStruct for the global annotation. llvm::Constant *Fields[4] = { @@ -719,10 +718,9 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMGlobal(const char *MangledName, } llvm::GlobalVariable *GV = - new llvm::GlobalVariable(getModule().getContext(), - Ty->getElementType(), false, + new llvm::GlobalVariable(getModule(), Ty->getElementType(), false, llvm::GlobalValue::ExternalLinkage, - 0, "", &getModule(), + 0, "", 0, false, Ty->getAddressSpace()); GV->setName(MangledName); @@ -1246,10 +1244,9 @@ GetAddrOfConstantCFString(const StringLiteral *Literal) { // likely see an opaque error message. This is a general issue with relying // on particular names. llvm::GlobalVariable *GV = - new llvm::GlobalVariable(getModule().getContext(), Ty, false, + new llvm::GlobalVariable(getModule(), Ty, false, llvm::GlobalVariable::ExternalLinkage, 0, - "__CFConstantStringClassReference", - &getModule()); + "__CFConstantStringClassReference"); // Decay array -> ptr CFConstantStringClassRef = @@ -1300,9 +1297,9 @@ GetAddrOfConstantCFString(const StringLiteral *Literal) { isConstant = true; } llvm::GlobalVariable *GV = - new llvm::GlobalVariable(getModule().getContext(), C->getType(), isConstant, + new llvm::GlobalVariable(getModule(), C->getType(), isConstant, llvm::GlobalValue::InternalLinkage, - C, Prefix, &getModule()); + C, Prefix); if (Sect) GV->setSection(Sect); if (isUTF16) { @@ -1322,10 +1319,9 @@ GetAddrOfConstantCFString(const StringLiteral *Literal) { // The struct. C = llvm::ConstantStruct::get(STy, Fields); - GV = new llvm::GlobalVariable(getModule().getContext(), C->getType(), true, + GV = new llvm::GlobalVariable(getModule(), C->getType(), true, llvm::GlobalVariable::InternalLinkage, C, - getContext().Target.getCFStringSymbolPrefix(), - &getModule()); + getContext().Target.getCFStringSymbolPrefix()); if (const char *Sect = getContext().Target.getCFStringSection()) GV->setSection(Sect); Entry.setValue(GV); @@ -1383,10 +1379,9 @@ static llvm::Constant *GenerateStringLiteral(const std::string &str, llvm::Constant *C = llvm::ConstantArray::get(str, false); // Create a global variable for this string - return new llvm::GlobalVariable(CGM.getModule().getContext(), - C->getType(), constant, + return new llvm::GlobalVariable(CGM.getModule(), C->getType(), constant, llvm::GlobalValue::InternalLinkage, - C, GlobalName, &CGM.getModule()); + C, GlobalName); } /// GetAddrOfConstantString - Returns a pointer to a character array |