diff options
author | Duncan Sands <baldrick@free.fr> | 2008-08-12 20:39:27 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-08-12 20:39:27 +0000 |
commit | fe24bd3a89c44f9a16e3cbcf60c119dac88fad40 (patch) | |
tree | 1a633cb34b07465741e3ede9f5dfb8fd74efc249 /include/llvm/Support/ConstantFolder.h | |
parent | 3837218ea0ed343da0f4d9c0fa0b290e00c52619 (diff) | |
download | llvm-fe24bd3a89c44f9a16e3cbcf60c119dac88fad40.tar.gz llvm-fe24bd3a89c44f9a16e3cbcf60c119dac88fad40.tar.bz2 llvm-fe24bd3a89c44f9a16e3cbcf60c119dac88fad40.tar.xz |
Add a NullFolder class that doesn't fold constants.
This may be used as the second IRBuilder template
parameter, the idea being that people learning LLVM
may find it helpful (several people asked on IRC
if it was possible to turn off constant folding
because it made it hard for them to see what was
going on). Compiles, but otherwise completely
untested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54698 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/ConstantFolder.h')
-rw-r--r-- | include/llvm/Support/ConstantFolder.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/llvm/Support/ConstantFolder.h b/include/llvm/Support/ConstantFolder.h index 1d693eee1b..ca8bcae859 100644 --- a/include/llvm/Support/ConstantFolder.h +++ b/include/llvm/Support/ConstantFolder.h @@ -134,8 +134,20 @@ public: // Compare Instructions //===--------------------------------------------------------------------===// - Constant *CreateCompare(CmpInst::Predicate P, Constant *LHS, - Constant *RHS) const { + Constant *CreateICmp(CmpInst::Predicate P, Constant *LHS, + Constant *RHS) const { + return ConstantExpr::getCompare(P, LHS, RHS); + } + Constant *CreateFCmp(CmpInst::Predicate P, Constant *LHS, + Constant *RHS) const { + return ConstantExpr::getCompare(P, LHS, RHS); + } + Constant *CreateVICmp(CmpInst::Predicate P, Constant *LHS, + Constant *RHS) const { + return ConstantExpr::getCompare(P, LHS, RHS); + } + Constant *CreateVFCmp(CmpInst::Predicate P, Constant *LHS, + Constant *RHS) const { return ConstantExpr::getCompare(P, LHS, RHS); } |