[llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h
Chris Lattner
lattner at cs.uiuc.edu
Fri Jun 16 11:22:05 PDT 2006
Changes in directory llvm/include/llvm/Target:
TargetData.h updated: 1.39 -> 1.40
---
Log message:
Simplify the targetdata ctor by not passing in a "targetname" which is always
ignored.
---
Diffs of the changes: (+14 -8)
TargetData.h | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
Index: llvm/include/llvm/Target/TargetData.h
diff -u llvm/include/llvm/Target/TargetData.h:1.39 llvm/include/llvm/Target/TargetData.h:1.40
--- llvm/include/llvm/Target/TargetData.h:1.39 Fri Jun 16 13:11:07 2006
+++ llvm/include/llvm/Target/TargetData.h Fri Jun 16 13:21:53 2006
@@ -45,19 +45,26 @@
unsigned char PointerAlignment; // Defaults to 8 bytes
public:
+ /// Default ctor - This has to exist, because this is a pass, but it should
+ /// never be used.
+ TargetData() {
+ assert(0 && "ERROR: Bad TargetData ctor used. "
+ "Tool did not specify a TargetData to use?");
+ abort();
+ }
+
/// Constructs a TargetData from a string of the following format:
/// "E-p:64:64-d:64-f:32-l:64-i:32-s:16-b:8-B:8"
/// The above string is considered the default, and any values not specified
/// in the string will be assumed to be as above.
- TargetData(const std::string &TargetName = "",
- const std::string &TargetDescription = "") {
- assert(!TargetName.empty() &&
- "ERROR: Tool did not specify a target data to use!");
+ TargetData(const std::string &TargetDescription) {
init(TargetDescription);
}
-
- // Copy constructor
- TargetData (const TargetData &TD) :
+
+ /// Initialize target data from properties stored in the module.
+ TargetData(const Module *M);
+
+ TargetData(const TargetData &TD) :
ImmutablePass(),
LittleEndian(TD.isLittleEndian()),
BoolAlignment(TD.getBoolAlignment()),
@@ -71,7 +78,6 @@
PointerAlignment(TD.getPointerAlignment()) {
}
- TargetData(const std::string &ToolName, const Module *M);
~TargetData(); // Not virtual, do not subclass this class
/// init - Specify configuration if not available at ctor time.
More information about the llvm-commits
mailing list