diff options
author | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2015-11-17 19:48:12 +0000 |
---|---|---|
committer | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2015-11-17 19:48:12 +0000 |
commit | 8e348cc732a61b25ed297d5d284bc9d5748f1311 (patch) | |
tree | d03d58eae9276630d5999f2392288ba719ca5902 /llvm/tools/lto/lto.cpp | |
parent | 2ae15e06093b776d8d0ca1f24bb3790005bf21eb (diff) | |
download | bcm5719-llvm-8e348cc732a61b25ed297d5d284bc9d5748f1311.tar.gz bcm5719-llvm-8e348cc732a61b25ed297d5d284bc9d5748f1311.zip |
Switch lto codegen to using diagnostic handlers.
This patch removes the std::string& argument from a number of C++ LTO API calls
and instead makes them use the installed diagnostic handler. This would also
improve consistency of diagnostic handling infrastructure: if an LTO client used
lto_codegen_set_diagnostic_handler() to install a custom error handler, we do
not want some error messages to go through the custom error handler, and some
other error messages to go into sLastErrorString.
llvm-svn: 253367
Diffstat (limited to 'llvm/tools/lto/lto.cpp')
-rw-r--r-- | llvm/tools/lto/lto.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/tools/lto/lto.cpp b/llvm/tools/lto/lto.cpp index 0839a566cc5..ee389da2499 100644 --- a/llvm/tools/lto/lto.cpp +++ b/llvm/tools/lto/lto.cpp @@ -333,7 +333,7 @@ static void maybeParseOptions(lto_code_gen_t cg) { bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char *path) { maybeParseOptions(cg); - return !unwrap(cg)->writeMergedModules(path, sLastErrorString); + return !unwrap(cg)->writeMergedModules(path); } const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) { @@ -341,7 +341,7 @@ const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) { LibLTOCodeGenerator *CG = unwrap(cg); CG->NativeObjectFile = CG->compile(DisableVerify, DisableInline, DisableGVNLoadPRE, - DisableLTOVectorization, sLastErrorString); + DisableLTOVectorization); if (!CG->NativeObjectFile) return nullptr; *length = CG->NativeObjectFile->getBufferSize(); @@ -351,13 +351,13 @@ const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) { bool lto_codegen_optimize(lto_code_gen_t cg) { maybeParseOptions(cg); return !unwrap(cg)->optimize(DisableVerify, DisableInline, DisableGVNLoadPRE, - DisableLTOVectorization, sLastErrorString); + DisableLTOVectorization); } const void *lto_codegen_compile_optimized(lto_code_gen_t cg, size_t *length) { maybeParseOptions(cg); LibLTOCodeGenerator *CG = unwrap(cg); - CG->NativeObjectFile = CG->compileOptimized(sLastErrorString); + CG->NativeObjectFile = CG->compileOptimized(); if (!CG->NativeObjectFile) return nullptr; *length = CG->NativeObjectFile->getBufferSize(); @@ -368,7 +368,7 @@ bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) { maybeParseOptions(cg); return !unwrap(cg)->compile_to_file( name, DisableVerify, DisableInline, DisableGVNLoadPRE, - DisableLTOVectorization, sLastErrorString); + DisableLTOVectorization); } void lto_codegen_debug_options(lto_code_gen_t cg, const char *opt) { |