summaryrefslogtreecommitdiff
path: root/tools/lli
AgeCommit message (Collapse)AuthorFilesLines
2014-12-12Silence gcc 4.9.1 warning 'xyz' is used uninitialized in this function.Yaron Keren1-7/+7
In release builds this is actually possible as without asserts there is no testing of the actual read bytes and the variables could be partially uninitialized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224114 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03[MCJIT] Unique-ptrify the RTDyldMemoryManager member of MCJIT. NFC.Lang Hames1-1/+5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223183 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-29DebugIR: Delete -debug-irDuncan P. N. Exon Smith1-9/+0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222945 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-26[MCJIT] Reapply r222828 and r222810-r222812 with fix for MSVC move-op issues.Lang Hames2-3/+3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222840 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-26Reverting r222828 and r222810-r222812 as they broke the build on Windows.Aaron Ballman2-3/+3
http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/11753 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222833 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-26[MCJIT] Clean up RuntimeDyld's quirky object-ownership/modification scheme.Lang Hames2-3/+3
Previously, when loading an object file, RuntimeDyld (1) took ownership of the ObjectFile instance (and associated MemoryBuffer), (2) potentially modified the object in-place, and (3) returned an ObjectImage that managed ownership of the now-modified object and provided some convenience methods. This scheme accreted over several years as features were tacked on to RuntimeDyld, and was both unintuitive and unsafe (See e.g. http://llvm.org/PR20722). This patch fixes the issue by removing all ownership and in-place modification of object files from RuntimeDyld. Existing behavior, including debugger registration, is preserved. Noteworthy changes include: (1) ObjectFile instances are now passed to RuntimeDyld by const-ref. (2) The ObjectImage and ObjectBuffer classes have been removed entirely, they existed to model ownership within RuntimeDyld, and so are no longer needed. (3) RuntimeDyld::loadObject now returns an instance of a new class, RuntimeDyld::LoadedObjectInfo, which can be used to construct a modified object suitable for registration with the debugger, following the existing debugger registration scheme. (4) The JITRegistrar class has been removed, and the GDBRegistrar class has been re-written as a JITEventListener. This should fix http://llvm.org/PR20722 . git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222810 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-23[MCJIT] Remove a few more references to JITMemoryManager that survived r218316.Lang Hames1-1/+0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218318 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-23[MCJIT] Delete the JTIMemoryManager and associated APIs.Lang Hames3-58/+6
This patch removes the old JIT memory manager (which does not provide any useful functionality now that the old JIT is gone), and migrates the few remaining clients over to SectionMemoryManager. http://llvm.org/PR20848 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218316 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02Reinstate "Nuke the old JIT."Eric Christopher4-37/+10
Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reinstates commits r215111, 215115, 215116, 215117, 215136. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216982 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27Return a std::unique_ptr when creating a new MemoryBuffer.Rafael Espindola1-2/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216583 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26Give ExecutionEngine of top level buffers.Rafael Espindola1-3/+1
Long term the idea if for the engine to not own the buffers, but for now this is consistent with the rest of the API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216484 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26Return a std::unique_ptr from the IRReader.h functions. NFC.Rafael Espindola1-2/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216466 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25Modernize raw_fd_ostream's constructor a bit.Rafael Espindola1-2/+2
Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error. A create static method would be even better, but this patch is already a bit too big. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216393 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-20Quick fix for an use after free.Rafael Espindola1-1/+4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216071 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19Don't own the buffer in object::Binary.Rafael Espindola1-8/+13
Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too. Keeping this ownership would make supporting IR inside native objects particularly painful. This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer. This patch introduces a few new types. * MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer. The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216002 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19Make it explicit that ExecutionEngine takes ownership of the modules.Rafael Espindola1-8/+9
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215967 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-13Simplify ownership with std::unique_ptr. NFC.Rafael Espindola1-2/+3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215566 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-13Canonicalize header guards into a common format.Benjamin Kramer5-12/+12
Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215558 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07Temporarily Revert "Nuke the old JIT." as it's not quite ready toEric Christopher4-10/+37
be deleted. This will be reapplied as soon as possible and before the 3.6 branch date at any rate. Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reverts commits r215111, 215115, 215116, 215117, 215136. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215154 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07fix configure+make buildRafael Espindola1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215116 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07Nuke the old JIT.Rafael Espindola3-36/+9
I am sure we will be finding bits and pieces of dead code for years to come, but this is a good start. Thanks to Lang Hames for making MCJIT a good replacement! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215111 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01Use object::Archive::create instead of new object::Archive.Rafael Espindola1-7/+6
Also fix the error handling. No testcaes, issue found by inspection. Thanks to David Blaikie for the suggestion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214535 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01Replace comment about ownership with std::unique_ptr.Rafael Espindola1-3/+5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214533 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31Use std::unique_ptr to make the ownership explicit.Rafael Espindola1-2/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214377 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-14[CMake] Update libdeps.NAKAMURA Takumi1-0/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212920 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-06Update the MemoryBuffer API to use ErrorOr.Rafael Espindola1-9/+9
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212405 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-24Pass a unique_ptr<MemoryBuffer> to the constructors in the Binary hierarchy.Rafael Espindola1-1/+1
Once the objects are constructed, they own the buffer. Passing a unique_ptr makes that clear. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211595 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-13Remove 'using std::error_code' from tools.Rafael Espindola2-5/+3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210876 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-12Don't use 'using std::error_code' in include/llvm.Rafael Espindola2-0/+2
This should make sure that most new uses use the std prefix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210835 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-29PR19553: Memory leak in RuntimeDyldELF::createObjectImageFromFileDavid Blaikie1-1/+1
This starts in MCJIT::getSymbolAddress where the unique_ptr<object::Binary> is release()d and (after a cast) passed to a single caller, MCJIT::addObjectFile. addObjectFile calls RuntimeDyld::loadObject. RuntimeDld::loadObject calls RuntimeDyldELF::createObjectFromFile And the pointer is never owned at this point. I say this point, because the alternative codepath, RuntimeDyldMachO::createObjectFile certainly does take ownership, so this seemed like a good hint that this was a/the right place to take ownership. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207580 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28[C++] Use 'nullptr'.Craig Topper2-3/+3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207394 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25[C++] Use 'nullptr'. Tools edition.Craig Topper3-13/+13
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207176 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-22[Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2-2/+4
definition below all of the header #include lines, tools edition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206848 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-21[Modules] Make Support/Debug.h modular. This requires it to not changeChandler Carruth1-0/+2
behavior based on other files defining DEBUG_TYPE, which means it cannot define DEBUG_TYPE at all. This is actually better IMO as it forces folks to define relevant DEBUG_TYPEs for their files. However, it requires all files that currently use DEBUG(...) to define a DEBUG_TYPE if they don't already. I've updated all such files in LLVM and will do the same for other upstream projects. This still leaves one important change in how LLVM uses the DEBUG_TYPE macro going forward: we need to only define the macro *after* header files have been #include-ed. Previously, this wasn't possible because Debug.h required the macro to be pre-defined. This commit removes that. By defining DEBUG_TYPE after the includes two things are fixed: - Header files that need to provide a DEBUG_TYPE for some inline code can do so by defining the macro before their inline code and undef-ing it afterward so the macro does not escape. - We no longer have rampant ODR violations due to including headers with different DEBUG_TYPE definitions. This may be mostly an academic violation today, but with modules these types of violations are easy to check for and potentially very relevant. Where necessary to suppor headers with DEBUG_TYPE, I have moved the definitions below the includes in this commit. I plan to move the rest of the DEBUG_TYPE macros in LLVM in subsequent commits; this one is big enough. The comments in Debug.h, which were hilariously out of date already, have been updated to reflect the recommended practice going forward. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206822 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-08[C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper3-29/+31
class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203345 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-06Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles1-3/+3
This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203083 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05[C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202957 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04[cleanup] Re-sort all the includes with utils/sort_includes.py.Chandler Carruth2-2/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202811 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-24Replace the F_Binary flag with a F_Text one.Rafael Espindola1-1/+1
After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202052 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-28[CMake] Put lli-child-target into the Folder "Misc".NAKAMURA Takumi1-0/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200297 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-24Fix known typosAlp Toker3-3/+3
Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200018 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-24Report lli remote IO errors consistentlyAlp Toker5-41/+30
This enables IO error reports in both the child and server processes. The scheme still isn't entirely satisfactory and output is jumbled but it beats having no output at all. This will hopefully unblock ARM support (PR18057). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200017 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-23lli: Factor portable messaging into a new RPCChannel facilityAlp Toker9-168/+151
The client and server now use a single unified low-level RPC core built around LLVM's existing cross-platform abstractions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199947 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-23Remove unused include following r199929Alp Toker1-1/+0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199930 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-23Replace the interim lli build fix with something cleanerAlp Toker5-45/+15
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
2014-01-23Windows/ChildTarget.inc: LLIChildTarget::allocate() has gone since r199881.NAKAMURA Takumi1-4/+0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199889 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-23Interim build fix for MakefilesAlp Toker3-2/+8
Looks like some parts still need detangling. Let's see if this holds for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199885 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-23Prospective Makefile build fixAlp Toker1-0/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199882 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-23Refactor lli-child-target to remove duplicated codeAlp Toker6-174/+32
Eliminate the copies LLVM's System mmap and cache invalidation code. These were slowly drifting away from the original version, and moreover the copied code was a dead end in terms of portability. We now statically link to Support but in practice with stripping this adds next to no weight to the resultant binary. Also avoid installing lli-child-target to the user's $PATH. It's not meant to be run directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199881 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-22Tweak r199835 to use can_execute() instead of exists()Alp Toker1-2/+3
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