summaryrefslogtreecommitdiff
path: root/include/llvm/IntrinsicInst.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-08 03:59:00 +0000
committerChris Lattner <sabre@nondot.org>2009-03-08 03:59:00 +0000
commitdfe964ce8c367248e587f2d9ecc7fac5ee2c6fdc (patch)
tree928afe076fa0f89952fb0cd28f8236ad21beb5be /include/llvm/IntrinsicInst.h
parent821b8560e735613dfcf7670866f9142e4845037e (diff)
downloadllvm-dfe964ce8c367248e587f2d9ecc7fac5ee2c6fdc.tar.gz
llvm-dfe964ce8c367248e587f2d9ecc7fac5ee2c6fdc.tar.bz2
llvm-dfe964ce8c367248e587f2d9ecc7fac5ee2c6fdc.tar.xz
change the MemIntrinsic get/setAlignment method to take an unsigned
instead of a Constant*, which is what the clients of it really want. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IntrinsicInst.h')
-rw-r--r--include/llvm/IntrinsicInst.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h
index 924fec26d2..8f5e05f70c 100644
--- a/include/llvm/IntrinsicInst.h
+++ b/include/llvm/IntrinsicInst.h
@@ -176,9 +176,13 @@ namespace llvm {
Value *getRawDest() const { return const_cast<Value*>(getOperand(1)); }
Value *getLength() const { return const_cast<Value*>(getOperand(3)); }
- ConstantInt *getAlignment() const {
+ ConstantInt *getAlignmentCst() const {
return cast<ConstantInt>(const_cast<Value*>(getOperand(4)));
}
+
+ unsigned getAlignment() const {
+ return getAlignmentCst()->getZExtValue();
+ }
/// getDest - This is just like getRawDest, but it strips off any cast
/// instructions that feed it, giving the original input. The returned
@@ -198,12 +202,11 @@ namespace llvm {
"setLength called with value of wrong type!");
setOperand(3, L);
}
- void setAlignment(ConstantInt *A) {
- assert(getAlignment()->getType() == A->getType() &&
- "setAlignment called with value of wrong type!");
- setOperand(4, A);
+ void setAlignment(unsigned A) {
+ const Type *Int32Ty = getOperand(4)->getType();
+ setOperand(4, ConstantInt::get(Int32Ty, A));
}
-
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const MemIntrinsic *) { return true; }
static inline bool classof(const IntrinsicInst *I) {