summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/Support/ConstantFolder.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-08-12 20:39:27 +0000
committerDuncan Sands <baldrick@free.fr>2008-08-12 20:39:27 +0000
commit1c5f7fe3896cf33eb9da96f2d7bf92795a1f4d98 (patch)
treef3132484db6d89831a010e514d48f426f67c5e3d /llvm/include/llvm/Support/ConstantFolder.h
parent2a62fd96a6306721c66e8bcfb507d9e2c102b9ee (diff)
downloadbcm5719-llvm-1c5f7fe3896cf33eb9da96f2d7bf92795a1f4d98.tar.gz
bcm5719-llvm-1c5f7fe3896cf33eb9da96f2d7bf92795a1f4d98.zip
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. llvm-svn: 54698
Diffstat (limited to 'llvm/include/llvm/Support/ConstantFolder.h')
-rw-r--r--llvm/include/llvm/Support/ConstantFolder.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/ConstantFolder.h b/llvm/include/llvm/Support/ConstantFolder.h
index 1d693eee1be..ca8bcae8598 100644
--- a/llvm/include/llvm/Support/ConstantFolder.h
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud