aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-08 19:05:04 +0000
committerOwen Anderson <resistor@mac.com>2009-07-08 19:05:04 +0000
commit1c431b323d776362490bbf7cc796b74fedaf19f2 (patch)
tree9d3e0b286d5fa68a43e5b55ad768c72141f50e14 /lib/CodeGen/CGBlocks.cpp
parenta294ca8c64fbb345f32e4af9d8fabdf2f64e4883 (diff)
Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r--lib/CodeGen/CGBlocks.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index 8de3518406..42b55f79bf 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -50,9 +50,9 @@ BuildDescriptorBlockDecl(bool BlockHasCopyDispose, uint64_t Size,
C = llvm::ConstantStruct::get(Elts);
- C = new llvm::GlobalVariable(CGM.getModule().getContext(), C->getType(), true,
+ C = new llvm::GlobalVariable(CGM.getModule(), C->getType(), true,
llvm::GlobalValue::InternalLinkage,
- C, "__block_descriptor_tmp", &CGM.getModule());
+ C, "__block_descriptor_tmp");
return C;
}
@@ -165,10 +165,9 @@ llvm::Value *CodeGenFunction::BuildBlockLiteralTmp(const BlockExpr *BE) {
char Name[32];
sprintf(Name, "__block_holder_tmp_%d", CGM.getGlobalUniqueCount());
- C = new llvm::GlobalVariable(CGM.getModule().getContext(),
- C->getType(), true,
+ C = new llvm::GlobalVariable(CGM.getModule(), C->getType(), true,
llvm::GlobalValue::InternalLinkage,
- C, Name, &CGM.getModule());
+ C, Name);
QualType BPT = BE->getType();
C = llvm::ConstantExpr::getBitCast(C, ConvertType(BPT));
return C;
@@ -514,11 +513,9 @@ BlockModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) {
llvm::ConstantStruct::get(&DescriptorFields[0], 2);
llvm::GlobalVariable *Descriptor =
- new llvm::GlobalVariable(getModule().getContext(),
- DescriptorStruct->getType(), true,
+ new llvm::GlobalVariable(getModule(), DescriptorStruct->getType(), true,
llvm::GlobalVariable::InternalLinkage,
- DescriptorStruct, "__block_descriptor_global",
- &getModule());
+ DescriptorStruct, "__block_descriptor_global");
// Generate the constants for the block literal.
llvm::Constant *LiteralFields[5];
@@ -557,11 +554,9 @@ BlockModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) {
llvm::ConstantStruct::get(&LiteralFields[0], 5);
llvm::GlobalVariable *BlockLiteral =
- new llvm::GlobalVariable(getModule().getContext(),
- BlockLiteralStruct->getType(), true,
+ new llvm::GlobalVariable(getModule(), BlockLiteralStruct->getType(), true,
llvm::GlobalVariable::InternalLinkage,
- BlockLiteralStruct, "__block_literal_global",
- &getModule());
+ BlockLiteralStruct, "__block_literal_global");
return BlockLiteral;
}