[llvm-commits] [llvm] r165403 - in /llvm/trunk: bindings/ocaml/executionengine/ bindings/ocaml/llvm/ bindings/ocaml/target/ docs/ docs/tutorial/ test/Bindings/Ocaml/ test/Transforms/IndVarSimplify/ tools/bugpoint/ tools/llc/ tools/llvm-extract/ tools/lto/ tools/opt/ unittests/VMCore/ utils/TableGen/

Micah Villmow villmow at gmail.com
Mon Oct 8 09:39:34 PDT 2012


Author: mvillmow
Date: Mon Oct  8 11:39:34 2012
New Revision: 165403

URL: http://llvm.org/viewvc/llvm-project?rev=165403&view=rev
Log:
Move TargetData to DataLayout.

Modified:
    llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml
    llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli
    llvm/trunk/bindings/ocaml/llvm/llvm.mli
    llvm/trunk/bindings/ocaml/target/llvm_target.ml
    llvm/trunk/bindings/ocaml/target/llvm_target.mli
    llvm/trunk/bindings/ocaml/target/target_ocaml.c
    llvm/trunk/docs/CodeGenerator.rst
    llvm/trunk/docs/GarbageCollection.html
    llvm/trunk/docs/LangRef.html
    llvm/trunk/docs/WritingAnLLVMBackend.html
    llvm/trunk/docs/tutorial/LangImpl4.html
    llvm/trunk/docs/tutorial/LangImpl5.html
    llvm/trunk/docs/tutorial/LangImpl6.html
    llvm/trunk/docs/tutorial/LangImpl7.html
    llvm/trunk/docs/tutorial/OCamlLangImpl4.html
    llvm/trunk/docs/tutorial/OCamlLangImpl5.html
    llvm/trunk/docs/tutorial/OCamlLangImpl6.html
    llvm/trunk/docs/tutorial/OCamlLangImpl7.html
    llvm/trunk/test/Bindings/Ocaml/ipo_opts.ml
    llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml
    llvm/trunk/test/Bindings/Ocaml/target.ml
    llvm/trunk/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll
    llvm/trunk/tools/bugpoint/ExtractFunction.cpp
    llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
    llvm/trunk/tools/llc/llc.cpp
    llvm/trunk/tools/llvm-extract/llvm-extract.cpp
    llvm/trunk/tools/lto/LTOCodeGenerator.cpp
    llvm/trunk/tools/lto/LTOModule.cpp
    llvm/trunk/tools/opt/opt.cpp
    llvm/trunk/unittests/VMCore/InstructionsTest.cpp
    llvm/trunk/unittests/VMCore/PassManagerTest.cpp
    llvm/trunk/utils/TableGen/CallingConvEmitter.cpp

Modified: llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml (original)
+++ llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml Mon Oct  8 11:39:34 2012
@@ -83,8 +83,8 @@
   external free_machine_code: Llvm.llvalue -> t -> unit
     = "llvm_ee_free_machine_code"
 
-  external target_data: t -> Llvm_target.TargetData.t
-    = "LLVMGetExecutionEngineTargetData"
+  external target_data: t -> Llvm_target.DataLayout.t
+    = "LLVMGetExecutionEngineDataLayout"
   
   (* The following are not bound. Patches are welcome.
   

Modified: llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli (original)
+++ llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli Mon Oct  8 11:39:34 2012
@@ -155,7 +155,7 @@
 
   (** [target_data ee] is the target data owned by the execution engine
       [ee]. *)
-  val target_data : t -> Llvm_target.TargetData.t
+  val target_data : t -> Llvm_target.DataLayout.t
 
 end
 

Modified: llvm/trunk/bindings/ocaml/llvm/llvm.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.mli?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.mli (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.mli Mon Oct  8 11:39:34 2012
@@ -375,7 +375,7 @@
 val classify_type : lltype -> TypeKind.t
 
 (** [type_is_sized ty] returns whether the type has a size or not.
- * If it doesn't then it is not safe to call the [TargetData::] methods on it.
+ * If it doesn't then it is not safe to call the [DataLayout::] methods on it.
  * *)
 val type_is_sized : lltype -> bool
 

Modified: llvm/trunk/bindings/ocaml/target/llvm_target.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/target/llvm_target.ml?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/target/llvm_target.ml (original)
+++ llvm/trunk/bindings/ocaml/target/llvm_target.ml Mon Oct  8 11:39:34 2012
@@ -13,7 +13,7 @@
   | Little
 end
 
-module TargetData = struct
+module DataLayout = struct
   type t
 
   external create : string -> t = "llvm_targetdata_create"
@@ -23,20 +23,20 @@
   external dispose : t -> unit = "llvm_targetdata_dispose"
 end
 
-external byte_order : TargetData.t -> Endian.t = "llvm_byte_order"
-external pointer_size : TargetData.t -> int = "llvm_pointer_size"
-external intptr_type : TargetData.t -> Llvm.lltype = "LLVMIntPtrType"
-external size_in_bits : TargetData.t -> Llvm.lltype -> Int64.t
+external byte_order : DataLayout.t -> Endian.t = "llvm_byte_order"
+external pointer_size : DataLayout.t -> int = "llvm_pointer_size"
+external intptr_type : DataLayout.t -> Llvm.lltype = "LLVMIntPtrType"
+external size_in_bits : DataLayout.t -> Llvm.lltype -> Int64.t
                       = "llvm_size_in_bits"
-external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size"
-external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size"
-external abi_align : TargetData.t -> Llvm.lltype -> int = "llvm_abi_align"
-external stack_align : TargetData.t -> Llvm.lltype -> int = "llvm_stack_align"
-external preferred_align : TargetData.t -> Llvm.lltype -> int
+external store_size : DataLayout.t -> Llvm.lltype -> Int64.t = "llvm_store_size"
+external abi_size : DataLayout.t -> Llvm.lltype -> Int64.t = "llvm_abi_size"
+external abi_align : DataLayout.t -> Llvm.lltype -> int = "llvm_abi_align"
+external stack_align : DataLayout.t -> Llvm.lltype -> int = "llvm_stack_align"
+external preferred_align : DataLayout.t -> Llvm.lltype -> int
                          = "llvm_preferred_align"
-external preferred_align_of_global : TargetData.t -> Llvm.llvalue -> int
+external preferred_align_of_global : DataLayout.t -> Llvm.llvalue -> int
                                    = "llvm_preferred_align_of_global"
-external element_at_offset : TargetData.t -> Llvm.lltype -> Int64.t -> int
+external element_at_offset : DataLayout.t -> Llvm.lltype -> Int64.t -> int
                            = "llvm_element_at_offset"
-external offset_of_element : TargetData.t -> Llvm.lltype -> int -> Int64.t
+external offset_of_element : DataLayout.t -> Llvm.lltype -> int -> Int64.t
                            = "llvm_offset_of_element"

Modified: llvm/trunk/bindings/ocaml/target/llvm_target.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/target/llvm_target.mli?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/target/llvm_target.mli (original)
+++ llvm/trunk/bindings/ocaml/target/llvm_target.mli Mon Oct  8 11:39:34 2012
@@ -18,11 +18,11 @@
   | Little
 end
 
-module TargetData : sig
+module DataLayout : sig
   type t
 
-  (** [TargetData.create rep] parses the target data string representation [rep].
-      See the constructor llvm::TargetData::TargetData. *)
+  (** [DataLayout.create rep] parses the target data string representation [rep].
+      See the constructor llvm::DataLayout::DataLayout. *)
   external create : string -> t = "llvm_targetdata_create"
 
   (** [add_target_data td pm] adds the target data [td] to the pass manager [pm].
@@ -32,64 +32,64 @@
                = "llvm_targetdata_add"
 
   (** [as_string td] is the string representation of the target data [td].
-      See the constructor llvm::TargetData::TargetData. *)
+      See the constructor llvm::DataLayout::DataLayout. *)
   external as_string : t -> string = "llvm_targetdata_as_string"
 
-  (** Deallocates a TargetData.
-      See the destructor llvm::TargetData::~TargetData. *)
+  (** Deallocates a DataLayout.
+      See the destructor llvm::DataLayout::~DataLayout. *)
   external dispose : t -> unit = "llvm_targetdata_dispose"
 end
 
 (** Returns the byte order of a target, either LLVMBigEndian or
     LLVMLittleEndian.
-    See the method llvm::TargetData::isLittleEndian. *)
-external byte_order : TargetData.t -> Endian.t = "llvm_byte_order"
+    See the method llvm::DataLayout::isLittleEndian. *)
+external byte_order : DataLayout.t -> Endian.t = "llvm_byte_order"
 
 (** Returns the pointer size in bytes for a target.
-    See the method llvm::TargetData::getPointerSize. *)
-external pointer_size : TargetData.t -> int = "llvm_pointer_size"
+    See the method llvm::DataLayout::getPointerSize. *)
+external pointer_size : DataLayout.t -> int = "llvm_pointer_size"
 
 (** Returns the integer type that is the same size as a pointer on a target.
-    See the method llvm::TargetData::getIntPtrType. *)
-external intptr_type : TargetData.t -> Llvm.lltype = "LLVMIntPtrType"
+    See the method llvm::DataLayout::getIntPtrType. *)
+external intptr_type : DataLayout.t -> Llvm.lltype = "LLVMIntPtrType"
 
 (** Computes the size of a type in bytes for a target.
-    See the method llvm::TargetData::getTypeSizeInBits. *)
-external size_in_bits : TargetData.t -> Llvm.lltype -> Int64.t
+    See the method llvm::DataLayout::getTypeSizeInBits. *)
+external size_in_bits : DataLayout.t -> Llvm.lltype -> Int64.t
                       = "llvm_size_in_bits"
 
 (** Computes the storage size of a type in bytes for a target.
-    See the method llvm::TargetData::getTypeStoreSize. *)
-external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size"
+    See the method llvm::DataLayout::getTypeStoreSize. *)
+external store_size : DataLayout.t -> Llvm.lltype -> Int64.t = "llvm_store_size"
 
 (** Computes the ABI size of a type in bytes for a target.
-    See the method llvm::TargetData::getTypeAllocSize. *)
-external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size"
+    See the method llvm::DataLayout::getTypeAllocSize. *)
+external abi_size : DataLayout.t -> Llvm.lltype -> Int64.t = "llvm_abi_size"
 
 (** Computes the ABI alignment of a type in bytes for a target.
-    See the method llvm::TargetData::getTypeABISize. *)
-external abi_align : TargetData.t -> Llvm.lltype -> int = "llvm_abi_align"
+    See the method llvm::DataLayout::getTypeABISize. *)
+external abi_align : DataLayout.t -> Llvm.lltype -> int = "llvm_abi_align"
 
 (** Computes the call frame alignment of a type in bytes for a target.
-    See the method llvm::TargetData::getTypeABISize. *)
-external stack_align : TargetData.t -> Llvm.lltype -> int = "llvm_stack_align"
+    See the method llvm::DataLayout::getTypeABISize. *)
+external stack_align : DataLayout.t -> Llvm.lltype -> int = "llvm_stack_align"
 
 (** Computes the preferred alignment of a type in bytes for a target.
-    See the method llvm::TargetData::getTypeABISize. *)
-external preferred_align : TargetData.t -> Llvm.lltype -> int
+    See the method llvm::DataLayout::getTypeABISize. *)
+external preferred_align : DataLayout.t -> Llvm.lltype -> int
                          = "llvm_preferred_align"
 
 (** Computes the preferred alignment of a global variable in bytes for a target.
-    See the method llvm::TargetData::getPreferredAlignment. *)
-external preferred_align_of_global : TargetData.t -> Llvm.llvalue -> int
+    See the method llvm::DataLayout::getPreferredAlignment. *)
+external preferred_align_of_global : DataLayout.t -> Llvm.llvalue -> int
                                    = "llvm_preferred_align_of_global"
 
 (** Computes the structure element that contains the byte offset for a target.
     See the method llvm::StructLayout::getElementContainingOffset. *)
-external element_at_offset : TargetData.t -> Llvm.lltype -> Int64.t -> int
+external element_at_offset : DataLayout.t -> Llvm.lltype -> Int64.t -> int
                            = "llvm_element_at_offset"
 
 (** Computes the byte offset of the indexed struct element for a target.
     See the method llvm::StructLayout::getElementContainingOffset. *)
-external offset_of_element : TargetData.t -> Llvm.lltype -> int -> Int64.t
+external offset_of_element : DataLayout.t -> Llvm.lltype -> int -> Int64.t
                            = "llvm_offset_of_element"

Modified: llvm/trunk/bindings/ocaml/target/target_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/target/target_ocaml.c?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/target/target_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/target/target_ocaml.c Mon Oct  8 11:39:34 2012
@@ -18,85 +18,85 @@
 #include "llvm-c/Target.h"
 #include "caml/alloc.h"
 
-/* string -> TargetData.t */
-CAMLprim LLVMTargetDataRef llvm_targetdata_create(value StringRep) {
-  return LLVMCreateTargetData(String_val(StringRep));
+/* string -> DataLayout.t */
+CAMLprim LLVMDataLayoutRef llvm_targetdata_create(value StringRep) {
+  return LLVMCreateDataLayout(String_val(StringRep));
 }
 
-/* TargetData.t -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_targetdata_add(LLVMTargetDataRef TD, LLVMPassManagerRef PM){
-  LLVMAddTargetData(TD, PM);
+/* DataLayout.t -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
+CAMLprim value llvm_targetdata_add(LLVMDataLayoutRef TD, LLVMPassManagerRef PM){
+  LLVMAddDataLayout(TD, PM);
   return Val_unit;
 }
 
-/* TargetData.t -> string */
-CAMLprim value llvm_targetdata_as_string(LLVMTargetDataRef TD) {
-  char *StringRep = LLVMCopyStringRepOfTargetData(TD);
+/* DataLayout.t -> string */
+CAMLprim value llvm_targetdata_as_string(LLVMDataLayoutRef TD) {
+  char *StringRep = LLVMCopyStringRepOfDataLayout(TD);
   value Copy = copy_string(StringRep);
   LLVMDisposeMessage(StringRep);
   return Copy;
 }
 
-/* TargetData.t -> unit */
-CAMLprim value llvm_targetdata_dispose(LLVMTargetDataRef TD) {
-  LLVMDisposeTargetData(TD);
+/* DataLayout.t -> unit */
+CAMLprim value llvm_targetdata_dispose(LLVMDataLayoutRef TD) {
+  LLVMDisposeDataLayout(TD);
   return Val_unit;
 }
 
-/* TargetData.t -> Endian.t */
-CAMLprim value llvm_byte_order(LLVMTargetDataRef TD) {
+/* DataLayout.t -> Endian.t */
+CAMLprim value llvm_byte_order(LLVMDataLayoutRef TD) {
   return Val_int(LLVMByteOrder(TD));
 }
 
-/* TargetData.t -> int */
-CAMLprim value llvm_pointer_size(LLVMTargetDataRef TD) {
+/* DataLayout.t -> int */
+CAMLprim value llvm_pointer_size(LLVMDataLayoutRef TD) {
   return Val_int(LLVMPointerSize(TD));
 }
 
-/* TargetData.t -> Llvm.lltype -> Int64.t */
-CAMLprim value llvm_size_in_bits(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
+/* DataLayout.t -> Llvm.lltype -> Int64.t */
+CAMLprim value llvm_size_in_bits(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
   return caml_copy_int64(LLVMSizeOfTypeInBits(TD, Ty));
 }
 
-/* TargetData.t -> Llvm.lltype -> Int64.t */
-CAMLprim value llvm_store_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
+/* DataLayout.t -> Llvm.lltype -> Int64.t */
+CAMLprim value llvm_store_size(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
   return caml_copy_int64(LLVMStoreSizeOfType(TD, Ty));
 }
 
-/* TargetData.t -> Llvm.lltype -> Int64.t */
-CAMLprim value llvm_abi_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
+/* DataLayout.t -> Llvm.lltype -> Int64.t */
+CAMLprim value llvm_abi_size(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
   return caml_copy_int64(LLVMABISizeOfType(TD, Ty));
 }
 
-/* TargetData.t -> Llvm.lltype -> int */
-CAMLprim value llvm_abi_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
+/* DataLayout.t -> Llvm.lltype -> int */
+CAMLprim value llvm_abi_align(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
   return Val_int(LLVMABIAlignmentOfType(TD, Ty));
 }
 
-/* TargetData.t -> Llvm.lltype -> int */
-CAMLprim value llvm_stack_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
+/* DataLayout.t -> Llvm.lltype -> int */
+CAMLprim value llvm_stack_align(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
   return Val_int(LLVMCallFrameAlignmentOfType(TD, Ty));
 }
 
-/* TargetData.t -> Llvm.lltype -> int */
-CAMLprim value llvm_preferred_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
+/* DataLayout.t -> Llvm.lltype -> int */
+CAMLprim value llvm_preferred_align(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
   return Val_int(LLVMPreferredAlignmentOfType(TD, Ty));
 }
 
-/* TargetData.t -> Llvm.llvalue -> int */
-CAMLprim value llvm_preferred_align_of_global(LLVMTargetDataRef TD,
+/* DataLayout.t -> Llvm.llvalue -> int */
+CAMLprim value llvm_preferred_align_of_global(LLVMDataLayoutRef TD,
                                               LLVMValueRef GlobalVar) {
   return Val_int(LLVMPreferredAlignmentOfGlobal(TD, GlobalVar));
 }
 
-/* TargetData.t -> Llvm.lltype -> Int64.t -> int */
-CAMLprim value llvm_element_at_offset(LLVMTargetDataRef TD, LLVMTypeRef Ty,
+/* DataLayout.t -> Llvm.lltype -> Int64.t -> int */
+CAMLprim value llvm_element_at_offset(LLVMDataLayoutRef TD, LLVMTypeRef Ty,
                                       value Offset) {
   return Val_int(LLVMElementAtOffset(TD, Ty, Int_val(Offset)));
 }
 
-/* TargetData.t -> Llvm.lltype -> int -> Int64.t */
-CAMLprim value llvm_offset_of_element(LLVMTargetDataRef TD, LLVMTypeRef Ty,
+/* DataLayout.t -> Llvm.lltype -> int -> Int64.t */
+CAMLprim value llvm_offset_of_element(LLVMDataLayoutRef TD, LLVMTypeRef Ty,
                                       value Index) {
   return caml_copy_int64(LLVMOffsetOfElement(TD, Ty, Int_val(Index)));
 }

Modified: llvm/trunk/docs/CodeGenerator.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodeGenerator.rst?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/CodeGenerator.rst (original)
+++ llvm/trunk/docs/CodeGenerator.rst Mon Oct  8 11:39:34 2012
@@ -81,7 +81,7 @@
 The two pieces of the LLVM code generator are the high-level interface to the
 code generator and the set of reusable components that can be used to build
 target-specific backends.  The two most important interfaces (:raw-html:`<tt>`
-`TargetMachine`_ :raw-html:`</tt>` and :raw-html:`<tt>` `TargetData`_
+`TargetMachine`_ :raw-html:`</tt>` and :raw-html:`<tt>` `DataLayout`_
 :raw-html:`</tt>`) are the only ones that are required to be defined for a
 backend to fit into the LLVM system, but the others must be defined if the
 reusable code generator components are going to be used.
@@ -197,7 +197,7 @@
 properties of the target (such as the instructions and registers it has), and do
 not incorporate any particular pieces of code generation algorithms.
 
-All of the target description classes (except the :raw-html:`<tt>` `TargetData`_
+All of the target description classes (except the :raw-html:`<tt>` `DataLayout`_
 :raw-html:`</tt>` class) are designed to be subclassed by the concrete target
 implementation, and have virtual methods implemented.  To get to these
 implementations, the :raw-html:`<tt>` `TargetMachine`_ :raw-html:`</tt>` class
@@ -214,18 +214,18 @@
 ``getFrameInfo``, etc.).  This class is designed to be specialized by a concrete
 target implementation (e.g., ``X86TargetMachine``) which implements the various
 virtual methods.  The only required target description class is the
-:raw-html:`<tt>` `TargetData`_ :raw-html:`</tt>` class, but if the code
+:raw-html:`<tt>` `DataLayout`_ :raw-html:`</tt>` class, but if the code
 generator components are to be used, the other interfaces should be implemented
 as well.
 
-.. _TargetData:
+.. _DataLayout:
 
-The ``TargetData`` class
+The ``DataLayout`` class
 ------------------------
 
-The ``TargetData`` class is the only required target description class, and it
+The ``DataLayout`` class is the only required target description class, and it
 is the only class that is not extensible (you cannot derived a new class from
-it).  ``TargetData`` specifies information about how the target lays out memory
+it).  ``DataLayout`` specifies information about how the target lays out memory
 for structures, the alignment requirements for various data types, the size of
 pointers in the target, and whether the target is little-endian or
 big-endian.

Modified: llvm/trunk/docs/GarbageCollection.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GarbageCollection.html?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/GarbageCollection.html (original)
+++ llvm/trunk/docs/GarbageCollection.html Mon Oct  8 11:39:34 2012
@@ -1253,7 +1253,7 @@
 >#include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/Function.h"
 #include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Target/TargetAsmInfo.h"
 
 void MyGCPrinter::beginAssembly(std::ostream &OS, AsmPrinter &AP,
@@ -1266,7 +1266,7 @@
   // Set up for emitting addresses.
   const char *AddressDirective;
   int AddressAlignLog;
-  if (AP.TM.getTargetData()->getPointerSize() == sizeof(int32_t)) {
+  if (AP.TM.getDataLayout()->getPointerSize() == sizeof(int32_t)) {
     AddressDirective = TAI.getData32bitsDirective();
     AddressAlignLog = 2;
   } else {

Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Mon Oct  8 11:39:34 2012
@@ -2104,7 +2104,7 @@
 <p>Structures may optionally be "packed" structures, which indicate that the 
   alignment of the struct is one byte, and that there is no padding between
   the elements.  In non-packed structs, padding between field types is inserted
-  as defined by the TargetData string in the module, which is required to match
+  as defined by the DataLayout string in the module, which is required to match
   what the underlying code generator expects.</p>
 
 <p>Structures can either be "literal" or "identified".  A literal structure is

Modified: llvm/trunk/docs/WritingAnLLVMBackend.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMBackend.html?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/WritingAnLLVMBackend.html (original)
+++ llvm/trunk/docs/WritingAnLLVMBackend.html Mon Oct  8 11:39:34 2012
@@ -314,14 +314,14 @@
 intended to obtain the instruction set (<tt>getInstrInfo</tt>), register set
 (<tt>getRegisterInfo</tt>), stack frame layout (<tt>getFrameInfo</tt>), and
 similar information. <tt>XXXTargetMachine</tt> must also implement the
-<tt>getTargetData</tt> method to access an object with target-specific data
+<tt>getDataLayout</tt> method to access an object with target-specific data
 characteristics, such as data type size and alignment requirements.
 </p>
 
 <p>
 For instance, for the SPARC target, the header file
 <tt>SparcTargetMachine.h</tt> declares prototypes for several <tt>get*Info</tt>
-and <tt>getTargetData</tt> methods that simply return a class member.
+and <tt>getDataLayout</tt> methods that simply return a class member.
 </p>
 
 <div class="doc_code">
@@ -331,7 +331,7 @@
 class Module;
 
 class SparcTargetMachine : public LLVMTargetMachine {
-  const TargetData DataLayout;       // Calculates type size & alignment
+  const DataLayout DataLayout;       // Calculates type size & alignment
   SparcSubtarget Subtarget;
   SparcInstrInfo InstrInfo;
   TargetFrameInfo FrameInfo;
@@ -348,7 +348,7 @@
   virtual const TargetRegisterInfo *getRegisterInfo() const {
     return &InstrInfo.getRegisterInfo();
   }
-  virtual const TargetData *getTargetData() const { return &DataLayout; }
+  virtual const DataLayout *getDataLayout() const { return &DataLayout; }
   static unsigned getModuleMatchQuality(const Module &M);
 
   // Pass Pipeline Configuration
@@ -364,7 +364,7 @@
 <li><tt>getInstrInfo()</tt></li>
 <li><tt>getRegisterInfo()</tt></li>
 <li><tt>getFrameInfo()</tt></li>
-<li><tt>getTargetData()</tt></li>
+<li><tt>getDataLayout()</tt></li>
 <li><tt>getSubtargetImpl()</tt></li>
 </ul>
 

Modified: llvm/trunk/docs/tutorial/LangImpl4.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl4.html?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl4.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl4.html Mon Oct  8 11:39:34 2012
@@ -173,7 +173,7 @@
 
   // Set up the optimizer pipeline.  Start with registering info about how the
   // target lays out data structures.
-  OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
+  OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout()));
   // Provide basic AliasAnalysis support for GVN.
   OurFPM.add(createBasicAliasAnalysisPass());
   // Do simple "peephole" optimizations and bit-twiddling optzns.
@@ -523,7 +523,7 @@
 #include "llvm/PassManager.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Analysis/Passes.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Support/TargetSelect.h"
 #include <cstdio>
@@ -1103,7 +1103,7 @@
 
   // Set up the optimizer pipeline.  Start with registering info about how the
   // target lays out data structures.
-  OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
+  OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout()));
   // Provide basic AliasAnalysis support for GVN.
   OurFPM.add(createBasicAliasAnalysisPass());
   // Do simple "peephole" optimizations and bit-twiddling optzns.

Modified: llvm/trunk/docs/tutorial/LangImpl5.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl5.html?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl5.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl5.html Mon Oct  8 11:39:34 2012
@@ -901,7 +901,7 @@
 #include "llvm/PassManager.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Analysis/Passes.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Support/TargetSelect.h"
 #include <cstdio>
@@ -1723,7 +1723,7 @@
 
   // Set up the optimizer pipeline.  Start with registering info about how the
   // target lays out data structures.
-  OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
+  OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout()));
   // Provide basic AliasAnalysis support for GVN.
   OurFPM.add(createBasicAliasAnalysisPass());
   // Do simple "peephole" optimizations and bit-twiddling optzns.

Modified: llvm/trunk/docs/tutorial/LangImpl6.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl6.html?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl6.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl6.html Mon Oct  8 11:39:34 2012
@@ -840,7 +840,7 @@
 #include "llvm/PassManager.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Analysis/Passes.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Support/TargetSelect.h"
 #include <cstdio>
@@ -1780,7 +1780,7 @@
 
   // Set up the optimizer pipeline.  Start with registering info about how the
   // target lays out data structures.
-  OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
+  OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout()));
   // Provide basic AliasAnalysis support for GVN.
   OurFPM.add(createBasicAliasAnalysisPass());
   // Do simple "peephole" optimizations and bit-twiddling optzns.

Modified: llvm/trunk/docs/tutorial/LangImpl7.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl7.html?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl7.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl7.html Mon Oct  8 11:39:34 2012
@@ -524,7 +524,7 @@
 <pre>
     // Set up the optimizer pipeline.  Start with registering info about how the
     // target lays out data structures.
-    OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
+    OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout()));
     <b>// Promote allocas to registers.
     OurFPM.add(createPromoteMemoryToRegisterPass());</b>
     // Do simple "peephole" optimizations and bit-twiddling optzns.
@@ -1008,7 +1008,7 @@
 #include "llvm/PassManager.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Analysis/Passes.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Support/TargetSelect.h"
 #include <cstdio>
@@ -2113,7 +2113,7 @@
 
   // Set up the optimizer pipeline.  Start with registering info about how the
   // target lays out data structures.
-  OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
+  OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout()));
   // Provide basic AliasAnalysis support for GVN.
   OurFPM.add(createBasicAliasAnalysisPass());
   // Promote allocas to registers.

Modified: llvm/trunk/docs/tutorial/OCamlLangImpl4.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl4.html?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/OCamlLangImpl4.html (original)
+++ llvm/trunk/docs/tutorial/OCamlLangImpl4.html Mon Oct  8 11:39:34 2012
@@ -189,7 +189,7 @@
 
   (* Set up the optimizer pipeline.  Start with registering info about how the
    * target lays out data structures. *)
-  TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
+  DataLayout.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
 
   (* Do simple "peephole" optimizations and bit-twiddling optzn. *)
   add_instruction_combining the_fpm;
@@ -965,7 +965,7 @@
 
   (* Set up the optimizer pipeline.  Start with registering info about how the
    * target lays out data structures. *)
-  TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
+  DataLayout.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
 
   (* Do simple "peephole" optimizations and bit-twiddling optzn. *)
   add_instruction_combination the_fpm;

Modified: llvm/trunk/docs/tutorial/OCamlLangImpl5.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl5.html?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/OCamlLangImpl5.html (original)
+++ llvm/trunk/docs/tutorial/OCamlLangImpl5.html Mon Oct  8 11:39:34 2012
@@ -1498,7 +1498,7 @@
 
   (* Set up the optimizer pipeline.  Start with registering info about how the
    * target lays out data structures. *)
-  TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
+  DataLayout.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
 
   (* Do simple "peephole" optimizations and bit-twiddling optzn. *)
   add_instruction_combination the_fpm;

Modified: llvm/trunk/docs/tutorial/OCamlLangImpl6.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl6.html?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/OCamlLangImpl6.html (original)
+++ llvm/trunk/docs/tutorial/OCamlLangImpl6.html Mon Oct  8 11:39:34 2012
@@ -1506,7 +1506,7 @@
 
   (* Set up the optimizer pipeline.  Start with registering info about how the
    * target lays out data structures. *)
-  TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
+  DataLayout.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
 
   (* Do simple "peephole" optimizations and bit-twiddling optzn. *)
   add_instruction_combination the_fpm;

Modified: llvm/trunk/docs/tutorial/OCamlLangImpl7.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl7.html?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/OCamlLangImpl7.html (original)
+++ llvm/trunk/docs/tutorial/OCamlLangImpl7.html Mon Oct  8 11:39:34 2012
@@ -545,7 +545,7 @@
 
   (* Set up the optimizer pipeline.  Start with registering info about how the
    * target lays out data structures. *)
-  TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
+  DataLayout.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
 
   <b>(* Promote allocas to registers. *)
   add_memory_to_register_promotion the_fpm;</b>
@@ -1834,7 +1834,7 @@
 
   (* Set up the optimizer pipeline.  Start with registering info about how the
    * target lays out data structures. *)
-  TargetData.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
+  DataLayout.add (ExecutionEngine.target_data the_execution_engine) the_fpm;
 
   (* Promote allocas to registers. *)
   add_memory_to_register_promotion the_fpm;

Modified: llvm/trunk/test/Bindings/Ocaml/ipo_opts.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/ipo_opts.ml?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/ipo_opts.ml (original)
+++ llvm/trunk/test/Bindings/Ocaml/ipo_opts.ml Mon Oct  8 11:39:34 2012
@@ -43,10 +43,10 @@
       ignore (build_ret (build_call fn [| |] "" b) b);
   end;
 
-  let td = TargetData.create (target_triple m) in
+  let td = DataLayout.create (target_triple m) in
   
   ignore (PassManager.create ()
-           ++ TargetData.add td
+           ++ DataLayout.add td
            ++ add_argument_promotion
            ++ add_constant_merge
            ++ add_dead_arg_elimination
@@ -63,7 +63,7 @@
            ++ PassManager.run_module m
            ++ PassManager.dispose);
 
-  TargetData.dispose td
+  DataLayout.dispose td
 
 
 (*===-- Driver ------------------------------------------------------------===*)

Modified: llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml (original)
+++ llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml Mon Oct  8 11:39:34 2012
@@ -38,10 +38,10 @@
   let fn = define_function "fn" fty m in
   ignore (build_ret_void (builder_at_end context (entry_block fn)));
   
-  let td = TargetData.create (target_triple m) in
+  let td = DataLayout.create (target_triple m) in
   
   ignore (PassManager.create_function m
-           ++ TargetData.add td
+           ++ DataLayout.add td
            ++ add_verifier
            ++ add_constant_propagation
            ++ add_sccp
@@ -78,7 +78,7 @@
            ++ PassManager.finalize
            ++ PassManager.dispose);
   
-  TargetData.dispose td
+  DataLayout.dispose td
 
 
 (*===-- Driver ------------------------------------------------------------===*)

Modified: llvm/trunk/test/Bindings/Ocaml/target.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/target.ml?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/target.ml (original)
+++ llvm/trunk/test/Bindings/Ocaml/target.ml Mon Oct  8 11:39:34 2012
@@ -33,10 +33,10 @@
 (*===-- Target Data -------------------------------------------------------===*)
 
 let test_target_data () =
-  let td = TargetData.create (target_triple m) in
+  let td = DataLayout.create (target_triple m) in
   let sty = struct_type context [| i32_type; i64_type |] in
   
-  ignore (TargetData.as_string td);
+  ignore (DataLayout.as_string td);
   ignore (byte_order td);
   ignore (pointer_size td);
   ignore (intptr_type td);
@@ -49,7 +49,7 @@
   ignore (element_at_offset td sty (Int64.of_int 1));
   ignore (offset_of_element td sty 1);
   
-  TargetData.dispose td
+  DataLayout.dispose td
 
 
 (*===-- Driver ------------------------------------------------------------===*)

Modified: llvm/trunk/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll Mon Oct  8 11:39:34 2012
@@ -39,11 +39,11 @@
 	%"struct.llvm::SymbolTable" = type opaque
 	%"struct.llvm::SymbolTableListTraits<llvm::Argument,llvm::Function,llvm::Function,llvm::ilist_traits<llvm::Argument> >" = type { %"struct.llvm::Function"*, %"struct.llvm::Function"* }
 	%"struct.llvm::SymbolTableListTraits<llvm::Instruction,llvm::BasicBlock,llvm::Function,llvm::ilist_traits<llvm::Instruction> >" = type { %"struct.llvm::Function"*, %"struct.llvm::BasicBlock"* }
-	%"struct.llvm::TargetData" = type { %"struct.llvm::FunctionPass", i1, i8, i8, i8, i8, i8, i8, i8, i8 }
+	%"struct.llvm::DataLayout" = type { %"struct.llvm::FunctionPass", i1, i8, i8, i8, i8, i8, i8, i8, i8 }
 	%"struct.llvm::TargetFrameInfo" = type { i32 (...)**, i32, i32, i32 }
 	%"struct.llvm::TargetInstrDescriptor" = type { i8*, i32, i32, i32, i1, i32, i32, i32, i32, i32, i32*, i32* }
 	%"struct.llvm::TargetInstrInfo" = type { i32 (...)**, %"struct.llvm::TargetInstrDescriptor"*, i32, i32 }
-	%"struct.llvm::TargetMachine" = type { i32 (...)**, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >", %"struct.llvm::TargetData", %"struct.llvm::IntrinsicLowering"* }
+	%"struct.llvm::TargetMachine" = type { i32 (...)**, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >", %"struct.llvm::DataLayout", %"struct.llvm::IntrinsicLowering"* }
 	%"struct.llvm::TargetRegClassInfo" = type { i32 (...)**, i32, i32, i32 }
 	%"struct.llvm::TargetRegInfo" = type { i32 (...)**, %"struct.std::vector<const llvm::TargetRegClassInfo*,std::allocator<const llvm::TargetRegClassInfo*> >", %"struct.llvm::TargetMachine"* }
 	%"struct.llvm::Type" = type { %"struct.llvm::Value", i32, i32, i1, i32, %"struct.llvm::Type"*, %"struct.std::vector<llvm::PATypeHandle,std::allocator<llvm::PATypeHandle> >" }

Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original)
+++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Mon Oct  8 11:39:34 2012
@@ -14,6 +14,7 @@
 
 #include "BugDriver.h"
 #include "llvm/Constants.h"
+#include "llvm/DataLayout.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/LLVMContext.h"
 #include "llvm/Module.h"
@@ -25,7 +26,6 @@
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/Transforms/Utils/CodeExtractor.h"
-#include "llvm/Target/TargetData.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FileUtilities.h"

Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Mon Oct  8 11:39:34 2012
@@ -16,11 +16,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "BugDriver.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Module.h"
 #include "llvm/PassManager.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Target/TargetData.h"
 #include "llvm/Support/FileUtilities.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/SystemUtils.h"

Modified: llvm/trunk/tools/llc/llc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/tools/llc/llc.cpp (original)
+++ llvm/trunk/tools/llc/llc.cpp Mon Oct  8 11:39:34 2012
@@ -14,6 +14,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/LLVMContext.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Module.h"
 #include "llvm/PassManager.h"
 #include "llvm/Pass.h"
@@ -34,7 +35,6 @@
 #include "llvm/Support/Signals.h"
 #include "llvm/Support/TargetRegistry.h"
 #include "llvm/Support/TargetSelect.h"
-#include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetLibraryInfo.h"
 #include "llvm/Target/TargetMachine.h"
 #include <memory>
@@ -506,10 +506,10 @@
   PM.add(TLI);
 
   // Add the target data from the target machine, if it exists, or the module.
-  if (const TargetData *TD = Target.getTargetData())
-    PM.add(new TargetData(*TD));
+  if (const DataLayout *TD = Target.getDataLayout())
+    PM.add(new DataLayout(*TD));
   else
-    PM.add(new TargetData(mod));
+    PM.add(new DataLayout(mod));
 
   // Override default to generate verbose assembly.
   Target.setAsmVerbosityDefault(true);

Modified: llvm/trunk/tools/llvm-extract/llvm-extract.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-extract/llvm-extract.cpp?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-extract/llvm-extract.cpp (original)
+++ llvm/trunk/tools/llvm-extract/llvm-extract.cpp Mon Oct  8 11:39:34 2012
@@ -18,7 +18,7 @@
 #include "llvm/Assembly/PrintModulePass.h"
 #include "llvm/Bitcode/ReaderWriter.h"
 #include "llvm/Transforms/IPO.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/IRReader.h"
 #include "llvm/Support/ManagedStatic.h"
@@ -206,7 +206,7 @@
   // In addition to deleting all other functions, we also want to spiff it
   // up a little bit.  Do this now.
   PassManager Passes;
-  Passes.add(new TargetData(M.get())); // Use correct TargetData
+  Passes.add(new DataLayout(M.get())); // Use correct DataLayout
 
   std::vector<GlobalValue*> Gvs(GVs.begin(), GVs.end());
 

Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Mon Oct  8 11:39:34 2012
@@ -15,6 +15,7 @@
 #include "LTOCodeGenerator.h"
 #include "LTOModule.h"
 #include "llvm/Constants.h"
+#include "llvm/DataLayout.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Linker.h"
 #include "llvm/LLVMContext.h"
@@ -29,7 +30,6 @@
 #include "llvm/MC/SubtargetFeature.h"
 #include "llvm/Target/Mangler.h"
 #include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetRegisterInfo.h"
 #include "llvm/Transforms/IPO.h"
@@ -293,7 +293,7 @@
 
   // mark which symbols can not be internalized
   MCContext Context(*_target->getMCAsmInfo(), *_target->getRegisterInfo(),NULL);
-  Mangler mangler(Context, *_target->getTargetData());
+  Mangler mangler(Context, *_target->getDataLayout());
   std::vector<const char*> mustPreserveList;
   SmallPtrSet<GlobalValue*, 8> asmUsed;
 
@@ -361,8 +361,8 @@
   // Start off with a verification pass.
   passes.add(createVerifierPass());
 
-  // Add an appropriate TargetData instance for this module...
-  passes.add(new TargetData(*_target->getTargetData()));
+  // Add an appropriate DataLayout instance for this module...
+  passes.add(new DataLayout(*_target->getDataLayout()));
 
   // Enabling internalize here would use its AllButMain variant. It
   // keeps only main if it exists and does nothing for libraries. Instead
@@ -376,7 +376,7 @@
 
   FunctionPassManager *codeGenPasses = new FunctionPassManager(mergedModule);
 
-  codeGenPasses->add(new TargetData(*_target->getTargetData()));
+  codeGenPasses->add(new DataLayout(*_target->getDataLayout()));
 
   formatted_raw_ostream Out(out);
 

Modified: llvm/trunk/tools/lto/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.cpp?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOModule.cpp (original)
+++ llvm/trunk/tools/lto/LTOModule.cpp Mon Oct  8 11:39:34 2012
@@ -158,7 +158,7 @@
 LTOModule::LTOModule(llvm::Module *m, llvm::TargetMachine *t)
   : _module(m), _target(t),
     _context(*_target->getMCAsmInfo(), *_target->getRegisterInfo(), NULL),
-    _mangler(_context, *_target->getTargetData()) {}
+    _mangler(_context, *_target->getDataLayout()) {}
 
 /// isBitcodeFile - Returns 'true' if the file (or memory contents) is LLVM
 /// bitcode.

Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Mon Oct  8 11:39:34 2012
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/LLVMContext.h"
+#include "llvm/DataLayout.h"
 #include "llvm/DebugInfo.h"
 #include "llvm/Module.h"
 #include "llvm/PassManager.h"
@@ -23,7 +24,6 @@
 #include "llvm/Analysis/LoopPass.h"
 #include "llvm/Analysis/RegionPass.h"
 #include "llvm/Analysis/CallGraph.h"
-#include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetLibraryInfo.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/ADT/StringSet.h"
@@ -568,13 +568,13 @@
     TLI->disableAllFunctions();
   Passes.add(TLI);
 
-  // Add an appropriate TargetData instance for this module.
-  TargetData *TD = 0;
+  // Add an appropriate DataLayout instance for this module.
+  DataLayout *TD = 0;
   const std::string &ModuleDataLayout = M.get()->getDataLayout();
   if (!ModuleDataLayout.empty())
-    TD = new TargetData(ModuleDataLayout);
+    TD = new DataLayout(ModuleDataLayout);
   else if (!DefaultDataLayout.empty())
-    TD = new TargetData(DefaultDataLayout);
+    TD = new DataLayout(DefaultDataLayout);
 
   if (TD)
     Passes.add(TD);
@@ -583,7 +583,7 @@
   if (OptLevelO1 || OptLevelO2 || OptLevelOs || OptLevelOz || OptLevelO3) {
     FPasses.reset(new FunctionPassManager(M.get()));
     if (TD)
-      FPasses->add(new TargetData(*TD));
+      FPasses->add(new DataLayout(*TD));
   }
 
   if (PrintBreakpoints) {

Modified: llvm/trunk/unittests/VMCore/InstructionsTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/VMCore/InstructionsTest.cpp?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/unittests/VMCore/InstructionsTest.cpp (original)
+++ llvm/trunk/unittests/VMCore/InstructionsTest.cpp Mon Oct  8 11:39:34 2012
@@ -9,6 +9,7 @@
 
 #include "llvm/BasicBlock.h"
 #include "llvm/Constants.h"
+#include "llvm/DataLayout.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/IRBuilder.h"
 #include "llvm/Instructions.h"
@@ -17,7 +18,6 @@
 #include "llvm/Operator.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Analysis/ValueTracking.h"
-#include "llvm/Target/TargetData.h"
 #include "gtest/gtest.h"
 
 namespace llvm {
@@ -183,7 +183,7 @@
   EXPECT_NE(S3, Gep3);
 
   int64_t Offset;
-  TargetData TD("e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3"
+  DataLayout TD("e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3"
                 "2:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80"
                 ":128:128-n8:16:32:64-S128");
   // Make sure we don't crash

Modified: llvm/trunk/unittests/VMCore/PassManagerTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/VMCore/PassManagerTest.cpp?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/unittests/VMCore/PassManagerTest.cpp (original)
+++ llvm/trunk/unittests/VMCore/PassManagerTest.cpp Mon Oct  8 11:39:34 2012
@@ -14,7 +14,7 @@
 #include "llvm/Pass.h"
 #include "llvm/Analysis/LoopPass.h"
 #include "llvm/CallGraphSCCPass.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Constants.h"
@@ -94,7 +94,7 @@
         initializeModuleNDMPass(*PassRegistry::getPassRegistry());
       }
       virtual bool runOnModule(Module &M) {
-        EXPECT_TRUE(getAnalysisIfAvailable<TargetData>());
+        EXPECT_TRUE(getAnalysisIfAvailable<DataLayout>());
         run++;
         return false;
       }
@@ -167,7 +167,7 @@
         initializeCGPassPass(*PassRegistry::getPassRegistry());
       }
       virtual bool runOnSCC(CallGraphSCC &SCMM) {
-        EXPECT_TRUE(getAnalysisIfAvailable<TargetData>());
+        EXPECT_TRUE(getAnalysisIfAvailable<DataLayout>());
         run();
         return false;
       }
@@ -177,7 +177,7 @@
     public:
       virtual bool runOnFunction(Function &F) {
         // FIXME: PR4112
-        // EXPECT_TRUE(getAnalysisIfAvailable<TargetData>());
+        // EXPECT_TRUE(getAnalysisIfAvailable<DataLayout>());
         run();
         return false;
       }
@@ -204,7 +204,7 @@
         return false;
       }
       virtual bool runOnLoop(Loop *L, LPPassManager &LPM) {
-        EXPECT_TRUE(getAnalysisIfAvailable<TargetData>());
+        EXPECT_TRUE(getAnalysisIfAvailable<DataLayout>());
         run();
         return false;
       }
@@ -241,7 +241,7 @@
         return false;
       }
       virtual bool runOnBasicBlock(BasicBlock &BB) {
-        EXPECT_TRUE(getAnalysisIfAvailable<TargetData>());
+        EXPECT_TRUE(getAnalysisIfAvailable<DataLayout>());
         run();
         return false;
       }
@@ -266,7 +266,7 @@
         initializeFPassPass(*PassRegistry::getPassRegistry());
       }
       virtual bool runOnModule(Module &M) {
-        EXPECT_TRUE(getAnalysisIfAvailable<TargetData>());
+        EXPECT_TRUE(getAnalysisIfAvailable<DataLayout>());
         for (Module::iterator I=M.begin(),E=M.end(); I != E; ++I) {
           Function &F = *I;
           {
@@ -292,7 +292,7 @@
       mNDM->run = mNDNM->run = mDNM->run = mNDM2->run = 0;
 
       PassManager Passes;
-      Passes.add(new TargetData(&M));
+      Passes.add(new DataLayout(&M));
       Passes.add(mNDM2);
       Passes.add(mNDM);
       Passes.add(mNDNM);
@@ -316,7 +316,7 @@
       mNDM->run = mNDNM->run = mDNM->run = mNDM2->run = 0;
 
       PassManager Passes;
-      Passes.add(new TargetData(&M));
+      Passes.add(new DataLayout(&M));
       Passes.add(mNDM);
       Passes.add(mNDNM);
       Passes.add(mNDM2);// invalidates mNDM needed by mDNM
@@ -338,7 +338,7 @@
       OwningPtr<Module> M(makeLLVMModule());
       T *P = new T();
       PassManager Passes;
-      Passes.add(new TargetData(M.get()));
+      Passes.add(new DataLayout(M.get()));
       Passes.add(P);
       Passes.run(*M);
       T::finishedOK(run);
@@ -349,7 +349,7 @@
       Module *M = makeLLVMModule();
       T *P = new T();
       PassManager Passes;
-      Passes.add(new TargetData(M));
+      Passes.add(new DataLayout(M));
       Passes.add(P);
       Passes.run(*M);
       T::finishedOK(run, N);
@@ -387,7 +387,7 @@
         SCOPED_TRACE("Running OnTheFlyTest");
         struct OnTheFlyTest *O = new OnTheFlyTest();
         PassManager Passes;
-        Passes.add(new TargetData(M));
+        Passes.add(new DataLayout(M));
         Passes.add(O);
         Passes.run(*M);
 

Modified: llvm/trunk/utils/TableGen/CallingConvEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CallingConvEmitter.cpp?rev=165403&r1=165402&r2=165403&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CallingConvEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/CallingConvEmitter.cpp Mon Oct  8 11:39:34 2012
@@ -177,12 +177,12 @@
       if (Size)
         O << Size << ", ";
       else
-        O << "\n" << IndentStr << "  State.getTarget().getTargetData()"
+        O << "\n" << IndentStr << "  State.getTarget().getDataLayout()"
           "->getTypeAllocSize(EVT(LocVT).getTypeForEVT(State.getContext())), ";
       if (Align)
         O << Align;
       else
-        O << "\n" << IndentStr << "  State.getTarget().getTargetData()"
+        O << "\n" << IndentStr << "  State.getTarget().getDataLayout()"
           "->getABITypeAlignment(EVT(LocVT).getTypeForEVT(State.getContext()))";
       if (Action->isSubClassOf("CCAssignToStackWithShadow"))
         O << ", " << getQualifiedName(Action->getValueAsDef("ShadowReg"));





More information about the llvm-commits mailing list