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 | f25952bf1145eccd87a6acb048271451dfe7abcc (patch) | |
tree | 1a633cb34b07465741e3ede9f5dfb8fd74efc249 /include/llvm/Support/IRBuilder.h | |
parent | ab678fb09a0499952b604a60c21f6d75b6f25f00 (diff) | |
download | external_llvm-f25952bf1145eccd87a6acb048271451dfe7abcc.zip external_llvm-f25952bf1145eccd87a6acb048271451dfe7abcc.tar.gz external_llvm-f25952bf1145eccd87a6acb048271451dfe7abcc.tar.bz2 |
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/IRBuilder.h')
-rw-r--r-- | include/llvm/Support/IRBuilder.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index cf5417e..0be481b 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -493,14 +493,14 @@ public: const char *Name = "") { if (Constant *LC = dyn_cast<Constant>(LHS)) if (Constant *RC = dyn_cast<Constant>(RHS)) - return Folder.CreateCompare(P, LC, RC); + return Folder.CreateICmp(P, LC, RC); return Insert(new ICmpInst(P, LHS, RHS), Name); } Value *CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS, const char *Name = "") { if (Constant *LC = dyn_cast<Constant>(LHS)) if (Constant *RC = dyn_cast<Constant>(RHS)) - return Folder.CreateCompare(P, LC, RC); + return Folder.CreateFCmp(P, LC, RC); return Insert(new FCmpInst(P, LHS, RHS), Name); } @@ -508,14 +508,14 @@ public: const char *Name = "") { if (Constant *LC = dyn_cast<Constant>(LHS)) if (Constant *RC = dyn_cast<Constant>(RHS)) - return Folder.CreateCompare(P, LC, RC); + return Folder.CreateVICmp(P, LC, RC); return Insert(new VICmpInst(P, LHS, RHS), Name); } Value *CreateVFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS, const char *Name = "") { if (Constant *LC = dyn_cast<Constant>(LHS)) if (Constant *RC = dyn_cast<Constant>(RHS)) - return Folder.CreateCompare(P, LC, RC); + return Folder.CreateVFCmp(P, LC, RC); return Insert(new VFCmpInst(P, LHS, RHS), Name); } |