Revert "Remove access to the DataLayout in the TargetMachine"
[oota-llvm.git] / include / llvm / Target / TargetMachine.h
index bc8537c0daa74acd48956045f7d33b40e26325e4..06a2b13836ed6548561733fab16b490dcb8cd33c 100644 (file)
@@ -76,12 +76,7 @@ protected: // Can only create subclasses.
   /// The Target that this machine was created for.
   const Target &TheTarget;
 
-  /// DataLayout for the target: keep ABI type size and alignment.
-  ///
-  /// The DataLayout is created based on the string representation provided
-  /// during construction. It is kept here only to avoid reparsing the string
-  /// but should not really be used during compilation, because it has an
-  /// internal cache that is context specific.
+  /// For ABI type size and alignment.
   const DataLayout DL;
 
   /// Triple string, CPU name, and target feature strings the TargetMachine
@@ -130,13 +125,9 @@ public:
     return *static_cast<const STC*>(getSubtargetImpl(F));
   }
 
-  /// Create a DataLayout.
-  const DataLayout createDataLayout() const { return DL; }
-
-  /// Get the pointer size for this target.
-  ///
-  /// This is the only time the DataLayout in the TargetMachine is used.
-  unsigned getPointerSize() const { return DL.getPointerSize(); }
+  /// This method returns a pointer to the DataLayout for the target. It should
+  /// be unchanging for every subtarget.
+  const DataLayout *getDataLayout() const { return &DL; }
 
   /// \brief Reset the target options based on the function's attributes.
   // FIXME: Remove TargetOptions that affect per-function code generation