aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lto/lto.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-02 00:31:14 +0000
committerOwen Anderson <resistor@mac.com>2009-07-02 00:31:14 +0000
commit0e7a54672cf346ee7c4aae10822c74f7c74f3fed (patch)
tree69c161120ebf5ea3e8f5d7a20a26ca90cc78b193 /tools/lto/lto.cpp
parent6d8f1263f40e6b8fc2cd5cce3dfd9ce99fe09226 (diff)
downloadexternal_llvm-0e7a54672cf346ee7c4aae10822c74f7c74f3fed.zip
external_llvm-0e7a54672cf346ee7c4aae10822c74f7c74f3fed.tar.gz
external_llvm-0e7a54672cf346ee7c4aae10822c74f7c74f3fed.tar.bz2
Maintain the old LTO API, by using the global context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74678 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto/lto.cpp')
-rw-r--r--tools/lto/lto.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp
index 02034bb..6482798 100644
--- a/tools/lto/lto.cpp
+++ b/tools/lto/lto.cpp
@@ -86,10 +86,9 @@ bool lto_module_is_object_file_in_memory_for_target(const void* mem,
// loads an object file from disk
// returns NULL on error (check lto_get_error_message() for details)
//
-lto_module_t lto_module_create(const char* path, LLVMContextRef Ctxt)
+lto_module_t lto_module_create(const char* path)
{
- return LTOModule::makeLTOModule(path, *llvm::unwrap(Ctxt),
- sLastErrorString);
+ return LTOModule::makeLTOModule(path, sLastErrorString);
}
@@ -97,11 +96,9 @@ lto_module_t lto_module_create(const char* path, LLVMContextRef Ctxt)
// loads an object file from memory
// returns NULL on error (check lto_get_error_message() for details)
//
-lto_module_t lto_module_create_from_memory(const void* mem, size_t length,
- LLVMContextRef Ctxt)
+lto_module_t lto_module_create_from_memory(const void* mem, size_t length)
{
- return LTOModule::makeLTOModule(mem, length, *llvm::unwrap(Ctxt),
- sLastErrorString);
+ return LTOModule::makeLTOModule(mem, length, sLastErrorString);
}
@@ -158,9 +155,9 @@ lto_symbol_attributes lto_module_get_symbol_attribute(lto_module_t mod,
// instantiates a code generator
// returns NULL if there is an error
//
-lto_code_gen_t lto_codegen_create(LLVMContextRef ContextRef)
+lto_code_gen_t lto_codegen_create(void)
{
- return new LTOCodeGenerator(*llvm::unwrap(ContextRef));
+ return new LTOCodeGenerator();
}