aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-24 23:12:58 +0000
committerOwen Anderson <resistor@mac.com>2009-07-24 23:12:58 +0000
commit4a28d5deeba33722aa009eab488591fb9055cc7e (patch)
tree2036bd7275eb1a0b5139d8a9578d5f4abfec0668 /lib/CodeGen/CGBlocks.cpp
parent7caa6825f42a0f7e97d6fc06233133c42b218e46 (diff)
Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77012 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r--lib/CodeGen/CGBlocks.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index 73200fe2ca..0bcacd1e48 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -32,14 +32,14 @@ BuildDescriptorBlockDecl(bool BlockHasCopyDispose, uint64_t Size,
llvm::LLVMContext &VMContext = CGM.getLLVMContext();
// reserved
- C = VMContext.getConstantInt(UnsignedLongTy, 0);
+ C = llvm::ConstantInt::get(UnsignedLongTy, 0);
Elts.push_back(C);
// Size
// FIXME: What is the right way to say this doesn't fit? We should give
// a user diagnostic in that case. Better fix would be to change the
// API to size_t.
- C = VMContext.getConstantInt(UnsignedLongTy, Size);
+ C = llvm::ConstantInt::get(UnsignedLongTy, Size);
Elts.push_back(C);
if (BlockHasCopyDispose) {
@@ -148,11 +148,11 @@ llvm::Value *CodeGenFunction::BuildBlockLiteralTmp(const BlockExpr *BE) {
// __flags
const llvm::IntegerType *IntTy = cast<llvm::IntegerType>(
CGM.getTypes().ConvertType(CGM.getContext().IntTy));
- C = VMContext.getConstantInt(IntTy, flags);
+ C = llvm::ConstantInt::get(IntTy, flags);
Elts[1] = C;
// __reserved
- C = VMContext.getConstantInt(IntTy, 0);
+ C = llvm::ConstantInt::get(IntTy, 0);
Elts[2] = C;
if (subBlockDeclRefDecls.size() == 0) {
@@ -161,7 +161,7 @@ llvm::Value *CodeGenFunction::BuildBlockLiteralTmp(const BlockExpr *BE) {
// Optimize to being a global block.
Elts[0] = CGM.getNSConcreteGlobalBlock();
- Elts[1] = VMContext.getConstantInt(IntTy, flags|BLOCK_IS_GLOBAL);
+ Elts[1] = llvm::ConstantInt::get(IntTy, flags|BLOCK_IS_GLOBAL);
C = VMContext.getConstantStruct(Elts);
@@ -267,7 +267,7 @@ llvm::Value *CodeGenFunction::BuildBlockLiteralTmp(const BlockExpr *BE) {
llvm::Value *BlockLiteral = LoadBlockStruct();
Loc = Builder.CreateGEP(BlockLiteral,
- VMContext.getConstantInt(llvm::Type::Int64Ty,
+ llvm::ConstantInt::get(llvm::Type::Int64Ty,
offset),
"block.literal");
Ty = VMContext.getPointerType(Ty, 0);
@@ -455,7 +455,7 @@ llvm::Value *CodeGenFunction::GetAddrOfBlockDecl(const BlockDeclRefExpr *E) {
llvm::Value *BlockLiteral = LoadBlockStruct();
llvm::Value *V = Builder.CreateGEP(BlockLiteral,
- VMContext.getConstantInt(llvm::Type::Int64Ty,
+ llvm::ConstantInt::get(llvm::Type::Int64Ty,
offset),
"block.literal");
if (E->isByRef()) {
@@ -510,7 +510,7 @@ BlockModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) {
uint64_t BlockLiteralSize =
TheTargetData.getTypeStoreSizeInBits(getGenericBlockLiteralType()) / 8;
DescriptorFields[1] =
- VMContext.getConstantInt(UnsignedLongTy,BlockLiteralSize);
+ llvm::ConstantInt::get(UnsignedLongTy,BlockLiteralSize);
llvm::Constant *DescriptorStruct =
VMContext.getConstantStruct(&DescriptorFields[0], 2);
@@ -542,7 +542,7 @@ BlockModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) {
// Flags
LiteralFields[1] =
- VMContext.getConstantInt(IntTy, BLOCK_IS_GLOBAL | BLOCK_HAS_DESCRIPTOR);
+ llvm::ConstantInt::get(IntTy, BLOCK_IS_GLOBAL | BLOCK_HAS_DESCRIPTOR);
// Reserved
LiteralFields[2] = getModule().getContext().getNullValue(IntTy);
@@ -777,7 +777,7 @@ GenerateCopyHelperFunction(bool BlockHasCopyDispose, const llvm::StructType *T,
llvm::Value *Dstv = Builder.CreateStructGEP(DstObj, index);
Dstv = Builder.CreateBitCast(Dstv, PtrToInt8Ty);
- llvm::Value *N = VMContext.getConstantInt(llvm::Type::Int32Ty, flag);
+ llvm::Value *N = llvm::ConstantInt::get(llvm::Type::Int32Ty, flag);
llvm::Value *F = getBlockObjectAssign();
Builder.CreateCall3(F, Dstv, Srcv, N);
}
@@ -928,7 +928,7 @@ GeneratebyrefCopyHelperFunction(const llvm::Type *T, int flag) {
flag |= BLOCK_BYREF_CALLER;
- llvm::Value *N = VMContext.getConstantInt(llvm::Type::Int32Ty, flag);
+ llvm::Value *N = llvm::ConstantInt::get(llvm::Type::Int32Ty, flag);
llvm::Value *F = getBlockObjectAssign();
Builder.CreateCall3(F, DstObj, SrcObj, N);
@@ -1054,7 +1054,7 @@ void BlockFunction::BuildBlockRelease(llvm::Value *V, int flag) {
llvm::Value *F = getBlockObjectDispose();
llvm::Value *N;
V = Builder.CreateBitCast(V, PtrToInt8Ty);
- N = VMContext.getConstantInt(llvm::Type::Int32Ty, flag);
+ N = llvm::ConstantInt::get(llvm::Type::Int32Ty, flag);
Builder.CreateCall2(F, V, N);
}