summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-25 02:50:45 +0000
committerChris Lattner <sabre@nondot.org>2003-04-25 02:50:45 +0000
commite483398516f8d0d4ac3bcc436178cb48405388d4 (patch)
tree55fa434311a830e040a146fb43c751860fbf7bcb /llvm/lib/Target
parent06aa504555745759fc66850b8720f0f63fc7d27e (diff)
downloadbcm5719-llvm-e483398516f8d0d4ac3bcc436178cb48405388d4.tar.gz
bcm5719-llvm-e483398516f8d0d4ac3bcc436178cb48405388d4.zip
Allow for easy detection of when a "default" TargetData is created by the
passmanager, which is never the right thing to do. llvm-svn: 5922
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/TargetData.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index 701b36640ec..a0a3b82d24f 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/lib/Target/TargetData.cpp
@@ -91,6 +91,13 @@ TargetData::TargetData(const std::string &TargetName,
: AID(AnnotationManager::getID("TargetData::" + TargetName)) {
AnnotationManager::registerAnnotationFactory(AID, TypeAnFactory, this);
+ // If this assert triggers, a pass "required" TargetData information, but the
+ // top level tool did not provide once for it. We do not want to default
+ // construct, or else we might end up using a bad endianness or pointer size!
+ //
+ assert(!TargetName.empty() &&
+ "ERROR: Tool did not specify a target data to use!");
+
LittleEndian = isLittleEndian;
SubWordDataSize = SubWordSize;
IntegerRegSize = IntRegSize;
OpenPOWER on IntegriCloud