llvm.org GIT mirror llvm / d0aed13
Kill LLVMAddTargetData Summary: It's red, it's dead. Reviewers: joker.eph, Wallbraker, echristo Subscribers: llvm-commits, axw Differential Revision: http://reviews.llvm.org/D17282 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260919 91177308-0d34-0410-b5e6-96231b3b80d8 Amaury Sechet 4 years ago
6 changed file(s) with 2 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
8080 pass := NewPassManager()
8181 defer pass.Dispose()
8282
83 pass.Add(engine.TargetData())
8483 pass.AddConstantPropagationPass()
8584 pass.AddInstructionCombiningPass()
8685 pass.AddPromoteMemoryToRegisterPass()
118118 defer C.free(unsafe.Pointer(crep))
119119 td.C = C.LLVMCreateTargetData(crep)
120120 return
121 }
122
123 // Adds target data information to a pass manager. This does not take ownership
124 // of the target data.
125 // See the method llvm::PassManagerBase::add.
126 func (pm PassManager) Add(td TargetData) {
127 C.LLVMAddTargetData(td.C, pm.C)
128121 }
129122
130123 // Converts target data to a target layout string. The string must be disposed
4040 removed (use LLVMGetDataLayout instead).
4141
4242 * The C API function LLVMLinkModules has been removed.
43
44 * The C API function LLVMAddTargetData has been removed.
4345
4446 .. NOTE
4547 For small 1-3 sentence descriptions, just add an entry at the end of
186186 See the constructor llvm::DataLayout::DataLayout. */
187187 LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep);
188188
189 /** Adds target data information to a pass manager. This does not take ownership
190 of the target data.
191 See the method llvm::PassManagerBase::add. */
192 void LLVMAddTargetData(LLVMTargetDataRef TD, LLVMPassManagerRef PM);
193
194189 /** Adds target library information to a pass manager. This does not take
195190 ownership of the target library info.
196191 See the method llvm::PassManagerBase::add. */
4343
4444 LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep) {
4545 return wrap(new DataLayout(StringRep));
46 }
47
48 void LLVMAddTargetData(LLVMTargetDataRef TD, LLVMPassManagerRef PM) {
4946 }
5047
5148 void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI,
284284
285285 void buildAndRunPasses() {
286286 LLVMPassManagerRef pass = LLVMCreatePassManager();
287 LLVMAddTargetData(LLVMGetExecutionEngineTargetData(Engine), pass);
288287 LLVMAddConstantPropagationPass(pass);
289288 LLVMAddInstructionCombiningPass(pass);
290289 LLVMRunPassManager(pass, Module);
302301 LLVMCreateFunctionPassManagerForModule(Module);
303302 LLVMPassManagerRef modulePasses =
304303 LLVMCreatePassManager();
305
306 LLVMAddTargetData(LLVMGetExecutionEngineTargetData(Engine), modulePasses);
307304
308305 LLVMPassManagerBuilderPopulateFunctionPassManager(passBuilder,
309306 functionPasses);