<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Thanks Duncan for doing that!<div><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-Quentin</div>

</div>
<br><div style=""><div>On Jan 16, 2014, at 1:37 PM, Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Author: dexonsmith<br>Date: Thu Jan 16 15:37:17 2014<br>New Revision: 199429<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=199429&view=rev">http://llvm.org/viewvc/llvm-project?rev=199429&view=rev</a><br>Log:<br>LTO: document LTO_API_VERSION for each API<br><br>Adding a doxygen comment for each bit of API to indicate at which<br>LTO_API_VERSION each was available, manually gleaned from successive<br>git-blames.  A few notes:<br><br>- LTO_API_VERSION was set to 3 at its introduction.<br>- I've indicated all the API introduced before LTO_API_VERSION was<br>  around as available "prior to LTO_API_VERSION=3".<br>- A number of API changes neglected to bump LTO_API_VERSION.  These I've<br>  indicated as available at the *next* bump of LTO_API_VERSION.<br><br>Modified:<br>    llvm/trunk/include/llvm-c/lto.h<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=199429&r1=199428&r2=199429&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/lto.h?rev=199429&r1=199428&r2=199429&view=diff</a><br>==============================================================================<br>--- llvm/trunk/include/llvm-c/lto.h (original)<br>+++ llvm/trunk/include/llvm-c/lto.h Thu Jan 16 15:37:17 2014<br>@@ -42,6 +42,9 @@ typedef bool lto_bool_t;<br><br> #define LTO_API_VERSION 7<br><br>+/**<br>+ * \since prior to LTO_API_VERSION=3<br>+ */<br> typedef enum {<br>     LTO_SYMBOL_ALIGNMENT_MASK              = 0x0000001F, /* log2 of alignment */<br>     LTO_SYMBOL_PERMISSIONS_MASK            = 0x000000E0,<br>@@ -62,17 +65,26 @@ typedef enum {<br>     LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN = 0x00002800<br> } lto_symbol_attributes;<br><br>+/**<br>+ * \since prior to LTO_API_VERSION=3<br>+ */<br> typedef enum {<br>     LTO_DEBUG_MODEL_NONE         = 0,<br>     LTO_DEBUG_MODEL_DWARF        = 1<br> } lto_debug_model;<br><br>+/**<br>+ * \since prior to LTO_API_VERSION=3<br>+ */<br> typedef enum {<br>     LTO_CODEGEN_PIC_MODEL_STATIC         = 0,<br>     LTO_CODEGEN_PIC_MODEL_DYNAMIC        = 1,<br>     LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC = 2<br> } lto_codegen_model;<br><br>+/**<br>+ * \since LTO_API_VERSION=6<br>+ */<br> typedef enum {<br>     LTO_INTERNALIZE_FULL   = 0,<br>     LTO_INTERNALIZE_NONE   = 1,<br>@@ -91,6 +103,8 @@ extern "C" {<br><br> /**<br>  * Returns a printable string.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern const char*<br> lto_get_version(void);<br>@@ -98,12 +112,16 @@ lto_get_version(void);<br><br> /**<br>  * Returns the last error string or NULL if last operation was successful.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern const char*<br> lto_get_error_message(void);<br><br> /**<br>  * Checks if a file is a loadable object file.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern lto_bool_t<br> lto_module_is_object_file(const char* path);<br>@@ -111,6 +129,8 @@ lto_module_is_object_file(const char* pa<br><br> /**<br>  * Checks if a file is a loadable object compiled for requested target.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern lto_bool_t<br> lto_module_is_object_file_for_target(const char* path,<br>@@ -119,6 +139,8 @@ lto_module_is_object_file_for_target(con<br><br> /**<br>  * Checks if a buffer is a loadable object file.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern lto_bool_t<br> lto_module_is_object_file_in_memory(const void* mem, size_t length);<br>@@ -126,6 +148,8 @@ lto_module_is_object_file_in_memory(cons<br><br> /**<br>  * Checks if a buffer is a loadable object compiled for requested target.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern lto_bool_t<br> lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length,<br>@@ -135,6 +159,8 @@ lto_module_is_object_file_in_memory_for_<br> /**<br>  * Loads an object file from disk.<br>  * Returns NULL on error (check lto_get_error_message() for details).<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern lto_module_t<br> lto_module_create(const char* path);<br>@@ -143,6 +169,8 @@ lto_module_create(const char* path);<br> /**<br>  * Loads an object file from memory.<br>  * Returns NULL on error (check lto_get_error_message() for details).<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern lto_module_t<br> lto_module_create_from_memory(const void* mem, size_t length);<br>@@ -150,6 +178,8 @@ lto_module_create_from_memory(const void<br> /**<br>  * Loads an object file from disk. The seek point of fd is not preserved.<br>  * Returns NULL on error (check lto_get_error_message() for details).<br>+ *<br>+ * \since LTO_API_VERSION=5<br>  */<br> extern lto_module_t<br> lto_module_create_from_fd(int fd, const char *path, size_t file_size);<br>@@ -157,28 +187,34 @@ lto_module_create_from_fd(int fd, const<br> /**<br>  * Loads an object file from disk. The seek point of fd is not preserved.<br>  * Returns NULL on error (check lto_get_error_message() for details).<br>+ *<br>+ * \since LTO_API_VERSION=5<br>  */<br> extern lto_module_t<br> lto_module_create_from_fd_at_offset(int fd, const char *path, size_t file_size,<br>                                     size_t map_size, off_t offset);<br><br>-<br> /**<br>  * Frees all memory internally allocated by the module.<br>  * Upon return the lto_module_t is no longer valid.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern void<br> lto_module_dispose(lto_module_t mod);<br><br>-<br> /**<br>  * Returns triple string which the object module was compiled under.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern const char*<br> lto_module_get_target_triple(lto_module_t mod);<br><br> /**<br>  * Sets triple string with which the object will be codegened.<br>+ *<br>+ * \since LTO_API_VERSION=4<br>  */<br> extern void<br> lto_module_set_target_triple(lto_module_t mod, const char *triple);<br>@@ -186,6 +222,8 @@ lto_module_set_target_triple(lto_module_<br><br> /**<br>  * Returns the number of symbols in the object module.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern unsigned int<br> lto_module_get_num_symbols(lto_module_t mod);<br>@@ -193,6 +231,8 @@ lto_module_get_num_symbols(lto_module_t<br><br> /**<br>  * Returns the name of the ith symbol in the object module.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern const char*<br> lto_module_get_symbol_name(lto_module_t mod, unsigned int index);<br>@@ -200,12 +240,16 @@ lto_module_get_symbol_name(lto_module_t<br><br> /**<br>  * Returns the attributes of the ith symbol in the object module.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern lto_symbol_attributes<br> lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index);<br><br> /**<br>  * Diagnostic severity.<br>+ *<br>+ * \since LTO_API_VERSION=7<br>  */<br> typedef enum {<br>   LTO_DS_ERROR,<br>@@ -219,6 +263,8 @@ typedef enum {<br>  * \p diag is the actual diagnostic.<br>  * The diagnostic is not prefixed by any of severity keyword, e.g., 'error: '.<br>  * \p ctxt is used to pass the context set with the diagnostic handler.<br>+ *<br>+ * \since LTO_API_VERSION=7<br>  */<br> typedef void (*lto_diagnostic_handler_t)(<br>     lto_codegen_diagnostic_severity_t severity, const char *diag, void *ctxt);<br>@@ -227,6 +273,8 @@ typedef void (*lto_diagnostic_handler_t)<br>  * Set a diagnostic handler and the related context (void *).<br>  * This is more general than lto_get_error_message, as the diagnostic handler<br>  * can be called at anytime within lto.<br>+ *<br>+ * \since LTO_API_VERSION=7<br>  */<br> extern void lto_codegen_set_diagnostic_handler(lto_code_gen_t,<br>                                                lto_diagnostic_handler_t,<br>@@ -235,32 +283,35 @@ extern void lto_codegen_set_diagnostic_h<br> /**<br>  * Instantiates a code generator.<br>  * Returns NULL on error (check lto_get_error_message() for details).<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern lto_code_gen_t<br> lto_codegen_create(void);<br><br>-<br> /**<br>  * Frees all code generator and all memory it internally allocated.<br>  * Upon return the lto_code_gen_t is no longer valid.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern void<br> lto_codegen_dispose(lto_code_gen_t);<br><br>-<br>-<br> /**<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>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern lto_bool_t<br> lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod);<br><br>-<br>-<br> /**<br>  * Sets if debug info should be generated.<br>  * Returns true on error (check lto_get_error_message() for details).<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern lto_bool_t<br> lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model);<br>@@ -269,6 +320,8 @@ lto_codegen_set_debug_model(lto_code_gen<br> /**<br>  * Sets which PIC code model to generated.<br>  * Returns true on error (check lto_get_error_message() for details).<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern lto_bool_t<br> lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model);<br>@@ -276,6 +329,8 @@ lto_codegen_set_pic_model(lto_code_gen_t<br><br> /**<br>  * Sets the cpu to generate code for.<br>+ *<br>+ * \since LTO_API_VERSION=4<br>  */<br> extern void<br> lto_codegen_set_cpu(lto_code_gen_t cg, const char *cpu);<br>@@ -284,12 +339,16 @@ lto_codegen_set_cpu(lto_code_gen_t cg, c<br> /**<br>  * Sets the location of the assembler tool to run. If not set, libLTO<br>  * will use gcc to invoke the assembler.<br>+ *<br>+ * \since LTO_API_VERSION=3<br>  */<br> extern void<br> lto_codegen_set_assembler_path(lto_code_gen_t cg, const char* path);<br><br> /**<br>  * Sets extra arguments that libLTO should pass to the assembler.<br>+ *<br>+ * \since LTO_API_VERSION=4<br>  */<br> extern void<br> lto_codegen_set_assembler_args(lto_code_gen_t cg, const char **args,<br>@@ -298,6 +357,8 @@ lto_codegen_set_assembler_args(lto_code_<br> /**<br>  * Sets the strategy to use during internalize.  Default strategy is<br>  * LTO_INTERNALIZE_FULL.<br>+ *<br>+ * \since LTO_API_VERSION=6<br>  */<br> extern void<br> lto_codegen_set_internalize_strategy(lto_code_gen_t cg,<br>@@ -306,6 +367,8 @@ lto_codegen_set_internalize_strategy(lto<br> /**<br>  * Tells LTO optimization passes that this symbol must be preserved<br>  * because it is referenced by native code or a command line option.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern void<br> lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char* symbol);<br>@@ -314,6 +377,8 @@ lto_codegen_add_must_preserve_symbol(lto<br>  * Writes a new object file at the specified path that contains the<br>  * merged contents of all modules added so far.<br>  * Returns true on error (check lto_get_error_message() for details).<br>+ *<br>+ * \since LTO_API_VERSION=5<br>  */<br> extern lto_bool_t<br> lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path);<br>@@ -325,6 +390,8 @@ lto_codegen_write_merged_modules(lto_cod<br>  * lto_code_gen_t and will be freed when lto_codegen_dispose()<br>  * is called, or lto_codegen_compile() is called again.<br>  * On failure, returns NULL (check lto_get_error_message() for details).<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern const void*<br> lto_codegen_compile(lto_code_gen_t cg, size_t* length);<br>@@ -332,6 +399,8 @@ lto_codegen_compile(lto_code_gen_t cg, s<br> /**<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>+ * \since LTO_API_VERSION=5<br>  */<br> extern lto_bool_t<br> lto_codegen_compile_to_file(lto_code_gen_t cg, const char** name);<br>@@ -339,6 +408,8 @@ lto_codegen_compile_to_file(lto_code_gen<br><br> /**<br>  * Sets options to help debug codegen bugs.<br>+ *<br>+ * \since prior to LTO_API_VERSION=3<br>  */<br> extern void<br> lto_codegen_debug_options(lto_code_gen_t cg, const char *);<br>@@ -346,6 +417,8 @@ lto_codegen_debug_options(lto_code_gen_t<br> /**<br>  * Initializes LLVM disassemblers.<br>  * FIXME: This doesn't really belong here.<br>+ *<br>+ * \since LTO_API_VERSION=5<br>  */<br> extern void<br> lto_initialize_disassembler(void);<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote></div><br></div></body></html>