summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
* [mips][mcjit] Calculate correct addend for HI16 and PCHI16 relocPetar Jovanovic2015-08-133-9/+65
| | | | | | | | | | | Previously, for O32 ABI we did not calculate correct addend for R_MIPS_HI16 and R_MIPS_PCHI16 relocations. This patch fixes that. Patch by Vladimir Radosavljevic. Differential Revision: http://reviews.llvm.org/D11186 llvm-svn: 244897
* [RuntimeDyld][AArch64] Add explicit addends before calling relocationValueRef.Lang Hames2015-08-111-5/+4
| | | | | | relocationValueRef uses the addend, so it has to be set before the call. llvm-svn: 244574
* Fix some comment typos.Benjamin Kramer2015-08-081-2/+2
| | | | llvm-svn: 244402
* Convert getSymbolSection to return an ErrorOr.Rafael Espindola2015-08-073-8/+8
| | | | | | | This function can actually fail since the symbol contains an index to the section and that can be invalid. llvm-svn: 244375
* -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are ↵David Blaikie2015-08-053-3/+3
| | | | | | | | | | | deprecated in C++11 LoadedObjectInfo was depending on the implicit copy ctor in the presence of a user-declared dtor. Default (and protect) it in the base class and make the devired classes final to avoid any risk of a public API that would enable slicing. llvm-svn: 244112
* Rename all references to old mailing lists to new lists.llvm.org address.Tanya Lattner2015-08-051-1/+1
| | | | llvm-svn: 243999
* [RuntimeDyld] Adapt PPC64 relocations to PPC32Hal Finkel2015-08-042-0/+26
| | | | | | | | | Begin adapting some of the implemented PPC64 relocations for PPC32 (with a test case). Patch by Pierre-Andre Saulais! llvm-svn: 243991
* -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are ↵David Blaikie2015-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | deprecated in C++11 Various value handles needed to be copy constructible and copy assignable (mostly for their use in DenseMap). But to avoid an API that might allow accidental slicing, make these members protected in the base class and make derived classes final (the special members become implicitly public there - but disallowing further derived classes that might be sliced to the intermediate type). Might be worth having a warning a bit like -Wnon-virtual-dtor that catches public move/copy assign/ctors in classes with virtual functions. (suppressable in the same way - by making them protected in the base, and making the derived classes final) Could be fancier and only diagnose them when they're actually called, potentially. Also allow a few default implementations where custom implementations (especially with non-standard return types) were implemented. llvm-svn: 243909
* De-constify pointers to Type since they can't be modified. NFCCraig Topper2015-08-012-24/+24
| | | | | | This was already done in most places a while ago. This just fixes the ones that crept in over time. llvm-svn: 243842
* [MCJIT] Fix PR20656 by teaching MCJIT to honor ExecutionEngine's global mapping.Lang Hames2015-07-292-2/+15
| | | | | | | This is important for users of the C API who can't supply custom symbol resolvers yet. llvm-svn: 243589
* [RuntimeDyld] Make LoadedObjectInfo::getLoadedSectionAddress take a SectionRefLang Hames2015-07-285-38/+40
| | | | | | rather than a string section name. llvm-svn: 243456
* Fix ODR violation. NFC.Diego Novillo2015-07-271-1/+1
| | | | | | | | There is an ODR conflict between lib/ExecutionEngine/ExecutionEngineBindings.cpp and lib/Target/TargetMachineC.cpp. The inline definitions should simply be marked static (thanks dblaikie for the hint). llvm-svn: 243298
* [RuntimeDyld] MachO: Add support for ARM scattered vanilla relocations.Lang Hames2015-07-244-38/+46
| | | | llvm-svn: 243126
* Remove access to the DataLayout in the TargetMachineMehdi Amini2015-07-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Replace getDataLayout() with a createDataLayout() method to make explicit that it is intended to create a DataLayout only and not accessing it for other purpose. This change is the last of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: jholewinski, llvm-commits, rafael, yaron.keren Differential Revision: http://reviews.llvm.org/D11103 (cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea) From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243114
* Revert "Remove access to the DataLayout in the TargetMachine"Mehdi Amini2015-07-242-2/+2
| | | | | | | | | | This reverts commit 0f720d984f419c747709462f7476dff962c0bc41. It breaks clang too badly, I need to prepare a proper patch for clang first. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243089
* Remove access to the DataLayout in the TargetMachineMehdi Amini2015-07-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Replace getDataLayout() with a createDataLayout() method to make explicit that it is intended to create a DataLayout only and not accessing it for other purpose. This change is the last of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: jholewinski, llvm-commits, rafael, yaron.keren Differential Revision: http://reviews.llvm.org/D11103 (cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea) From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243083
* Fix -Wextra-semi warnings.Hans Wennborg2015-07-221-1/+1
| | | | | | | | Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D11400 llvm-svn: 242930
* Fix ffiInvoke() use of DataLayout, broken in 242414Mehdi Amini2015-07-161-3/+3
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 242456
* Make ExecutionEngine owning a DataLayoutMehdi Amini2015-07-168-50/+62
| | | | | | | | | | | | | | | | | | | | Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. The ExecutionEngine will act as an exception and will be unsafe to be reused across context. We don't enforce this rule but undefined behavior can occurs if the user tries to do it. Reviewers: lhames Subscribers: echristo, llvm-commits, rafael, yaron.keren Differential Revision: http://reviews.llvm.org/D11110 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 242414
* Revert "Make ExecutionEngine owning a DataLayout"Michael Kuperstein2015-07-168-52/+49
| | | | | | | | Reverting to fix buildbot breakage. This reverts commit r242387. llvm-svn: 242394
* Make ExecutionEngine owning a DataLayoutMehdi Amini2015-07-168-49/+52
| | | | | | | | | | | | | | | | | | | | Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. The ExecutionEngine will act as an exception and will be unsafe to be reused across context. We don't enforce this rule but undefined behavior can occurs if the user tries to do it. Reviewers: lhames Subscribers: echristo, llvm-commits, rafael, yaron.keren Differential Revision: http://reviews.llvm.org/D11110 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 242387
* Fix the -DBUILD_SHARED_LIBS=ON build.Rafael Espindola2015-07-073-2/+5
| | | | llvm-svn: 241608
* Simplify by passing in the section of the symbol. NFC.Rafael Espindola2015-07-071-22/+5
| | | | llvm-svn: 241603
* Remove getRelocationAddress.Rafael Espindola2015-07-066-16/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally added in r139314. Back then it didn't actually get the address, it got whatever value the relocation used: address or offset. The values in different object formats are: * MachO: Always an offset. * COFF: Always an address, but when talking about the virtual address of sections it says: "for simplicity, compilers should set this to zero". * ELF: An offset for .o files and and address for .so files. In the case of the .so, the relocation in not linked to any section (sh_info is 0). We can't really compute an offset. Some API mappings would be: * Use getAddress for everything. It would be quite cumbersome. To compute the address elf has to follow sh_info, which can be corrupted and therefore the method has to return an ErrorOr. The address of the section is also the same for every relocation in a section, so we shouldn't have to check the error and fetch the value for every relocation. * Use a getValue and make it up to the user to know what it is getting. * Use a getOffset and: * Assert for dynamic ELF objects. That is a very peculiar case and it is probably fair to ask any tool that wants to support it to use ELF.h. The only tool we have that reads those (llvm-readobj) already does that. The only other use case I can think of is a dynamic linker. * Check that COFF .obj files have sections with zero virtual address spaces. If it turns out that some assembler/compiler produces these, we can change COFFObjectFile::getRelocationOffset to subtract it. Given COFF format, this can be done without the need for ErrorOr. The getRelocationAddress method was never implemented for COFF. It also had exactly one use in a very peculiar case: a shortcut for adding the section value to a pcrel reloc on MachO. Given that, I don't expect that there is any use out there of the C API. If that is not the case, let me know and I will add it back with the implementation inlined and do a proper deprecation. llvm-svn: 241450
* [Mips] Add support for MCJIT for MIPS32r6Petar Jovanovic2015-07-061-3/+58
| | | | | | | | | | Add support for resolving MIPS32r6 relocations in MCJIT. Patch by Vladimir Radosavljevic. Differential Revision: http://reviews.llvm.org/D10687 llvm-svn: 241442
* [RuntimeDyld] Skip relocations for external symbols with 64-bit address ~0ULL.Lang Hames2015-07-042-7/+13
| | | | | | | | | | | Requested by Eugene Rozenfeld of the LLILC team, this feature allows JIT clients to skip relocations for selected external symbols by returning ~0ULL from their symbol resolver. If this value is returned for a given symbol, RuntimeDyld will skip all relocations for that symbol. The client will be responsible for applying the skipped relocations manually before the code is executed. llvm-svn: 241383
* Use a continue to reduce indentation.Rafael Espindola2015-07-031-19/+20
| | | | llvm-svn: 241375
* Use a continue to reduce indentation.Rafael Espindola2015-07-031-51/+52
| | | | llvm-svn: 241374
* Context is allocated just a few lines above. Don't check if it is null.Rafael Espindola2015-07-031-32/+26
| | | | llvm-svn: 241373
* Fix build with -DLLVM_USE_INTEL_JITEVENTS=ON -DLLVM_USE_OPROFILE=ON.Rafael Espindola2015-07-032-8/+13
| | | | | | Is anyone using those? llvm-svn: 241372
* Return ErrorOr from getSymbolAddress.Rafael Espindola2015-07-031-2/+3
| | | | | | | It can fail trying to get the section on ELF and COFF. This makes sure the error is handled. llvm-svn: 241366
* Try to fix the build of IntelJITEventListener.Rafael Espindola2015-07-021-7/+6
| | | | llvm-svn: 241301
* Return ErrorOr from SymbolRef::getName.Rafael Espindola2015-07-025-17/+31
| | | | | | | | | | | | This function can really fail since the string table offset can be out of bounds. Using ErrorOr makes sure the error is checked. Hopefully a lot of the boilerplate code in tools/* can go away once we have a diagnostic manager in Object. llvm-svn: 241297
* Use ErrorOr in getRelocationAdress.Rafael Espindola2015-06-301-3/+2
| | | | | | | We can probably do better in this method, but this is an improvement and enables further ErrorOr cleanups. llvm-svn: 241114
* Don't return error_code from a function that doesn't fail.Rafael Espindola2015-06-302-8/+4
| | | | llvm-svn: 241033
* Cleanup getRelocationAddend.Rafael Espindola2015-06-301-7/+5
| | | | | | | | | | | Realistically, this will be returning ErrorOr for some time as refactoring the user code to check once per section will take some time. Given that, use it for checking if a relocation has addend or not. While at it, add ELFRelocationRef to simplify the users. llvm-svn: 241028
* Don't return error_code from function that never fails.Rafael Espindola2015-06-295-14/+7
| | | | llvm-svn: 241021
* Upgrade JIT listeners for changes in the libObject API.Benjamin Kramer2015-06-292-22/+19
| | | | llvm-svn: 240956
* Expose getFlags via ELFSectionRef.Rafael Espindola2015-06-261-7/+7
| | | | llvm-svn: 240779
* Add a ELFSectionRef class and use it to expose getSectionType.Rafael Espindola2015-06-261-3/+3
| | | | llvm-svn: 240778
* Simplify getSymbolType.Rafael Espindola2015-06-262-3/+2
| | | | | | | | This is still a really odd function. Most calls are in object format specific contexts and should probably be replaced with a more direct query, but at least now this is not too obnoxious to use. llvm-svn: 240777
* Make getOther ELF only.Rafael Espindola2015-06-261-3/+2
| | | | | | No other format has this field. llvm-svn: 240774
* Use Symbol.getValue to simplify RuntimeDyldCOFF::getSymbolOffset. NFC.Rafael Espindola2015-06-241-17/+2
| | | | llvm-svn: 240572
* Change how symbol sizes are handled in lib/Object.Rafael Espindola2015-06-242-11/+11
| | | | | | | | | | | | | | COFF and MachO only define symbol sizes for common symbols. Reflect that in the class hierarchy by having a method for common symbols only in the base and a general one in ELF. This avoids the need of using a magic value for the size, which had a few problems * Most callers didn't check for it. * The ones that did could not tell the magic value from a file actually having that value. llvm-svn: 240529
* Be sure to set the DataLayout before checking the cache.Rafael Espindola2015-06-231-2/+2
| | | | | | | | This makes sure the same mangling is used. Should fix the OS X bots. llvm-svn: 240411
* Simplify the Mangler interface now that DataLayout is mandatory.Rafael Espindola2015-06-233-7/+5
| | | | | | | We only need to pass in a DataLayout when mangling a raw string, not when constructing the mangler. llvm-svn: 240405
* [mips64] Emit correct addend for some PC-relative relocationsPetar Jovanovic2015-06-231-1/+1
| | | | | | | | | | | So far, LLVM has not emitted correct addend for N64 and N32 ABI. This patch fixes that. It also removes fixup from MCJIT for R_MIPS_PC16 relocation. Patch by Vladimir Radosavljevic. Differential Revision: http://reviews.llvm.org/D10565 llvm-svn: 240404
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-2310-10/+10
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fix line endings (NFC)Joseph Tremoulet2015-06-222-40/+40
| | | | | | | I inadvertently checked these in with Windows-style line endings in r240288. llvm-svn: 240340
* [ORC] Add NullResolverJoseph Tremoulet2015-06-222-12/+40
| | | | | | | | | | | | | | | | | Summary: This is an implementation of RuntimeDyld::SymbolResolver that simply rejects all resolution requests; useful for clients that do not have any cross-object symbol references. Reviewers: lhames Reviewed By: lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10455 llvm-svn: 240288
OpenPOWER on IntegriCloud