diff options
author | Duncan Sands <baldrick@free.fr> | 2008-08-12 09:43:15 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-08-12 09:43:15 +0000 |
commit | 20df07ba22c0b7e907c1a7912b5d3d1d2fb948db (patch) | |
tree | bf770f2545e66cbe30e8d90b9e4716b85d39fc00 /include/llvm/Support/TargetFolder.h | |
parent | 721e59cfb29024ffad7204f05ad75b678ae7df63 (diff) |
Point people to ConstantExpr and ConstantFolding,
in case they get the wrong idea. Fit in 80 columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54676 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, 10 insertions, 6 deletions
diff --git a/include/llvm/Support/TargetFolder.h b/include/llvm/Support/TargetFolder.h index a80fb6f71b..fc0e9c4ffa 100644 --- a/include/llvm/Support/TargetFolder.h +++ b/include/llvm/Support/TargetFolder.h @@ -7,9 +7,10 @@ // //===----------------------------------------------------------------------===// // -// This file defines the TargetFolder class, which provides a set of methods -// for creating constants, with target dependent folding. -// +// This file defines the TargetFolder class, a helper for IRBuilder. +// It provides IRBuilder with a set of methods for creating constants with +// target dependent folding. For general constant creation and folding, +// use ConstantExpr and the routines in llvm/Analysis/ConstantFolding.h. // //===----------------------------------------------------------------------===// @@ -153,7 +154,8 @@ public: // Compare Instructions //===--------------------------------------------------------------------===// - Constant *CreateCompare(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const { + Constant *CreateCompare(CmpInst::Predicate P, Constant *LHS, + Constant *RHS) const { return Fold(ConstantExpr::getCompare(P, LHS, RHS)); } @@ -169,11 +171,13 @@ public: return Fold(ConstantExpr::getExtractElement(Vec, Idx)); } - Constant *CreateInsertElement(Constant *Vec, Constant *NewElt, Constant *Idx)const { + Constant *CreateInsertElement(Constant *Vec, Constant *NewElt, + Constant *Idx) const { return Fold(ConstantExpr::getInsertElement(Vec, NewElt, Idx)); } - Constant *CreateShuffleVector(Constant *V1, Constant *V2, Constant *Mask) const { + Constant *CreateShuffleVector(Constant *V1, Constant *V2, + Constant *Mask) const { return Fold(ConstantExpr::getShuffleVector(V1, V2, Mask)); } |