summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine
Commit message (Collapse)AuthorAge
* build: Add initial cut at LLVMBuild.txt files.Daniel Dunbar2011-11-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143634 91177308-0d34-0410-b5e6-96231b3b80d8
* rename getHostTriple into getDefaultTargetTripleSebastian Pop2011-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143502 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore MachO symbol flags in the upper nibble of n_desc.Jim Grosbach2011-11-01
| | | | | | They don't impact the MCJIT rtdyld, so just mask them off for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143472 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding dependencies to allow -DBUILD_SHARED_LIBS=true to complete.Joe Abbey2011-10-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142464 91177308-0d34-0410-b5e6-96231b3b80d8
* The MCJITMemoryManager takes ownership of the JMM, so don't leak it.Jim Grosbach2011-10-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142410 91177308-0d34-0410-b5e6-96231b3b80d8
* MCJIT initialization TargetDataDanil Malyshev2011-09-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140856 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up uses of switch instructions so they are not dependent on the ↵Eli Friedman2011-09-29
| | | | | | operand ordering. Patch by Stepan Dyatkovskiy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140803 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the asserts in lib/Target/X86/X86ELFWriterInfo.cpp andRichard Trieu2011-09-10
| | | | | | | | | | | | | | lib/ExecutionEngine/MCJIT/MCJIT.cpp from: assert("error"); to: assert(0 && "error"); git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139456 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't tack "Instruction not interpretable yet!" onto the end ofDuncan Sands2011-09-09
| | | | | | | the instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139398 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng2011-08-24
| | | | | | | These are strictly utilities for registering targets and components. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138450 91177308-0d34-0410-b5e6-96231b3b80d8
* EE: Provide the symbol "lseek64" explicitly with <unistd.h> on Linux glibc.NAKAMURA Takumi2011-08-14
| | | | | | With libcxx, it seems <unistd.h> would not be provided. Thanks to Ryuta Suzuki. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137567 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence a bunch (but not all) "variable written but not read" warningsDuncan Sands2011-08-12
| | | | | | | when building with assertions disabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137460 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite the CMake build to use explicit dependencies between libraries,Chandler Carruth2011-07-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified in the same file that the library itself is created. This is more idiomatic for CMake builds, and also allows us to correctly specify dependencies that are missed due to bugs in the GenLibDeps perl script, or change from compiler to compiler. On Linux, this returns CMake to a place where it can relably rebuild several targets of LLVM. I have tried not to change the dependencies from the ones in the current auto-generated file. The only places I've really diverged are in places where I was seeing link failures, and added a dependency. The goal of this patch is not to start changing the dependencies, merely to move them into the correct location, and an explicit form that we can control and change when necessary. This also removes a serialization point in the build because we don't have to scan all the libraries before we begin building various tools. We no longer have a step of the build that regenerates a file inside the source tree. A few other associated cleanups fall out of this. This isn't really finished yet though. After talking to dgregor he urged switching to a single CMake macro to construct libraries with both sources and dependencies in the arguments. Migrating from the two macros to that style will be a follow-up patch. Also, llvm-config is still generated with GenLibDeps.pl, which means it still has slightly buggy dependencies. The internal CMake 'llvm-config-like' macro uses the correct explicitly specified dependencies however. A future patch will switch llvm-config generation (when using CMake) to be based on these deps as well. This may well break Windows. I'm getting a machine set up now to dig into any failures there. If anyone can chime in with problems they see or ideas of how to solve them for Windows, much appreciated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136433 91177308-0d34-0410-b5e6-96231b3b80d8
* - Move CodeModel from a TargetMachine global option to MCCodeGenInfo.Evan Cheng2011-07-20
| | | | | | | | | - Introduce JITDefault code model. This tells targets to set different default code model for JIT. This eliminates the ugly hack in TargetMachine where code model is changed after construction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135580 91177308-0d34-0410-b5e6-96231b3b80d8
* Extra semi-colon.Eric Christopher2011-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135561 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert TargetData::getIndexedOffset to use ArrayRef.Jay Foad2011-07-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135478 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce MCCodeGenInfo, which keeps information that can affect codegenEvan Cheng2011-07-19
| | | | | | | | (including compilation, assembly). Move relocation model Reloc::Model from TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135468 91177308-0d34-0410-b5e6-96231b3b80d8
* Move getInitialFrameState from TargetFrameInfo to MCAsmInfo (suggestions forEvan Cheng2011-07-18
| | | | | | | better location welcome). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135438 91177308-0d34-0410-b5e6-96231b3b80d8
* Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ↵Jeffrey Yasskin2011-07-18
| | | | | | | | | ambiguity errors like the one corrected by r135261. Migrate all LLVM callers of the old constructor to the new one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135431 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135265 91177308-0d34-0410-b5e6-96231b3b80d8
* Add to RuntimeDyld support different object formatsDanil Malyshev2011-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135037 91177308-0d34-0410-b5e6-96231b3b80d8
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name toEvan Cheng2011-06-30
| | | | | | | | | | | be the first encoded as the first feature. It then uses the CPU name to look up features / scheduling itineray even though clients know full well the CPU name being used to query these properties. The fix is to just have the clients explictly pass the CPU name! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134127 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink SubtargetFeature and TargetInstrItineraries (renamed ↵Evan Cheng2011-06-29
| | | | | | MCInstrItineraries) into MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134049 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the Type::getDescription() method, using "<<" instead. This Chris Lattner2011-06-18
| | | | | | | removes some gunk from LLVMContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133360 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid a Twine that referenced a tmp (which proceded to go out of scope beforeJim Grosbach2011-05-19
| | | | | | the Twine was used). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131612 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore sanity to 131601.Jim Grosbach2011-05-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131603 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective C functions may use a magic '\1' on the name. Handle that whenJim Grosbach2011-05-18
| | | | | | dealing with them in the MCJIT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131601 91177308-0d34-0410-b5e6-96231b3b80d8
* Be a bit more permissive about symbols we don't understand. Just skip themJim Grosbach2011-05-13
| | | | | | rather than throwing an error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131322 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine: move createJIT() definition (v2)Dylan Noblesmith2011-05-13
| | | | | | | | | As an ExecutionEngine class function, its definition really belongs in ExecutionEngine.cpp, not JIT.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131320 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine: push TargetMachine creation into clients (v2)Dylan Noblesmith2011-05-13
| | | | | | | | | | In particular, into EngineBuilder. This should only impact the private API between the EE and EB classes, not external clients, since JITCtor and MCJITCtor are both protected members. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131317 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine: fix JIT/MCJIT selectTarget() duplication (v2)Dylan Noblesmith2011-05-13
| | | | | | | | | This prepares for making JITCtor/MCJITCtor take a TargetMachine* directly from clients like EngineBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131316 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the RtDyld to tell the memory manager about how much space a functionJim Grosbach2011-05-13
| | | | | | | actually takes rather than how much memory was allocated for it. This is more accurate and should help the manager pack things more effectively. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131305 91177308-0d34-0410-b5e6-96231b3b80d8
* MCJIT section loading should just skip non-text sections rather thanJim Grosbach2011-05-12
| | | | | | | | erroring out completely. Some modules produce sections that aren't referenced, so it's friendlier to clients like LLDB to just skip them, at least for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131243 91177308-0d34-0410-b5e6-96231b3b80d8
* The MCJIT memory manager needs to initialize its Module member.Jim Grosbach2011-05-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131234 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert ExecutionEngine patches, they either failed to build or broke unit tests.Jakob Stoklund Olesen2011-05-07
| | | | | | Please ensure the build is clean and tests are passing when recommitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131044 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine: delete duplicated filesDylan Noblesmith2011-05-06
| | | | | | | | Forgot to `svn rm` these in revisions 131025 / 131029. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131030 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine: add missing fileDylan Noblesmith2011-05-06
| | | | | | | | From revision 131025. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131029 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine: move createJIT() definitionDylan Noblesmith2011-05-06
| | | | | | | | | As an ExecutionEngine class function, its definition really belongs in ExecutionEngine.cpp, not JIT.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131027 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine: push TargetMachine creation into clientsDylan Noblesmith2011-05-06
| | | | | | | | | | In particular, into EngineBuilder. This should only impact the private API between the EE and EB classes, not external clients, since JITCtor and MCJITCtor are both protected members. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131026 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine: fix JIT/MCJIT selectTarget() duplicationDylan Noblesmith2011-05-06
| | | | | | | | | This prepares for making JITCtor/MCJITCtor take a TargetMachine* directly from clients like EngineBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131025 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a C++0x portability issue with std::make_pair. Explicitly providing ↵Douglas Gregor2011-04-29
| | | | | | template arguments no longer works when the call arguments are lvalues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130513 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the last -Wnon-pod-memset I'm seeing. This is benign, but appearsChandler Carruth2011-04-28
| | | | | | | | | | | | | a bit more sinister as the memset doesn't do what the constructor does. There seems to be a cleaner solution than a cast here though, instead we can point the memset destination into the union its actually trying to clear. An alternative is to point to the Untyped member of this union. Review appreciated, and if that is cleaner I'm happy to switch. All of these should be functionally equivalent to the original code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130395 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused STL header includes.Jay Foad2011-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
* 80-col fix.Eric Christopher2011-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129973 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-15
| | | | | | | | Luis Felipe Strano Moraes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
* MCJIT relocation resolution.Jim Grosbach2011-04-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129445 91177308-0d34-0410-b5e6-96231b3b80d8
* Like the coding standards say, do not use "using namespace std".Jay Foad2011-04-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129435 91177308-0d34-0410-b5e6-96231b3b80d8
* MCJIT lazy relocation resolution and symbol address re-assignment.Jim Grosbach2011-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add handling for tracking the relocations on symbols and resolving them. Keep track of the relocations even after they are resolved so that if the RuntimeDyld client moves the object, it can update the address and any relocations to that object will be updated. For our trival object file load/run test harness (llvm-rtdyld), this enables relocations between functions located in the same object module. It should be trivially extendable to load multiple objects with mutual references. As a simple example, the following now works (running on x86_64 Darwin 10.6): $ cat t.c int bar() { return 65; } int main() { return bar(); } $ clang t.c -fno-asynchronous-unwind-tables -o t.o -c $ otool -vt t.o t.o: (__TEXT,__text) section _bar: 0000000000000000 pushq %rbp 0000000000000001 movq %rsp,%rbp 0000000000000004 movl $0x00000041,%eax 0000000000000009 popq %rbp 000000000000000a ret 000000000000000b nopl 0x00(%rax,%rax) _main: 0000000000000010 pushq %rbp 0000000000000011 movq %rsp,%rbp 0000000000000014 subq $0x10,%rsp 0000000000000018 movl $0x00000000,0xfc(%rbp) 000000000000001f callq 0x00000024 0000000000000024 addq $0x10,%rsp 0000000000000028 popq %rbp 0000000000000029 ret $ llvm-rtdyld t.o -debug-only=dyld ; echo $? Function sym: '_bar' @ 0 Function sym: '_main' @ 16 Extracting function: _bar from [0, 15] allocated to 0x100153000 Extracting function: _main from [16, 41] allocated to 0x100154000 Relocation at '_main' + 16 from '_bar(Word1: 0x2d000000) Resolving relocation at '_main' + 16 (0x100154010) from '_bar (0x100153000)(pcrel, type: 2, Size: 4). loaded '_main' at: 0x100154000 65 $ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129388 91177308-0d34-0410-b5e6-96231b3b80d8