#include <stdbool.h>
#include <stddef.h>
+#define LTO_API_VERSION 3
+
typedef enum {
LTO_SYMBOL_ALIGNMENT_MASK = 0x0000001F, /* log2 of alignment */
LTO_SYMBOL_PERMISSIONS_MASK = 0x000000E0,
LTO_SYMBOL_DEFINITION_TENTATIVE = 0x00000200,
LTO_SYMBOL_DEFINITION_WEAK = 0x00000300,
LTO_SYMBOL_DEFINITION_UNDEFINED = 0x00000400,
- LTO_SYMBOL_SCOPE_MASK = 0x00001800,
+ LTO_SYMBOL_DEFINITION_WEAKUNDEF = 0x00000500,
+ LTO_SYMBOL_SCOPE_MASK = 0x00003800,
LTO_SYMBOL_SCOPE_INTERNAL = 0x00000800,
LTO_SYMBOL_SCOPE_HIDDEN = 0x00001000,
+ LTO_SYMBOL_SCOPE_PROTECTED = 0x00002000,
LTO_SYMBOL_SCOPE_DEFAULT = 0x00001800
} lto_symbol_attributes;
/** opaque reference to a code generator */
typedef struct LTOCodeGenerator* lto_code_gen_t;
-
#ifdef __cplusplus
extern "C" {
#endif
extern const char*
lto_get_error_message(void);
-
/**
* Checks if a file is a loadable object file.
*/
*/
extern bool
lto_module_is_object_file_for_target(const char* path,
- const char* target_triple_prefix);
+ const char* target_triple_prefix);
/**
lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model);
+/**
+ * Sets the location of the "gcc" to run. If not set, libLTO will search for
+ * "gcc" on the path.
+ */
+extern void
+lto_codegen_set_gcc_path(lto_code_gen_t cg, const char* path);
+
+
+/**
+ * Sets the location of the assembler tool to run. If not set, libLTO
+ * will use gcc to invoke the assembler.
+ */
+extern void
+lto_codegen_set_assembler_path(lto_code_gen_t cg, const char* path);
+
+
/**
* Adds to a list of all global symbols that must exist in the final
* generated code. If a function is not listed, it might be
lto_codegen_compile(lto_code_gen_t cg, size_t* length);
+/**
+ * Sets options to help debug codegen bugs.
+ */
+extern void
+lto_codegen_debug_options(lto_code_gen_t cg, const char *);
#ifdef __cplusplus
}
#endif