<div dir="ltr">Isn't the LTO API supposed to be ABI-stable?  Could this be an ABI breaking change?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 23, 2013 at 10:56 AM, NAKAMURA Takumi <span dir="ltr"><<a href="mailto:geek4civic@gmail.com" target="_blank">geek4civic@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: chapuni<br>
Date: Wed Oct 23 12:56:46 2013<br>
New Revision: 193255<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=193255&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=193255&view=rev</a><br>
Log:<br>
llvm-c/lto.h: Avoid use of bool.<br>
<br>
Modified:<br>
    llvm/trunk/include/llvm-c/lto.h<br>
    llvm/trunk/tools/lto/lto.cpp<br>
<br>
Modified: llvm/trunk/include/llvm-c/lto.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/lto.h?rev=193255&r1=193254&r2=193255&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/lto.h?rev=193255&r1=193254&r2=193255&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/include/llvm-c/lto.h (original)<br>
+++ llvm/trunk/include/llvm-c/lto.h Wed Oct 23 12:56:46 2013<br>
@@ -16,9 +16,6 @@<br>
 #ifndef LLVM_C_LTO_H<br>
 #define LLVM_C_LTO_H<br>
<br>
-#ifndef __cplusplus<br>
-#include <stdbool.h><br>
-#endif<br>
 #include <stddef.h><br>
 #include <sys/types.h><br>
<br>
@@ -89,14 +86,14 @@ lto_get_error_message(void);<br>
 /**<br>
  * Checks if a file is a loadable object file.<br>
  */<br>
-extern bool<br>
+extern int<br>
 lto_module_is_object_file(const char* path);<br>
<br>
<br>
 /**<br>
  * Checks if a file is a loadable object compiled for requested target.<br>
  */<br>
-extern bool<br>
+extern int<br>
 lto_module_is_object_file_for_target(const char* path,<br>
                                      const char* target_triple_prefix);<br>
<br>
@@ -104,14 +101,14 @@ lto_module_is_object_file_for_target(con<br>
 /**<br>
  * Checks if a buffer is a loadable object file.<br>
  */<br>
-extern bool<br>
+extern int<br>
 lto_module_is_object_file_in_memory(const void* mem, size_t length);<br>
<br>
<br>
 /**<br>
  * Checks if a buffer is a loadable object compiled for requested target.<br>
  */<br>
-extern bool<br>
+extern int<br>
 lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length,<br>
                                               const char* target_triple_prefix);<br>
<br>
@@ -210,7 +207,7 @@ lto_codegen_dispose(lto_code_gen_t);<br>
  * Add an object module to the set of modules for which code will be generated.<br>
  * Returns true on error (check lto_get_error_message() for details).<br>
  */<br>
-extern bool<br>
+extern int<br>
 lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod);<br>
<br>
<br>
@@ -219,7 +216,7 @@ lto_codegen_add_module(lto_code_gen_t cg<br>
  * Sets if debug info should be generated.<br>
  * Returns true on error (check lto_get_error_message() for details).<br>
  */<br>
-extern bool<br>
+extern int<br>
 lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model);<br>
<br>
<br>
@@ -227,7 +224,7 @@ lto_codegen_set_debug_model(lto_code_gen<br>
  * Sets which PIC code model to generated.<br>
  * Returns true on error (check lto_get_error_message() for details).<br>
  */<br>
-extern bool<br>
+extern int<br>
 lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model);<br>
<br>
<br>
@@ -273,7 +270,7 @@ extern void lto_codegen_add_dso_symbol(l<br>
  * merged contents of all modules added so far.<br>
  * Returns true on error (check lto_get_error_message() for details).<br>
  */<br>
-extern bool<br>
+extern int<br>
 lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path);<br>
<br>
 /**<br>
@@ -291,7 +288,7 @@ lto_codegen_compile(lto_code_gen_t cg, s<br>
  * Generates code for all added modules into one native object file.<br>
  * The name of the file is written to name. Returns true on error.<br>
  */<br>
-extern bool<br>
+extern int<br>
 lto_codegen_compile_to_file(lto_code_gen_t cg, const char** name);<br>
<br>
<br>
<br>
Modified: llvm/trunk/tools/lto/lto.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=193255&r1=193254&r2=193255&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=193255&r1=193254&r2=193255&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/tools/lto/lto.cpp (original)<br>
+++ llvm/trunk/tools/lto/lto.cpp Wed Oct 23 12:56:46 2013<br>
@@ -90,26 +90,26 @@ const char* lto_get_error_message() {<br>
 }<br>
<br>
 /// lto_module_is_object_file - Validates if a file is a loadable object file.<br>
-bool lto_module_is_object_file(const char* path) {<br>
+int lto_module_is_object_file(const char* path) {<br>
   return LTOModule::isBitcodeFile(path);<br>
 }<br>
<br>
 /// lto_module_is_object_file_for_target - Validates if a file is a loadable<br>
 /// object file compilable for requested target.<br>
-bool lto_module_is_object_file_for_target(const char* path,<br>
+int lto_module_is_object_file_for_target(const char* path,<br>
                                           const char* target_triplet_prefix) {<br>
   return LTOModule::isBitcodeFileForTarget(path, target_triplet_prefix);<br>
 }<br>
<br>
 /// lto_module_is_object_file_in_memory - Validates if a buffer is a loadable<br>
 /// object file.<br>
-bool lto_module_is_object_file_in_memory(const void* mem, size_t length) {<br>
+int lto_module_is_object_file_in_memory(const void* mem, size_t length) {<br>
   return LTOModule::isBitcodeFile(mem, length);<br>
 }<br>
<br>
 /// lto_module_is_object_file_in_memory_for_target - Validates if a buffer is a<br>
 /// loadable object file compilable for the target.<br>
-bool<br>
+int<br>
 lto_module_is_object_file_in_memory_for_target(const void* mem,<br>
                                             size_t length,<br>
                                             const char* target_triplet_prefix) {<br>
@@ -216,21 +216,21 @@ void lto_codegen_dispose(lto_code_gen_t<br>
 /// lto_codegen_add_module - Add an object module to the set of modules for<br>
 /// which code will be generated. Returns true on error (check<br>
 /// lto_get_error_message() for details).<br>
-bool lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod) {<br>
+int lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod) {<br>
   return !cg->addModule(mod, sLastErrorString);<br>
 }<br>
<br>
 /// lto_codegen_set_debug_model - Sets what if any format of debug info should<br>
 /// be generated. Returns true on error (check lto_get_error_message() for<br>
 /// details).<br>
-bool lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug) {<br>
+int lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug) {<br>
   cg->setDebugInfo(debug);<br>
   return false;<br>
 }<br>
<br>
 /// lto_codegen_set_pic_model - Sets what code model to generated. Returns true<br>
 /// on error (check lto_get_error_message() for details).<br>
-bool lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model) {<br>
+int lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model) {<br>
   cg->setCodePICModel(model);<br>
   return false;<br>
 }<br>
@@ -267,7 +267,7 @@ void lto_codegen_add_dso_symbol(lto_code<br>
 /// lto_codegen_write_merged_modules - Writes a new file at the specified path<br>
 /// that contains the merged contents of all modules added so far. Returns true<br>
 /// on error (check lto_get_error_message() for details).<br>
-bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char *path) {<br>
+int lto_codegen_write_merged_modules(lto_code_gen_t cg, const char *path) {<br>
   if (!parsedOptions) {<br>
     cg->parseCodeGenDebugOptions();<br>
     parsedOptions = true;<br>
@@ -293,7 +293,7 @@ const void *lto_codegen_compile(lto_code<br>
 /// lto_codegen_compile_to_file - Generates code for all added modules into one<br>
 /// native object file. The name of the file is written to name. Returns true on<br>
 /// error.<br>
-bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) {<br>
+int lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) {<br>
   if (!parsedOptions) {<br>
     cg->parseCodeGenDebugOptions();<br>
     parsedOptions = true;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>