summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
* ExecutionEngine: Check for NULL ErrorStr before using it.Jim Grosbach2012-05-101-2/+3
| | | | | | Patch by Yury Mikhaylov <yury.mikhaylov@gmail.com>. llvm-svn: 156523
* Make IntelJITEvents and OProfileJIT as optional libraries and addPreston Gurd2012-05-072-2/+2
| | | | | | | | | | | | optional library support to the llvm-build tool: - Add new command line parameter to llvm-build: “--enable-optional-libraries” - Add handing of new llvm-build library type “OptionalLibrary” - Update Cmake and automake build systems to pass correct flags to llvm-build based on configuration Patch by Dan Malea! llvm-svn: 156319
* RuntimeDyld cleanup:Eli Bendersky2012-05-014-65/+77
| | | | | | | | | | | - Improved parameter names for clarity - Added comments - emitCommonSymbols should return void because its return value is not being used anywhere - Attempt to reduce the usage of the RelocationValueRef type. Restricts it for a single goal and may serve as a step for eventual removal. llvm-svn: 155908
* RuntimeDyld code cleanup:Eli Bendersky2012-05-016-30/+38
| | | | | | | | | - There's no point having a different type for the local and global symbol tables. - Renamed SymbolTable to GlobalSymbolTable to clarify the intention - Improved const correctness where relevant llvm-svn: 155898
* It doesn't make sense to move symbol relocations to section relocations whenEli Bendersky2012-04-302-26/+27
| | | | | | | | | relocations are resolved. It's much more reasonable to do this decision when relocations are just being added - we have all the information at that point. Also a bit of renaming and extra comments to clarify extensions. llvm-svn: 155819
* Code cleanup in RuntimeDyld:Eli Bendersky2012-04-304-72/+95
| | | | | | | | | - Add comments - Change field names to be more reasonable - Fix indentation and naming to conform to coding conventions - Remove unnecessary includes / replace them by forward declatations llvm-svn: 155815
* Fix some formatting, grammar and style issues and add a couple of missing ↵Eli Bendersky2012-04-295-28/+30
| | | | | | comments. llvm-svn: 155793
* Fix incorrect call of resolveRelocation() for ARM ELF stub relocations.Danil Malyshev2012-04-171-2/+2
| | | | llvm-svn: 154948
* Add files which were not included by commit 154868.Preston Gurd2012-04-163-0/+316
| | | | llvm-svn: 154872
* Implement GDB integration for source level debugging of code JITed usingPreston Gurd2012-04-167-24/+226
| | | | | | | | | | | | | | | the MCJIT execution engine. The GDB JIT debugging integration support works by registering a loaded object image with a pre-defined function that GDB will monitor if GDB is attached. GDB integration support is implemented for ELF only at this time. This integration requires GDB version 7.0 or newer. Patch by Andy Kaylor! llvm-svn: 154868
* This patch improves the MCJIT runtime dynamic loader by adding new handlingPreston Gurd2012-04-124-59/+162
| | | | | | | | | | of zero-initialized sections, virtual sections and common symbols and preventing the loading of sections which are not required for execution such as debug information. Patch by Andy Kaylor! llvm-svn: 154610
* EngineBuilder::create is expected to take ownership of the TargetMachine ↵Benjamin Kramer2012-04-081-3/+5
| | | | | | passed to it. Delete it on error or when we create an interpreter that doesn't need it. llvm-svn: 154288
* Removing a file that's no longer being used after the recent refactoringsEli Bendersky2012-04-011-388/+0
| | | | llvm-svn: 153825
* Re-factored RuntimeDyLd:Danil Malyshev2012-03-307-1046/+753
| | | | | | | | | | | | | | | 1. The main works will made in the RuntimeDyLdImpl with uses the ObjectFile class. RuntimeDyLdMachO and RuntimeDyLdELF now only parses relocations and resolve it. This is allows to make improvements of the RuntimeDyLd more easily. In addition the support for COFF can be easily added. 2. Added ARM relocations to RuntimeDyLdELF. 3. Added support for stub functions for the ARM, allowing to do a long branch. 4. Added support for external functions that are not loaded from the object files, but can be loaded from external libraries. Now MCJIT can correctly execute the code containing the printf, putc, and etc. 5. The sections emitted instead functions, thanks Jim Grosbach. MemoryManager.startFunctionBody() and MemoryManager.endFunctionBody() have been removed. 6. MCJITMemoryManager.allocateDataSection() and MCJITMemoryManager. allocateCodeSection() used JMM->allocateSpace() instead of JMM->allocateCodeSection() and JMM->allocateDataSection(), because I got an error: "Cannot allocate an allocated block!" with object file contains more than one code or data sections. llvm-svn: 153754
* Revert r153694. It was causing failures in the buildbots.Bill Wendling2012-03-297-753/+1046
| | | | llvm-svn: 153701
* Re-factored RuntimeDyld.Danil Malyshev2012-03-297-1046/+753
| | | | | | Added ExecutionEngine/MCJIT tests. llvm-svn: 153694
* Move getPointerToNamedFunction() from JIT/MCJIT to JITMemoryManager.Danil Malyshev2012-03-2810-332/+208
| | | | llvm-svn: 153607
* Made RuntimeDyldMachO support vanilla i386Sean Callanan2012-03-262-0/+44
| | | | | | | | | relocations. The algorithm is the same as that for x86_64. Scattered relocations, a feature present in i386 but not on x86_64, are not yet supported. llvm-svn: 153466
* Make it feasible for clients using EngineBuilder to capture the ↵Owen Anderson2012-03-232-38/+42
| | | | | | | | TargetMachine that is created as part of selecting the appropriate target. This is necessary if the client wants to be able to mutate TargetOptions (for example, fast FP math mode) after the initial creation of the ExecutionEngine. llvm-svn: 153342
* Revert a series of commits to MCJIT to get the build working in CMakeChandler Carruth2012-03-2216-952/+1371
| | | | | | | | | | | | | | | (and hopefully on Windows). The bots have been down most of the day because of this, and it's not clear to me what all will be required to fix it. The commits started with r153205, then r153207, r153208, and r153221. The first commit seems to be the real culprit, but I couldn't revert a smaller number of patches. When resubmitting, r153207 and r153208 should be folded into r153205, they were simple build fixes. llvm-svn: 153241
* Re-factored RuntimeDyld.Danil Malyshev2012-03-217-1044/+749
| | | | | | Added ExecutionEngine/MCJIT tests. llvm-svn: 153221
* (no commit message)Danil Malyshev2012-03-211-0/+5
| | | | llvm-svn: 153208
* Based on this discussion: ↵Danil Malyshev2012-03-219-329/+200
| | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120305/138477.html 1. Declare a virtual function getPointerToNamedFunction() in JITMemoryManager 2. Move the implementation of getPointerToNamedFunction() form JIT/MCJIT to DefaultJITMemoryManager. llvm-svn: 153205
* RuntimeDyldMachO has the ability to keep track ofSean Callanan2012-03-202-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | relocations (i.e., pieces of data whose addresses are referred to elsewhere in the binary image) and update the references when the section containing the relocations moves. The way this works is that there is a map from section IDs to lists of relocations. Because the relocations are associated with the section containing the data being referred to, they are updated only when the target moves. However, many data references are relative and also depend on the location of the referrer. To solve this problem, I introduced a new data structure, Referrer, which simply contains the section being referred to and the index of the relocation in that section. These referrers are associated with the source containing the reference that needs to be updated, so now regardless of which end of the relocation moves, the relocation will now be updated correctly. llvm-svn: 153147
* Add profiling support for Intel Parallel Amplifier XE (VTune) for JITted ↵Eli Bendersky2012-03-1314-60/+677
| | | | | | | | | | | code in LLVM. Also refactor the existing OProfile profiling code to reuse the same interfaces with the VTune profiling code. In addition, unit tests for the profiling interfaces were added. This patch was prepared by Andrew Kaylor and Daniel Malea, and reviewed in the llvm-commits list by Jim Grosbach llvm-svn: 152620
* llvm::SwitchInstStepan Dyatkovskiy2012-03-111-1/+1
| | | | | | | Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default. Added some notes relative to case iterators. llvm-svn: 152532
* Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:Stepan Dyatkovskiy2012-03-081-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*". ConstCaseIt is just a read-only iterator. CaseIt is read-write iterator; it allows to change case successor and case value. Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters. Main way of iterator usage looks like this: SwitchInst *SI = ... // intialize it somehow for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) { BasicBlock *BB = i.getCaseSuccessor(); ConstantInt *V = i.getCaseValue(); // Do something. } If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method. If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method. There are also related changes in llvm-clients: klee and clang. llvm-svn: 152297
* Improved support in RuntimeDyldMachO for generatingSean Callanan2012-03-072-22/+69
| | | | | | | | | | | code that will be relocated into another memory space. Now when relocations are resolved, the address of the relocation in the host memory (where the JIT is) is passed separately from the address that the relocation will be at in the target memory (where the code will run). llvm-svn: 152264
* Fixed the 32-bit runtime dynamic loader to allocateSean Callanan2012-03-011-1/+1
| | | | | | | code sections when needed. It just had a conditional the wrong way around. llvm-svn: 151777
* EE/Interpreter/ExternalFunctions.cpp: Staticize lle_X_() entries. They can ↵NAKAMURA Takumi2012-02-241-0/+8
| | | | | | be mapped in FuncNames[] at the initialization. llvm-svn: 151313
* EE/Interpreter/ExternalFunctions.cpp: Prune "C" linkage to suppress warnings ↵NAKAMURA Takumi2012-02-241-22/+0
| | | | | | | | | | | | with -Wreturn-type (and MSC's w4190). In historical reason, Interpreter's external entries had prefix "lle_X_" as C linkage, even for well-known entries in EE/Interpreter. Now, at least on ToT, they are resolved via FuncNames[] mapper. We will not need their symbols are expected to be exported any more. Clang r150128 has introduced the warning <"%0 has C-linkage specified, but returns user-defined type %1 which is incompatible with C">. llvm-svn: 151312
* Remove dead code. Improve llvm_unreachable text. Simplify some control flow.Ahmed Charles2012-02-192-2/+1
| | | | llvm-svn: 150918
* Using the new external-linkage warning recently added instead of disabling ↵Aaron Ballman2012-02-141-1/+1
| | | | | | all return type warnings. llvm-svn: 150512
* Fixing warning due to the new "UTD return type in extern 'C'".Aaron Ballman2012-02-141-2/+9
| | | | | | Patch by Matt Johnson llvm-svn: 150508
* Remove duplicate code in this header file which seemed to undergo a ↵Ahmed Charles2012-02-131-96/+0
| | | | | | copy/paste fiasco. llvm-svn: 150369
* Fix various issues (or do cleanups) found by enabling certain MSVC warnings.Ahmed Charles2012-02-131-1/+0
| | | | | | | | | - Use unsigned literals when the desired result is unsigned. This mostly allows unsigned/signed mismatch warnings to be less noisy even if they aren't on by default. - Remove misplaced llvm_unreachable. - Add static to a declaration of a function on MSVC x86 only. - Change some instances of calling a static function through a variable to simply calling that function while removing the unused variable. llvm-svn: 150364
* Expose the ELFObjectFile class directly in the Object/ELF.h header, similarlyEli Bendersky2012-02-121-0/+388
| | | | | | | | | | to what's done for MachO and COFF. This allows advanced uses of the class to be implemented outside the Object library. In particular, the DyldELFObject subclass is now moved into its logical home - ExecutionEngine/RuntimeDyld. This patch was reviewed by Michael Spencer. llvm-svn: 150327
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-076-19/+12
| | | | llvm-svn: 149967
* [unwind removal] We no longer have 'unwind' instructions being generated, soBill Wendling2012-02-062-19/+0
| | | | | | remove the code that handles them. llvm-svn: 149901
* Explain to the compiler why TargetAddr is not used uninitialized later.Duncan Sands2012-02-051-2/+2
| | | | llvm-svn: 149832
* Add a new MachineJumpTableInfo entry type, EK_GPRel64BlockAddress, which isAkira Hatanaka2012-02-031-0/+3
| | | | | | | | needed to emit a 64-bit gp-relative relocation entry. Make changes necessary for emitting jump tables which have entries with directive .gpdword. This patch does not implement the parts needed for direct object emission or JIT. llvm-svn: 149668
* SwitchInst refactoring.Stepan Dyatkovskiy2012-02-011-2/+2
| | | | | | | | | | | | | | | | | The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want. What was done: 1. Changed semantics of index inside the getCaseValue method: getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous. 2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned. 3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment. 4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst. 4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor. 4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor. Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang. llvm-svn: 149481
* add more support for ConstantDataSequentialChris Lattner2012-01-241-11/+27
| | | | llvm-svn: 148802
* Remove extraneous ';'s.Bill Wendling2012-01-231-1/+1
| | | | llvm-svn: 148740
* Split the lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h header to ↵Eli Bendersky2012-01-226-135/+373
| | | | | | | | | | smaller logical headers. ELF and MachO implementations of RuntimeDyldImpl go into their own header files now. Reviewed on llvm-commits llvm-svn: 148652
* RuntimeDyld alignment adjustment from MachO file.Jim Grosbach2012-01-211-2/+4
| | | | | | | | The MachO file stores section alignment as log2(alignment-in-bytes). The allocation routines want the raw alignment-in-bytes value, so adjust for that. llvm-svn: 148604
* Fix inverted condition.Jim Grosbach2012-01-201-1/+1
| | | | llvm-svn: 148593
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-206-8/+0
| | | | llvm-svn: 148578
* Fix MCJIT memory leak of owned TargetMachine.Jim Grosbach2012-01-171-0/+1
| | | | | | | The JIT is expected to take ownership of the TM that's passed in. The MCJIT wasn't freeing it, resulting in leaks. llvm-svn: 148356
* Tidy up.Jim Grosbach2012-01-164-5/+5
| | | | llvm-svn: 148265
OpenPOWER on IntegriCloud