Add support for global variables in an address space for llvm-c and ocaml.
[oota-llvm.git] / include / llvm-c / lto.h
index 508e871ec4cbfc3376a1f38bb73a270121d1e136..7cafcb29f219c84a20c309db9060790dd9279010 100644 (file)
@@ -19,6 +19,8 @@
 #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,    
@@ -30,9 +32,11 @@ typedef enum {
     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;
 
@@ -54,7 +58,6 @@ typedef struct LTOModule*         lto_module_t;
 /** opaque reference to a code generator */
 typedef struct LTOCodeGenerator*  lto_code_gen_t;
 
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -72,7 +75,6 @@ lto_get_version(void);
 extern const char*
 lto_get_error_message(void);
 
-
 /**
  * Checks if a file is a loadable object file.
  */
@@ -85,7 +87,7 @@ lto_module_is_object_file(const char* path);
  */
 extern bool
 lto_module_is_object_file_for_target(const char* path, 
-                                            const char* target_triple_prefix);
+                                     const char* target_triple_prefix);
 
 
 /**
@@ -197,6 +199,22 @@ extern bool
 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
@@ -227,6 +245,11 @@ extern const void*
 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