summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [MCJIT] Add a FindGlobalVariableNamed utilityKeno Fischer2015-06-203-2/+45
| | | | | | | | | | | | | | | | Summary: This adds FindGlobalVariableNamed to ExecutionEngine (plus implementation in MCJIT), which is an analog of FindFunctionNamed for GlobalVariables. Reviewers: lhames Reviewed By: lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10421 llvm-svn: 240202
* Improve error handling of getRelocationAddend.Rafael Espindola2015-06-192-12/+14
| | | | | | | | | | | | | | | | | | This patch changes getRelocationAddend to use ErrorOr and considers it an error to try to get the addend of a REL section. If, for example, a x86_64 file has a REL section, that file is corrupted and we should reject it. Using ErrorOr is not ideal since we check the section type once per relocation instead of once per section. Checking once per section would involve getRelocationAddend just asserting and callers checking the section before iterating over the relocations. In any case, this is an improvement and includes a test. llvm-svn: 240176
* Avoid warning about inability to cast from ptr-to-obj to ptr-to-fun.Douglas Katzman2015-06-191-10/+10
| | | | | | Use POSIX.1-2003 Technical Corrigendum 1 suggested workaround. llvm-svn: 240140
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-1910-10/+10
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* modules: Add explicit dependency on intrinsics_genDuncan P. N. Exon Smith2015-06-164-0/+12
| | | | | | | | | `LLVM_ENABLE_MODULES` builds sometimes fail because `Intrinsics.td` needs to regenerate `Instrinsics.h` before anyone can include anything from the LLVM_IR module. Represent the dependency explicitly to prevent that. llvm-svn: 239796
* [ExecutionEngine] ArrayRefize argument passing.Benjamin Kramer2015-06-139-50/+33
| | | | | | No functionality change intended. llvm-svn: 239687
* [Orc] Fix a bug in the CompileOnDemand layer where stub decls were not clonedLang Hames2015-06-121-2/+0
| | | | | | | | | | | into partitions. Also, add an option to clone stub definitions (not just decls) into partitions: these definitions could be inlined in some places to avoid the overhead of calling via the stub. Found by inspection - no test case yet, although I plan to add a unit test for this once the CompileOnDemand layer refactoring settles down. llvm-svn: 239640
* fix crashAlexei Starovoitov2015-06-101-1/+2
| | | | | | | | | fix segfault by checking for UnknownArch, since getArchTypePrefix() will return nullptr for UnknownArch. This fixes regression caused by r238424. llvm-svn: 239456
* Remove object_error::success and use std::error_code() insteadRui Ueyama2015-06-091-3/+3
| | | | | | | | | | | | make_error_code(object_error) is slow because object::object_category() uses a ManagedStatic variable. But the real problem is that the function is called too frequently. This patch uses std::error_code() instead of object_error::success. In most cases, we return "success", so this patch reduces number of function calls to that function. http://reviews.llvm.org/D10333 llvm-svn: 239409
* [Mips64][mcjit] Add R_MIPS_PC32 relocationPetar Jovanovic2015-06-081-0/+5
| | | | | | | | | | This patch adds R_MIPS_PC32 relocation for Mips64. Patch by Vladimir Radosavljevic. Differential Revision: http://reviews.llvm.org/D10235 llvm-svn: 239301
* Re-commit r238838, r238844 with fix for host/target endian mismatch and ↵Daniel Sanders2015-06-031-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | windows buildbot. The windows buildbot originally failed because the check expressions are evaluated as 64-bit values, even for 32-bit symbols. Fixed this by comparing bottom 32-bits of the expressions. The host/target endian mismatch issue is that it's invalid to read/write target values using a host pointer without taking care of endian differences between the target and host. Most (if not all) instances of reinterpret_cast<uint32_t*>() in the RuntimeDyld are examples of this bug. This has been fixed for Mips using the endian aware read/write functions. The original commits were: r238838: [mips] Add RuntimeDyld tests for currently supported O32 relocations. Reviewers: petarj, vkalintiris Reviewed By: vkalintiris Subscribers: vkalintiris, llvm-commits Differential Revision: http://reviews.llvm.org/D10126 r238844: [mips][mcjit] Add support for R_MIPS_PC32. Summary: This allows us to resolve relocations for DW_EH_PE_pcrel TType encodings in the exception handling LSDA. Also fixed a nearby typo. Reviewers: petarj, vkalintiris Reviewed By: vkalintiris Subscribers: vkalintiris, llvm-commits Differential Revision: http://reviews.llvm.org/D10127 llvm-svn: 238915
* This reverts commit r238838, r238844 and r238888.Rafael Espindola2015-06-031-5/+1
| | | | | | | | Trying to bring back a windows bot: http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/1224/steps/ninja%20check%202/logs/FAIL%3A%20LLVM%3A%3AELF_O32_PIC_relocations.s llvm-svn: 238903
* [mips][mcjit] Add support for R_MIPS_PC32.Daniel Sanders2015-06-021-1/+5
| | | | | | | | | | | | | | | | | | Summary: This allows us to resolve relocations for DW_EH_PE_pcrel TType encodings in the exception handling LSDA. Also fixed a nearby typo. Reviewers: petarj, vkalintiris Reviewed By: vkalintiris Subscribers: vkalintiris, llvm-commits Differential Revision: http://reviews.llvm.org/D10127 llvm-svn: 238844
* Simplify now that we always use an alignment of 2 for ELF files.Rafael Espindola2015-06-021-4/+4
| | | | | | This saves 123144 bytes out of llvm-nm on powerpc64le. llvm-svn: 238824
* [RuntimeDydlELF] Use range-based loop.Davide Italiano2015-06-021-5/+3
| | | | | | | Differential Revision: http://reviews.llvm.org/D10165 Reviewed by: rafael llvm-svn: 238804
* add missing dependency for ExecutionEngine libSanjay Patel2015-06-012-1/+2
| | | | | | | This appears to be masked most of the time, but the problem was exposed on some bots by r238051. llvm-svn: 238788
* Try to fix the build of IntelJITEventListener.Rafael Espindola2015-06-011-2/+1
| | | | llvm-svn: 238709
* Simplify another function that doesn't fail.Rafael Espindola2015-06-011-6/+3
| | | | llvm-svn: 238703
* Simplify interface of function that doesn't fail.Rafael Espindola2015-05-311-4/+2
| | | | llvm-svn: 238700
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-293-7/+4
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
* [Mips64] Add support for MCJIT for MIPS64r2 and MIPS64r6Petar Jovanovic2015-05-284-9/+279
| | | | | | | | | | Add support for resolving MIPS64r2 and MIPS64r6 relocations in MCJIT. Patch by Vladimir Radosavljevic. Differential Revision: http://reviews.llvm.org/D9667 llvm-svn: 238424
* [RuntimeDyld] Fix MachO i386 SECTDIFF relocation to support non-zero addends.Lang Hames2015-05-271-6/+5
| | | | | | | Previously, relocations of the form 'A - B + C' would fail on i386 when C was non-zero. llvm-svn: 238356
* Remove NoFramePointerElim and NoFramePointerElimOverride from TargetOptions andAkira Hatanaka2015-05-262-4/+8
| | | | | | | | | | remove ExecutionEngine's dependence on CodeGen. NFC. This is a follow-up to r238080. Differential Revision: http://reviews.llvm.org/D9830 llvm-svn: 238244
* Update ExecutionEngine/LLVMBuild.txt, to add LLVMCodeGen.NAKAMURA Takumi2015-05-231-1/+1
| | | | llvm-svn: 238096
* Stop resetting NoFramePointerElim in TargetMachine::resetTargetOptions.Akira Hatanaka2015-05-231-1/+8
| | | | | | | | | | | | | | This is part of the work to remove TargetMachine::resetTargetOptions. In this patch, instead of updating global variable NoFramePointerElim in resetTargetOptions, its use in DisableFramePointerElim is replaced with a call to TargetFrameLowering::noFramePointerElim. This function determines on a per-function basis if frame pointer elimination should be disabled. There is no change in functionality except that cl:opt option "disable-fp-elim" can now override function attribute "no-frame-pointer-elim". llvm-svn: 238080
* Reapply part of r237975, "Fix Clang -Wmissing-override warning", except for ↵NAKAMURA Takumi2015-05-223-12/+9
| | | | | | DIContext.h, to apease g++-4.7. llvm-svn: 238012
* Revert "Fix Clang -Wmissing-override warning"Tobias Grosser2015-05-223-9/+12
| | | | | | This reverts commit r237975. This seems also to break with gcc 4.7 llvm-svn: 238004
* Fix Clang -Wmissing-override warningDavid Blaikie2015-05-223-12/+9
| | | | | | | & remove the duplication by introducing a CRTP base to implement the clone behavior. llvm-svn: 237975
* Make it easier to use DwarfContext with MCJITKeno Fischer2015-05-214-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This supersedes http://reviews.llvm.org/D4010, hopefully properly dealing with the JIT case and also adds an actual test case. DwarfContext was basically already usable for the JIT (and back when we were overwriting ELF files it actually worked out of the box by accident), but in order to resolve relocations correctly it needs to know the load address of the section. Rather than trying to get this out of the ObjectFile or requiring the user to create a new ObjectFile just to get some debug info, this adds the capability to pass in that info directly. As part of this I separated out part of the LoadedObjectInfo struct from RuntimeDyld, since it is now required at a higher layer. Reviewers: lhames, echristo Reviewed By: echristo Subscribers: vtjnash, friss, rafael, llvm-commits Differential Revision: http://reviews.llvm.org/D6961 llvm-svn: 237961
* [RuntimeDyld] Use isInt to assert that a relocation didn't overflowDavid Majnemer2015-05-151-6/+3
| | | | | | | | | | isInt is a little easier to read, let's use that more consistently. Incidentally, this also silences a warning for shifting a negative number. This fixes PR23532. llvm-svn: 237476
OpenPOWER on IntegriCloud