[llvm-commits] CVS: llvm/lib/Target/TargetData.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Apr 24 21:51:11 PDT 2003


Changes in directory llvm/lib/Target:

TargetData.cpp updated: 1.28 -> 1.29

---
Log message:

Allow for easy detection of when a "default" TargetData is created by the
passmanager, which is never the right thing to do.


---
Diffs of the changes:

Index: llvm/lib/Target/TargetData.cpp
diff -u llvm/lib/Target/TargetData.cpp:1.28 llvm/lib/Target/TargetData.cpp:1.29
--- llvm/lib/Target/TargetData.cpp:1.28	Thu Apr 24 14:09:05 2003
+++ llvm/lib/Target/TargetData.cpp	Thu Apr 24 21:50:45 2003
@@ -91,6 +91,13 @@
   : 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;





More information about the llvm-commits mailing list