summaryrefslogtreecommitdiffstats
path: root/include/llvm/Support
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-06-03 13:28:00 +0000
committered <ed@FreeBSD.org>2009-06-03 13:28:00 +0000
commit036fdcfb2d357cecb320b5a6fd05f4859a63aeba (patch)
tree90502b3518861e1704738c228456f7079013368b /include/llvm/Support
parent3277b69d734b9c90b44ebde4ede005717e2c3b2e (diff)
downloadFreeBSD-src-036fdcfb2d357cecb320b5a6fd05f4859a63aeba.zip
FreeBSD-src-036fdcfb2d357cecb320b5a6fd05f4859a63aeba.tar.gz
Import LLVM, at r72770.
This should fix LLVM PR4225.
Diffstat (limited to 'include/llvm/Support')
-rw-r--r--include/llvm/Support/TargetFolder.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/llvm/Support/TargetFolder.h b/include/llvm/Support/TargetFolder.h
index 14f2c9b..172e4fe 100644
--- a/include/llvm/Support/TargetFolder.h
+++ b/include/llvm/Support/TargetFolder.h
@@ -9,8 +9,10 @@
//
// 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.
+// target dependent folding, in addition to the same target-independent
+// folding that the ConstantFolder class provides. For general constant
+// creation and folding, use ConstantExpr and the routines in
+// llvm/Analysis/ConstantFolding.h.
//
//===----------------------------------------------------------------------===//
@@ -26,18 +28,18 @@ class TargetData;
/// TargetFolder - Create constants with target dependent folding.
class TargetFolder {
- const TargetData &TD;
+ const TargetData *TD;
/// Fold - Fold the constant using target specific information.
Constant *Fold(Constant *C) const {
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C))
- if (Constant *CF = ConstantFoldConstantExpression(CE, &TD))
+ if (Constant *CF = ConstantFoldConstantExpression(CE, TD))
return CF;
return C;
}
public:
- TargetFolder(const TargetData &TheTD) : TD(TheTD) {}
+ explicit TargetFolder(const TargetData *TheTD) : TD(TheTD) {}
//===--------------------------------------------------------------------===//
// Binary Operators
OpenPOWER on IntegriCloud