summaryrefslogtreecommitdiff
path: root/tools/lli/lli.cpp
Commit message (Collapse)AuthorAge
* Replace the interim lli build fix with something cleanerAlp Toker2014-01-23
| | | | | | | | | | Eliminates the LLI_BUILDING_CHILD build hack from r199885. Also add a FIXME to remove code that tricks the tests into passing when the feature fails to work. Please don't do stuff like this, the tests exist for a reason! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199929 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak r199835 to use can_execute() instead of exists()Alp Toker2014-01-22
| | | | | | | The execution code path crashes if it can't execute the binary so we might as well take precautions here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199844 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate inappropriate use of FindProgramByName() from lliAlp Toker2014-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199835 91177308-0d34-0410-b5e6-96231b3b80d8
* Change createObjectFile to return an ErrorOr.Rafael Espindola2014-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199776 91177308-0d34-0410-b5e6-96231b3b80d8
* Return an error_code from materializeAllPermanently.Rafael Espindola2014-01-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199275 91177308-0d34-0410-b5e6-96231b3b80d8
* Sanitize MCJIT remote executionRenato Golin2014-01-14
| | | | | | | | | | | | MCJIT remote execution (ChildTarget+RemoteTargetExternal) protocol was in dire need of refactoring. It was fail-prone, had no error reporting and implemented the same message logic on every single function. This patch rectifies it, and makes it work on ARM, where it was randomly failing. Other architectures shall profit from this change as well, making their buildbots and releases more reliable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199261 91177308-0d34-0410-b5e6-96231b3b80d8
* lli: Tweak CacheName not to contain DOS driveletter.NAKAMURA Takumi2014-01-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198929 91177308-0d34-0410-b5e6-96231b3b80d8
* lli: LLIObjectCache: Use llvm::sys::path to get dirname.NAKAMURA Takumi2014-01-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198928 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace.NAKAMURA Takumi2014-01-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198927 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix accidental use of the exotic "std::string::back()" method. Turns out it'sLang Hames2014-01-09
| | | | | | | | new in C++11. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198853 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an "-object-cache-dir=<string>" option to LLI. This option specifies theLang Hames2014-01-09
| | | | | | | | | | | | | root path to which object files managed by the LLIObjectCache instance should be written. This option defaults to "", in which case objects are cached in the same directory as the bitcode they are derived from. The load-object-a.ll test has been rewritten to use this option to support testing in environments where the test directory is not writable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198852 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace fstream use with raw_fd_ostream.Lang Hames2014-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198821 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r196639: Add support for archives and object file caching under MCJIT.Lang Hames2014-01-08
| | | | | | | | | | I believe the bot failures on linux systems were due to overestimating the alignment of object-files within archives, which are only guaranteed to be two-byte aligned. I have reduced the alignment in RuntimeDyldELF::createObjectImageFromFile accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198737 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace cleanups.NAKAMURA Takumi2013-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196654 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r196639 while I investigate a bot failure.Lang Hames2013-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196641 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for archives and object file caching under MCJIT.Lang Hames2013-12-07
| | | | | | | | Patch by Andy Kaylor, with minor edits to resolve merge conflicts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196639 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleaning up comments in lliAndrew Kaylor2013-10-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193571 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding a workaround for __main linking with remote lli and Cygwin/MinGWAndrew Kaylor2013-10-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193570 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the lli --extra-module value_descAlp Toker2013-10-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193552 91177308-0d34-0410-b5e6-96231b3b80d8
* Standardizing lli's extra module command line optionAndrew Kaylor2013-10-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193544 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing problems in lli's RemoteMemoryManager.Andrew Kaylor2013-10-11
| | | | | | | | | | This fixes a problem from a previous check-in where a return value was omitted. Previously the remote/stubs-remote.ll and remote/stubs-sm-pic.ll tests were reporting passes, but they should have been failing. Those tests attempt to link against an external symbol and remote symbol resolution is not supported. The old RemoteMemoryManager implementation resulted in local symbols being used for resolution and the child process crashed but the test didn't notice. With this check-in remote symbol resolution fails, and so the test (correctly) fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192514 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing unintended code block from lliAndrew Kaylor2013-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192205 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding support and tests for multiple module handling in lliAndrew Kaylor2013-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191938 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass the resolved lli-child-target executable name to execv, rather thanRichard Smith2013-10-02
| | | | | | | searching $PATH for it then blindly executing it from $PWD anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191856 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up lli execution codeAndrew Kaylor2013-10-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191845 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding out-of-process execution support to lli.Andrew Kaylor2013-10-02
| | | | | | | | | | | At this time only Unix-based systems are supported. Windows has stubs and should re-route to the simulated mode. Thanks to Sriram Murali for contributions to this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191843 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding multiple module support for MCJIT.Andrew Kaylor2013-10-01
| | | | | | | | | | Tests to follow. PIC with small code model and EH frame handling will not work with multiple modules. There are also some rough edges to be smoothed out for remote target support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191722 91177308-0d34-0410-b5e6-96231b3b80d8
* Add flag to lli to enable debugging of IR when used with MCJIT.Daniel Malea2013-06-28
| | | | | | | | | | | | | | | | | | | | - warn users when -debug-ir is used with old JIT engine (only partial debug info is available) For example, to debug an IR file with GDB (that supports JIT registration), do: $ gdb --args lli -use-mcjit -debug-ir testcase.ll (gdb) break main (gdb) run <Process continues to lli main> (gdb) continue <Process continues to testcase.ll main() (gdb) step <Now stepping through the LLVM IR in testcase.ll> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185197 91177308-0d34-0410-b5e6-96231b3b80d8
* Print uint64_t -debug text correctly on 32-bit hostsTim Northover2013-05-19
| | | | | | | | On 32-bit hosts %p can print garbage when given a uint64_t, we should use %llx instead. This only affects the output of the debugging text produced by lli. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182209 91177308-0d34-0410-b5e6-96231b3b80d8
* SectionMemoryManager shouldn't be a JITMemoryManager. Previously, the Filip Pizlo2013-05-14
| | | | | | | | | | | | | | | | | | | EngineBuilder interface required a JITMemoryManager even if it was being used to construct an MCJIT. But the MCJIT actually wants a RTDyldMemoryManager. Consequently, the SectionMemoryManager, which is meant for MCJIT, derived from the JITMemoryManager and then stubbed out a bunch of JITMemoryManager methods that weren't relevant to the MCJIT. This patch fixes the situation: it teaches the EngineBuilder that RTDyldMemoryManager is a supertype of JITMemoryManager, and that it's appropriate to pass a RTDyldMemoryManager instead of a JITMemoryManager if we're using the MCJIT. This allows us to remove the stub methods from SectionMemoryManager, and make SectionMemoryManager a direct subtype of RTDyldMemoryManager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181820 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove exception handling support from the old JIT.Rafael Espindola2013-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181354 91177308-0d34-0410-b5e6-96231b3b80d8
* Split out the IRReader header and the utility functions it provides intoChandler Carruth2013-03-26
| | | | | | | | | | | | | | | | | | | | | | | | its own library. These functions are bridging between the bitcode reader and the ll parser which are in different libraries. Previously we didn't have any good library to do this, and instead played fast and loose with a "header only" set of interfaces in the Support library. This really doesn't work well as evidenced by the recent attempt to add timing logic to the these routines. As part of this, make them normal functions rather than weird inline functions, and sink the implementation into the library. Also clean up the header to be nice and minimal. This requires updating lots of build system dependencies to specify that the IRReader library is needed, and several source files to not implicitly rely upon the header file to transitively include all manner of other headers. If you are using IRReader.h, this commit will break you (the header moved) and you'll need to also update your library usage to include 'irreader'. I will commit the corresponding change to Clang momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177971 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for tools/...Chandler Carruth2012-12-04
| | | | | | | | Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169252 91177308-0d34-0410-b5e6-96231b3b80d8
* Modifying lli to use the SectionMemoryManager.Andrew Kaylor2012-11-27
| | | | | | The functionality of SectionMemoryManager is equivalent to the LLIMCJITMemoryManager being replaced except that it allocates memory as RW and later changes it to RX or R as needed. The page permissions are set in the call to MCJIT::finalizeObject. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168722 91177308-0d34-0410-b5e6-96231b3b80d8
* Interface changes to allow RuntimeDyld memory managers to set memory ↵Andrew Kaylor2012-11-15
| | | | | | permissions after an object has been loaded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168114 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a method to indicate section address re-assignment is finished.Andrew Kaylor2012-11-05
| | | | | | Prior to this patch RuntimeDyld attempted to re-apply relocations every time reassignSectionAddress was called (via MCJIT::mapSectionAddress). In addition to being inefficient and redundant, this led to a problem when a section was temporarily moved too far away from another section with a relative relocation referencing the section being moved. To fix this, I'm adding a new method (finalizeObject) which the client can call to indicate that it is finished rearranging section addresses so the relocations can safely be applied. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167400 91177308-0d34-0410-b5e6-96231b3b80d8
* lli: Initialize the native asm parser for inline assembly.Jim Grosbach2012-11-05
| | | | | | | MCJIT supports inline assembly, but requires the asm parser to do so. Make sure to link it in and initialize it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167392 91177308-0d34-0410-b5e6-96231b3b80d8
* Streamlined memory manager hierarchy for MCJIT and RuntimeDyld.Andrew Kaylor2012-11-01
| | | | | | Patch by Ashok Thirumurthi git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167192 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed format strings to avoid pointer truncation during 64-bit debugging.Andrew Kaylor2012-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167185 91177308-0d34-0410-b5e6-96231b3b80d8
* Align the data section correctly when loading an ELF file.Tim Northover2012-10-29
| | | | | | Patch by Amara Emerson. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166920 91177308-0d34-0410-b5e6-96231b3b80d8
* Add float-abi and softfloat options to lliTim Northover2012-10-12
| | | | | | Patch by Amara Emerson. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165791 91177308-0d34-0410-b5e6-96231b3b80d8
* lli: [MCJIT] Suppress "__main" for cygming in ↵NAKAMURA Takumi2012-10-05
| | | | | | | | LLIMCJITMemoryManager::getPointerToNamedFunction(), like legacy JITMemoryManager's. CRT's __main (aka premain) invokes global ctors on cygming. See also PR3897. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165312 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure lli compiles all code before invalidating instruction caches.Tim Northover2012-09-20
| | | | | | Patch from Amara Emerson. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164296 91177308-0d34-0410-b5e6-96231b3b80d8
* MCJIT: Add faux remote target execution to lli for the MCJIT.Jim Grosbach2012-09-05
| | | | | | | | | | | | Simulate a remote target address space by allocating a seperate chunk of memory for the target and re-mapping section addresses to that prior to execution. Later we'll want to have a truly remote process, but for now this gets us closer to being able to test the remote target functionality outside LLDB. rdar://12157052 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163216 91177308-0d34-0410-b5e6-96231b3b80d8
* LLI: move instruction cache tweaks.Jim Grosbach2012-08-28
| | | | | | | | Invalidate the instruction cache right before we start actually executing code, otherwise we can miss some that came later. This is still not quite right for a truly lazilly compiled environment, but it's closer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162803 91177308-0d34-0410-b5e6-96231b3b80d8
* Plug a leak when using MCJIT.Benjamin Kramer2012-05-20
| | | | | | Found by valgrind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157160 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove extra semicolons.Benjamin Kramer2012-05-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157118 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLIMCJITMemoryManager to the lli. This manager will be used for MCJIT ↵Danil Malyshev2012-05-16
| | | | | | | | instead of DefaultJIMMemoryManager. It's more flexible for MCJIT tasks, in addition it's provides a invalidation instruction cache for code sections which will be used before JIT code will be executed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156933 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove redundant line (the memory manager is set above to the same objectEli Bendersky2012-04-29
| | | | | | | | | if !ForceInterpreteri). It has no effect (apart from a memory leak...) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155792 91177308-0d34-0410-b5e6-96231b3b80d8