llvm.org GIT mirror llvm / 4d2e9d9
Remove lto_codegen_set_whole_program_optimization. It is a work in progress, so we don't want it to show up in the stable 3.1 interface. While at it, add a comment about why LTOCodeGenerator manually creates the internalize pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154807 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 7 years ago
5 changed file(s) with 5 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
250250 int nargs);
251251
252252 /**
253 * Enables the internalize pass during LTO optimizations.
254 */
255 extern void
256 lto_codegen_set_whole_program_optimization(lto_code_gen_t cg);
257
258 /**
259253 * Adds to a list of all global symbols that must exist in the final
260254 * generated code. If a function is not listed, it might be
261255 * inlined into every usage and optimized away.
6363 : _context(getGlobalContext()),
6464 _linker("LinkTimeOptimizer", "ld-temp.o", _context), _target(NULL),
6565 _emitDwarfDebugInfo(false), _scopeRestrictionsDone(false),
66 _runInternalizePass(false), _codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
66 _codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
6767 _nativeObjectFile(NULL) {
6868 InitializeAllTargets();
6969 InitializeAllTargetMCs();
354354 // Add an appropriate TargetData instance for this module...
355355 passes.add(new TargetData(*_target->getTargetData()));
356356
357 PassManagerBuilder().populateLTOPassManager(passes,
358 _runInternalizePass,
357 // Enabling internalize here would use its AllButMain variant. It
358 // keeps only main if it exists and does nothing for libraries. Instead
359 // we create the pass ourselves with the symbol list provided by the linker.
360 PassManagerBuilder().populateLTOPassManager(passes, /*Internalize=*/false,
359361 !DisableInline,
360362 DisableGVNLoadPRE);
361363
5353 const void *compile(size_t *length, std::string &errMsg);
5454 void setCodeGenDebugOptions(const char *opts);
5555
56 void enableInternalizePass() { _runInternalizePass = true; }
57
5856 private:
5957 bool generateObjectFile(llvm::raw_ostream &out, std::string &errMsg);
6058 void applyScopeRestrictions();
182182 cg->addMustPreserveSymbol(symbol);
183183 }
184184
185 /// lto_codegen_set_whole_program_optimization - Enable the internalize pass
186 /// during LTO optimizations.
187 void lto_codegen_set_whole_program_optimization(lto_code_gen_t cg) {
188 cg->enableInternalizePass();
189 }
190
191185 /// lto_codegen_write_merged_modules - Writes a new file at the specified path
192186 /// that contains the merged contents of all modules added so far. Returns true
193187 /// on error (check lto_get_error_message() for details).
2626 lto_codegen_set_assembler_path
2727 lto_codegen_set_cpu
2828 lto_codegen_compile_to_file
29 lto_codegen_set_whole_program_optimization
3029 LLVMCreateDisasm
3130 LLVMDisasmDispose
3231 LLVMDisasmInstruction