summaryrefslogtreecommitdiff
path: root/tools/lto/lto.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-01 21:22:36 +0000
committerOwen Anderson <resistor@mac.com>2009-07-01 21:22:36 +0000
commit31895e73591d3c9ceae731a1274c8f56194b9616 (patch)
tree9e5f714db4af7dddfab061cb0016489f6d114c56 /tools/lto/lto.cpp
parentfcd65ae28fe797c174be350a07955713fd42d110 (diff)
downloadllvm-31895e73591d3c9ceae731a1274c8f56194b9616.tar.gz
llvm-31895e73591d3c9ceae731a1274c8f56194b9616.tar.bz2
llvm-31895e73591d3c9ceae731a1274c8f56194b9616.tar.xz
Hold the LLVMContext by reference rather than by pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74640 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto/lto.cpp')
-rw-r--r--tools/lto/lto.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp
index c25f87c340..02034bbf84 100644
--- a/tools/lto/lto.cpp
+++ b/tools/lto/lto.cpp
@@ -88,7 +88,7 @@ bool lto_module_is_object_file_in_memory_for_target(const void* mem,
//
lto_module_t lto_module_create(const char* path, LLVMContextRef Ctxt)
{
- return LTOModule::makeLTOModule(path, llvm::unwrap(Ctxt),
+ return LTOModule::makeLTOModule(path, *llvm::unwrap(Ctxt),
sLastErrorString);
}
@@ -100,7 +100,7 @@ lto_module_t lto_module_create(const char* path, LLVMContextRef Ctxt)
lto_module_t lto_module_create_from_memory(const void* mem, size_t length,
LLVMContextRef Ctxt)
{
- return LTOModule::makeLTOModule(mem, length, llvm::unwrap(Ctxt),
+ return LTOModule::makeLTOModule(mem, length, *llvm::unwrap(Ctxt),
sLastErrorString);
}
@@ -158,9 +158,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()
+lto_code_gen_t lto_codegen_create(LLVMContextRef ContextRef)
{
- return new LTOCodeGenerator();
+ return new LTOCodeGenerator(*llvm::unwrap(ContextRef));
}
@@ -265,4 +265,4 @@ extern void
lto_codegen_debug_options(lto_code_gen_t cg, const char * opt)
{
cg->setCodeGenDebugOptions(opt);
-}
+} \ No newline at end of file