diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-10-24 22:26:04 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-10-24 22:26:04 +0000 |
commit | 07d5aef3057b2e403b20d683e7477c93fde67d99 (patch) | |
tree | e092e60447874e1e789e69a11fc1c95b31d38bcd /tools | |
parent | 9e39e0d56d105f97b9d8f851403619bb0d9f780d (diff) | |
download | external_llvm-07d5aef3057b2e403b20d683e7477c93fde67d99.zip external_llvm-07d5aef3057b2e403b20d683e7477c93fde67d99.tar.gz external_llvm-07d5aef3057b2e403b20d683e7477c93fde67d99.tar.bz2 |
lto.h: Use lto_bool_t instead of int to restore the ABI
This reverts commit r193255 and instead creates an lto_bool_t typedef
that points to bool, _Bool, or unsigned char depending on what is
available. Only recent versions of MSVC provide a stdbool.h header.
Reviewers: rafael.espindola
Differential Revision: http://llvm-reviews.chandlerc.com/D2019
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193377 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lto/lto.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index ff3e308..a3acd4c 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -90,26 +90,26 @@ const char* lto_get_error_message() { } /// lto_module_is_object_file - Validates if a file is a loadable object file. -int lto_module_is_object_file(const char* path) { +bool lto_module_is_object_file(const char* path) { return LTOModule::isBitcodeFile(path); } /// lto_module_is_object_file_for_target - Validates if a file is a loadable /// object file compilable for requested target. -int lto_module_is_object_file_for_target(const char* path, +bool lto_module_is_object_file_for_target(const char* path, const char* target_triplet_prefix) { return LTOModule::isBitcodeFileForTarget(path, target_triplet_prefix); } /// lto_module_is_object_file_in_memory - Validates if a buffer is a loadable /// object file. -int lto_module_is_object_file_in_memory(const void* mem, size_t length) { +bool lto_module_is_object_file_in_memory(const void* mem, size_t length) { return LTOModule::isBitcodeFile(mem, length); } /// lto_module_is_object_file_in_memory_for_target - Validates if a buffer is a /// loadable object file compilable for the target. -int +bool lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length, const char* target_triplet_prefix) { @@ -216,21 +216,21 @@ void lto_codegen_dispose(lto_code_gen_t cg) { /// lto_codegen_add_module - Add an object module to the set of modules for /// which code will be generated. Returns true on error (check /// lto_get_error_message() for details). -int lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod) { +bool lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod) { return !cg->addModule(mod, sLastErrorString); } /// lto_codegen_set_debug_model - Sets what if any format of debug info should /// be generated. Returns true on error (check lto_get_error_message() for /// details). -int lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug) { +bool lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug) { cg->setDebugInfo(debug); return false; } /// lto_codegen_set_pic_model - Sets what code model to generated. Returns true /// on error (check lto_get_error_message() for details). -int lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model) { +bool lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model) { cg->setCodePICModel(model); return false; } @@ -267,7 +267,7 @@ void lto_codegen_add_dso_symbol(lto_code_gen_t cg, const char *symbol) { /// lto_codegen_write_merged_modules - Writes a new file at the specified path /// that contains the merged contents of all modules added so far. Returns true /// on error (check lto_get_error_message() for details). -int lto_codegen_write_merged_modules(lto_code_gen_t cg, const char *path) { +bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char *path) { if (!parsedOptions) { cg->parseCodeGenDebugOptions(); parsedOptions = true; @@ -293,7 +293,7 @@ const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) { /// lto_codegen_compile_to_file - Generates code for all added modules into one /// native object file. The name of the file is written to name. Returns true on /// error. -int lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) { +bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) { if (!parsedOptions) { cg->parseCodeGenDebugOptions(); parsedOptions = true; |