llvm-mirror/tools/lto
Petr Pavlu 324853823b [LTO] Fix error reporting from lto_module_create_in_local_context()
Function lto_module_create_in_local_context() would previously
rely on the default LLVMContext being created for it by
LTOModule::makeLTOModule(). This context exits the program on
error and is not arranged to update sLastStringError in
tools/lto/lto.cpp.

Function lto_module_create_in_local_context() now creates an
LLVMContext by itself, sets it up correctly to its needs and then
passes it to LTOModule::createInLocalContext() which takes
ownership of the context and keeps it present for the lifetime of
the returned LTOModule.

Function LTOModule::makeLTOModule() is modified to take a
reference to LLVMContext (instead of a pointer) and no longer
creates a default context when nullptr is passed to it. Method
LTOModule::createInContext() that takes a pointer to LLVMContext
is removed because it allows to pass a nullptr to it. Instead
LTOModule::createFromBuffer() (that takes a reference to
LLVMContext) should be used.

Differential Revision: http://reviews.llvm.org/D17715

llvm-svn: 262330
2016-03-01 13:13:49 +00:00
..
CMakeLists.txt [CMake] Assigning the LTO component to lto.h 2016-02-26 21:07:02 +00:00
lto.cpp [LTO] Fix error reporting from lto_module_create_in_local_context() 2016-03-01 13:13:49 +00:00
lto.exports lto: Clean up C libLTO interfaces pertaining to linker flags. 2015-06-29 23:09:12 +00:00
LTODisassembler.cpp libLTO: Add a utility method to initialize the disassemblers. 2012-11-24 16:59:10 +00:00