aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Constants.h
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-03-06 03:36:19 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-03-06 03:36:19 +0000
commitd01f50f42ce60207ed6d27fb1778e456d83be06c (patch)
tree6d7798f9ac99c0ec1b33f056715d3980fc92355f /include/llvm/Constants.h
parent511cab20cb6ef0575c961cbbcb86bb539b538a1c (diff)
downloadexternal_llvm-d01f50f42ce60207ed6d27fb1778e456d83be06c.zip
external_llvm-d01f50f42ce60207ed6d27fb1778e456d83be06c.tar.gz
external_llvm-d01f50f42ce60207ed6d27fb1778e456d83be06c.tar.bz2
ConstantInt has some getters which return ConstantInt's or ConstantVector's of
the value splatted into every element. Extend this to getTrue and getFalse which by providing new overloads that take Types that are either i1 or <N x i1>. Use it in InstCombine to add vector support to some code, fixing PR8469! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Constants.h')
-rw-r--r--include/llvm/Constants.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index 7da8e23..c12b33f 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -57,6 +57,8 @@ protected:
public:
static ConstantInt *getTrue(LLVMContext &Context);
static ConstantInt *getFalse(LLVMContext &Context);
+ static Constant *getTrue(const Type *Ty);
+ static Constant *getFalse(const Type *Ty);
/// If Ty is a vector type, return a Constant with a splat of the given
/// value. Otherwise return a ConstantInt for the given value.