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/TargetFolder.h | |
parent | 3837218ea0ed343da0f4d9c0fa0b290e00c52619 (diff) |
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/TargetFolder.h')
-rw-r--r-- | include/llvm/Support/TargetFolder.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/llvm/Support/TargetFolder.h b/include/llvm/Support/TargetFolder.h index fc0e9c4ffa..14f2c9b244 100644 --- a/include/llvm/Support/TargetFolder.h +++ b/include/llvm/Support/TargetFolder.h @@ -154,8 +154,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 Fold(ConstantExpr::getCompare(P, LHS, RHS)); + } + Constant *CreateFCmp(CmpInst::Predicate P, Constant *LHS, + Constant *RHS) const { + return Fold(ConstantExpr::getCompare(P, LHS, RHS)); + } + Constant *CreateVICmp(CmpInst::Predicate P, Constant *LHS, + Constant *RHS) const { + return Fold(ConstantExpr::getCompare(P, LHS, RHS)); + } + Constant *CreateVFCmp(CmpInst::Predicate P, Constant *LHS, + Constant *RHS) const { return Fold(ConstantExpr::getCompare(P, LHS, RHS)); } |