]> granicus.if.org Git - llvm/commitdiff
Deprecate the DataLayout on the TargetMachine, and backport the 3.8 API to ease trans...
authorHans Wennborg <hans@hanshq.net>
Tue, 25 Aug 2015 16:25:46 +0000 (16:25 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 25 Aug 2015 16:25:46 +0000 (16:25 +0000)
By Mehdi Amini.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_37@245948 91177308-0d34-0410-b5e6-96231b3b80d8

docs/ReleaseNotes.rst
include/llvm-c/TargetMachine.h
include/llvm/Target/TargetMachine.h

index d4860c9a20c5aba475685de111d3a62eca155787..cb9d041535e65f9376147cd36996b7dce7f18f03 100644 (file)
@@ -53,6 +53,14 @@ Non-comprehensive list of changes in this release
   a pointer to make it explicit. The Module owns the datalayout and it has to
   match the one attached to the TargetMachine for generating code.
 
+  In 3.6, a pass was inserted in the pipeline to make the DataLayout accessible:
+    MyPassManager->add(new DataLayoutPass(MyTargetMachine->getDataLayout()));
+  In 3.7, you don't need a pass, you set the DataLayout on the Module:
+    MyModule->setDataLayout(MyTargetMachine->createDataLayout());
+
+  The LLVM C API `LLVMGetTargetMachineData` is deprecated to reflect the fact
+  that it won't be available anymore from TargetMachine in 3.8.
+
 * Comdats are now ortogonal to the linkage. LLVM will not create
   comdats for weak linkage globals and the frontends are responsible
   for explicitly adding them.
index d4993e7e6da1e0e5f9bd4892062202db2e981af8..8cf1f43cb3c56559928e05ede4da696f5ff47fae 100644 (file)
@@ -115,7 +115,7 @@ char *LLVMGetTargetMachineCPU(LLVMTargetMachineRef T);
   LLVMDisposeMessage. */
 char *LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T);
 
-/** Returns the llvm::DataLayout used for this llvm:TargetMachine. */
+/** Deprecated: use LLVMGetDataLayout(LLVMModuleRef M) instead. */
 LLVMTargetDataRef LLVMGetTargetMachineData(LLVMTargetMachineRef T);
 
 /** Set the target machine's ASM verbosity. */
index 06a2b13836ed6548561733fab16b490dcb8cd33c..f1e9d1718f5ac5ecf6009af29788a8f33b452296 100644 (file)
@@ -125,10 +125,15 @@ public:
     return *static_cast<const STC*>(getSubtargetImpl(F));
   }
 
+  /// Deprecated in 3.7, will be removed in 3.8. Use createDataLayout() instead.
+  ///
   /// This method returns a pointer to the DataLayout for the target. It should
   /// be unchanging for every subtarget.
   const DataLayout *getDataLayout() const { return &DL; }
 
+  /// Create a DataLayout.
+  const DataLayout createDataLayout() const { return DL; }
+
   /// \brief Reset the target options based on the function's attributes.
   // FIXME: Remove TargetOptions that affect per-function code generation
   // from TargetMachine.