aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/IRBuilder.h
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-05-21 23:14:36 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-05-21 23:14:36 +0000
commit0cf51561eddd659a7b427f40144e22363fd95a57 (patch)
treea66609b096578e6bd62f2c9cc5e6e292bcdcb8bc /include/llvm/Support/IRBuilder.h
parentd22920aae81ec318404f7c5235c634954d966cf6 (diff)
downloadexternal_llvm-0cf51561eddd659a7b427f40144e22363fd95a57.zip
external_llvm-0cf51561eddd659a7b427f40144e22363fd95a57.tar.gz
external_llvm-0cf51561eddd659a7b427f40144e22363fd95a57.tar.bz2
Add CreateLifetimeStart and CreateLifetimeEnd to the IRBuilder, with plans to
use these soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/IRBuilder.h')
-rw-r--r--include/llvm/Support/IRBuilder.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h
index ea3e6b4..6a7c277 100644
--- a/include/llvm/Support/IRBuilder.h
+++ b/include/llvm/Support/IRBuilder.h
@@ -107,6 +107,10 @@ public:
I->setDebugLoc(CurDbgLocation);
}
+ /// getCurrentFunctionReturnType - Get the return type of the current function
+ /// that we're emitting into.
+ const Type *getCurrentFunctionReturnType() const;
+
/// InsertPoint - A saved insertion point.
class InsertPoint {
BasicBlock *Block;
@@ -195,6 +199,7 @@ public:
return ConstantInt::get(getInt64Ty(), C);
}
+ /// getInt - Get a constant integer value.
ConstantInt *getInt(const APInt &AI) {
return ConstantInt::get(Context, AI);
}
@@ -247,10 +252,10 @@ public:
return Type::getInt8PtrTy(Context, AddrSpace);
}
- /// getCurrentFunctionReturnType - Get the return type of the current function
- /// that we're emitting into.
- const Type *getCurrentFunctionReturnType() const;
-
+ //===--------------------------------------------------------------------===//
+ // Intrinsic creation methods
+ //===--------------------------------------------------------------------===//
+
/// CreateMemSet - Create and insert a memset to the specified pointer and the
/// specified value. If the pointer isn't an i8*, it will be converted. If a
/// TBAA tag is specified, it will be added to the instruction.
@@ -283,6 +288,15 @@ public:
CallInst *CreateMemMove(Value *Dst, Value *Src, Value *Size, unsigned Align,
bool isVolatile = false, MDNode *TBAATag = 0);
+
+ /// CreateLifetimeStart - Create a lifetime.start intrinsic. If the pointer
+ /// isn't i8* it will be converted.
+ CallInst *CreateLifetimeStart(Value *Ptr, ConstantInt *Size = 0);
+
+ /// CreateLifetimeEnd - Create a lifetime.end intrinsic. If the pointer isn't
+ /// i8* it will be converted.
+ CallInst *CreateLifetimeEnd(Value *Ptr, ConstantInt *Size = 0);
+
private:
Value *getCastedInt8PtrValue(Value *Ptr);
};