Add a TargetMachine hook that verifies DataLayout compatibility
[oota-llvm.git] / include / llvm / Target / TargetMachine.h
index bc8537c0daa74acd48956045f7d33b40e26325e4..d707e7c029303166369a48dc84b7a8db16ddedba 100644 (file)
@@ -133,6 +133,15 @@ public:
   /// Create a DataLayout.
   const DataLayout createDataLayout() const { return DL; }
 
+  /// Test if a DataLayout if compatible with the CodeGen for this target.
+  ///
+  /// The LLVM Module owns a DataLayout that is used for the target independent
+  /// optimizations and code generation. This hook provides a target specific
+  /// check on the validity of this DataLayout.
+  bool isCompatibleDataLayout(const DataLayout &Candidate) const {
+    return DL == Candidate;
+  }
+
   /// Get the pointer size for this target.
   ///
   /// This is the only time the DataLayout in the TargetMachine is used.