llvm.org GIT mirror llvm / 849fb26
Deprecate the DataLayout on the TargetMachine, and backport the 3.8 API to ease transition By Mehdi Amini. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_37@245948 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 4 years ago
3 changed file(s) with 14 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
5151 it to be present and the API has been changed to use a reference instead of
5252 a pointer to make it explicit. The Module owns the datalayout and it has to
5353 match the one attached to the TargetMachine for generating code.
54
55 In 3.6, a pass was inserted in the pipeline to make the DataLayout accessible:
56 MyPassManager->add(new DataLayoutPass(MyTargetMachine->getDataLayout()));
57 In 3.7, you don't need a pass, you set the DataLayout on the Module:
58 MyModule->setDataLayout(MyTargetMachine->createDataLayout());
59
60 The LLVM C API `LLVMGetTargetMachineData` is deprecated to reflect the fact
61 that it won't be available anymore from TargetMachine in 3.8.
5462
5563 * Comdats are now ortogonal to the linkage. LLVM will not create
5664 comdats for weak linkage globals and the frontends are responsible
124124 return *static_cast(getSubtargetImpl(F));
125125 }
126126
127 /// Deprecated in 3.7, will be removed in 3.8. Use createDataLayout() instead.
128 ///
127129 /// This method returns a pointer to the DataLayout for the target. It should
128130 /// be unchanging for every subtarget.
129131 const DataLayout *getDataLayout() const { return &DL; }
132
133 /// Create a DataLayout.
134 const DataLayout createDataLayout() const { return DL; }
130135
131136 /// \brief Reset the target options based on the function's attributes.
132137 // FIXME: Remove TargetOptions that affect per-function code generation
114114 LLVMDisposeMessage. */
115115 char *LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T);
116116
117 /** Returns the llvm::DataLayout used for this llvm:TargetMachine. */
117 /** Deprecated: use LLVMGetDataLayout(LLVMModuleRef M) instead. */
118118 LLVMTargetDataRef LLVMGetTargetMachineData(LLVMTargetMachineRef T);
119119
120120 /** Set the target machine's ASM verbosity. */