diff options
| author | Dan Gohman <gohman@apple.com> | 2009-06-03 00:13:48 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-06-03 00:13:48 +0000 |
| commit | b003dd907fb769ce9cbb6ff51efcd6107a9b1127 (patch) | |
| tree | c6aea665b50cce04ea10956ce91b0a7a4929b161 | |
| parent | f727bb18d95d86d02c94265969b628de7fab00d9 (diff) | |
| download | bcm5719-llvm-b003dd907fb769ce9cbb6ff51efcd6107a9b1127.tar.gz bcm5719-llvm-b003dd907fb769ce9cbb6ff51efcd6107a9b1127.zip | |
Change TargetFolder's TD member from a reference to a
pointer, now that ConstantFoldConstantExpression can
accept a null TargetData pointer.
llvm-svn: 72744
| -rw-r--r-- | llvm/include/llvm/Support/TargetFolder.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/include/llvm/Support/TargetFolder.h b/llvm/include/llvm/Support/TargetFolder.h index 14f2c9b244f..172e4fe123d 100644 --- a/llvm/include/llvm/Support/TargetFolder.h +++ b/llvm/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 |

