Commit Graph

1132 Commits

Author SHA1 Message Date
Oscar Fuentes
5969379145 Handles libffi on the CMake build.
Patch by arrowdodger!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123976 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21 15:42:54 +00:00
Anton Korobeynikov
16c29b5f28 Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs and fixes here and there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 12:39:04 +00:00
Benjamin Kramer
3069cbf7b3 Remove unneeded zero arrays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120910 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 15:28:22 +00:00
Michael J. Spencer
1f6efa3996 Merge System into Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:16:10 +00:00
Jay Foad
e4d19c9eb2 PR5207: change APInt::doubleToBits() and APInt::floatToBits() to be
static methods that return a new APInt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120261 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 21:04:48 +00:00
Anton Korobeynikov
d9e3385ced Move getInitialFrameState() to TargetFrameInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119754 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 23:25:52 +00:00
Daniel Dunbar
6aec298486 MCJIT: Stub out MCJIT implementation, still doesn't do anything useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119509 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 16:06:43 +00:00
Daniel Dunbar
6d135972bf lli: Add stub -use-mcjit option, which doesn't currently do anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 16:06:37 +00:00
Daniel Dunbar
48dd875be1 JIT: More nitty style tweakage, aka territory marking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 02:48:57 +00:00
Daniel Dunbar
32c7a5e08c Fix some more 80-col violas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 00:55:45 +00:00
Daniel Dunbar
ab19da4bc0 Fix 80-col violation / non-sensicalness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 00:55:42 +00:00
Chandler Carruth
19e57025d4 Move the remaining attribute macros to systematic names based on the attribute
name and prefixed with 'LLVM_'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-23 08:40:19 +00:00
Duncan Sands
b35fd448ce Fix the cleanup process of exception information in JIT. Now JIT
deregisters registered by it FDE structures allowing consecutive
JIT runs to succeed.  Patch by Yuri.  Fixes PR8285.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117004 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 08:57:29 +00:00
Michael J. Spencer
3a210e2d30 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:59:48 +00:00
Michael J. Spencer
4e9c939312 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:14:25 +00:00
NAKAMURA Takumi
17f9bfaa83 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 21:54:03 +00:00
NAKAMURA Takumi
37ce5650e6 EE/JIT: Do not invoke parent's ctors/dtors from main()! (PR3897)
On Mingw and Cygwin, the symbol __main is resolved to
callee's(eg. tools/lli) one, to invoke wrong duplicated ctors
(and register wrong callee's dtors with atexit(3)).
We expect, by callee, ExecutionEngine::runStaticConstructorsDestructors()
is called before ExecutionEngine::runFunctionAsMain() is called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 14:00:29 +00:00
Chris Lattner
c6a39aa5cd remove some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 03:12:06 +00:00
Nick Lewycky
83a82ac0b4 When creating a JIT, try to load the program so that we can resolve symbols
against it. This affects Windows.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 16:19:18 +00:00
Nick Lewycky
1f74ad7614 Stop the JIT from refusing to work just because the program it was compiled into
was built with -static.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 07:20:20 +00:00
Bob Wilson
e4373b0da6 Don't call __register_frame from the JIT on systems that use setjmp/longjmp
exception handling.  Also fix an extra underscore typo in one instance of
"__ARM_EABI__".  Radar 8236264.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109451 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 21:58:00 +00:00
Chris Lattner
77beeaec1e remove the dwarf sizing stuff which is now dead, it was
"yet another" copy of the dwarf EH emission code that was
copied, pasted and slightly hacked up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109169 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 21:20:39 +00:00
Chris Lattner
134d8eec87 remove the JIT "NeedsExactSize" feature and supporting logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 21:17:55 +00:00
Duncan Sands
e117b63973 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 09:36:45 +00:00
Duncan Sands
d90fee9b42 Expose JIT::recompileAndRelinkFunction for use through the C API.
Patch by Benjamin Saunders.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108690 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 09:33:13 +00:00
Eli Friedman
10bb4211d6 Get rid of a bunch of duplicated ELF enum values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108520 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 07:53:29 +00:00
Duncan Sands
3472766f9e Convert some tab stops into spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 08:16:59 +00:00
Chris Lattner
68feb22ad8 first part of JIT support for address of labels, part of PR7264,
patch by Yuri!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108107 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 23:07:28 +00:00
Dan Gohman
963433115a Handle execution entrypoints with non-integer return types.
Fix from Russel Power in PR7284.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-18 02:01:10 +00:00
Chris Lattner
87565c1d77 improve portability to systems that don't have powf/modf (e.g. solaris 9)
patch by Evzen Muller!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-15 17:10:24 +00:00
Duncan Sands
57b6e9eb6c Remove the -enable-sjlj-eh option, which doesn't do anything.
Remove the -enable-eh option which is only used by the JIT,
and replace it with -jit-enable-eh.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 15:36:26 +00:00
Dan Gohman
4781e30b7b Fix an ancient FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102827 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 02:43:10 +00:00
Jeffrey Yasskin
8c818fc35c Fix the OProfileJITEventListener build after r101844 removed
MachineFunction::DefaultDebugLoc.  We now use the same technique as
DwarfDebug::beginFunction to find the starting line number for a
function.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102679 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 00:16:10 +00:00
Bill Wendling
091fc4b556 Don't rely upon the MCSymbol "isDefined" method to indicate if a label has been
emitted or not. The JIT doesn't set that. Look it up in the label location table
instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 00:56:05 +00:00
Bill Wendling
69c128f19d Formatting changes. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101685 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 00:52:08 +00:00
Dan Gohman
3fb150a902 Fix -Wcast-qual warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101655 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 17:42:52 +00:00
Bill Wendling
47639fc5be The JIT calls TidyLandingPads to tidy up the landing pads. However, because the
JIT doesn't use the MC back-end asm printer to emit labels that it uses, the
section for the MCSymbol is never set. And thus the MCSymbol for the EH label
isn't marked as "defined". Because of that, TidyLandingPads removes the needed
landing pads from the JIT output. This breaks EH for every JIT program.

This is a work-around for this limitation. We pass in the label locations
map. If the label has a non-zero value, then it was "emitted" by the JIT and
TidyLandingPads shouldn't remove that label.

A nicer solution would be to mark the MCSymbol as "used" by the JIT and not rely
upon the section being set to determine if it's defined or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 08:46:10 +00:00
Dan Gohman
46510a73e9 Add const qualifiers to CodeGen's use of LLVM IR constructs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 01:51:59 +00:00
Nicolas Geoffray
4eb373988e Don't use DILocation when processing a DebugLoc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-14 22:06:37 +00:00
Benjamin Kramer
1bd7335a17 Use twines to simplify calls to report_fatal_error. For code size and readability.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100756 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 10:44:28 +00:00
Chris Lattner
75361b69f3 rename llvm::llvm_report_error -> llvm::report_fatal_error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 22:58:41 +00:00
Jeffrey Yasskin
376ac434ad Fix OProfileJITEventListener build for new DebugLoc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 21:09:12 +00:00
Nicolas Geoffray
9041ae274b CurFn is only used for relocations. Use EmissionDetails.MF->getFunction() instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100328 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 10:31:49 +00:00
Chris Lattner
de4845c163 Switch the code generator (except the JIT) onto the new DebugLoc
representation.  This eliminates the 'DILocation' MDNodes for 
file/line/col tuples from -O0 -g codegen.

This remove the old DebugLoc class, making it a typedef for DebugLoc,
I'll rename NewDebugLoc next.

I didn't update the JIT to use the new apis, so it will continue to
work, but be as slow as before.  Someone should eventually do this
or, better yet, rip out the JIT debug info stuff and build the JIT
on top of MC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 19:42:39 +00:00
Torok Edwin
820580dfa9 Typo noticed by Duncan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 20:15:13 +00:00
Torok Edwin
fb70e7deaf Don't overwrite previous value, if it succeeded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99886 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 12:52:03 +00:00
Torok Edwin
e38bc14a01 Honour addGlobalMapping() in the interpreter, if it was used to add mappings for
external Functions (the JIT does honour this).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 12:31:58 +00:00
Jeffrey Yasskin
47b7112418 Avoid leaking the memory allocated for GlobalVariables in the interpreter, by
freeing that memory when the GV is destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99706 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 04:53:56 +00:00
Jeffrey Yasskin
b19383818b Avoid leaking argv and env arrays from lli.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 00:59:12 +00:00
Jeffrey Yasskin
6efed73eb5 Avoid a memory leak in JITDebugRegisterer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98612 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 05:54:54 +00:00
Chris Lattner
6b4205aa44 fix these two get the mcsymbol operand instead of imm operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98487 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 08:28:48 +00:00
Chris Lattner
2e9919a5e5 Now that DBG_LABEL is updated, we can finally make MachineMove
contain an MCSymbol instead of a label index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98482 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 08:12:40 +00:00
Chris Lattner
1611273351 change EH related stuff (other than EH_LABEL) to use MCSymbol
instead of label ID's.  This cleans up and regularizes a bunch 
of code and makes way for future progress.

Unfortunately, this pointed out to me that JITDwarfEmitter.cpp
is largely copy and paste from DwarfException/MachineModuleInfo
and other places.  This is very sad and disturbing. :(

One major change here is that TidyLandingPads moved from being
called in DwarfException::BeginFunction to being called in
DwarfException::EndFunction.  There should not be any 
functionality change from doing this, but I'm not an EH expert.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 01:41:15 +00:00
Richard Osborne
95da605e15 Add a new jump table encoding to indicate jump tables entries
are inside the function by the target at the point of use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 14:58:16 +00:00
Chris Lattner
a34ec2290f strength reduce MMI::MappedLabel to MMI::isLabelDeleted,
and add a FIXME about how we are eventually going to zap this
lookup table once mc world domination is complete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 01:51:43 +00:00
Jeffrey Yasskin
39c75f2e90 Fix PR6360. It's easy for a stub's address to escape to user code, so we can't
just count references to it from JIT output to decide when to destroy it.  This
patch waits to destroy the JIT's memory of a stub until the Function it refers
to is destroyed.  External function stubs and GVIndirectSyms aren't destroyed
until the JIT itself is.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97737 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 19:45:09 +00:00
Jeffrey Yasskin
e57898ce55 Fix PR5291, in which a SmallPtrSet iterator was held across an insertion into
the set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97720 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 06:50:01 +00:00
Jeffrey Yasskin
8e98d1299d Make sure JITResolvers don't leave any stubs behind. When a JITResolver was
destroyed, it could leave stubs in the StubToResolverMap, which would confuse
the lookup for subsequent lazy compilations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97698 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 00:32:33 +00:00
Erick Tryzelaar
df7df075b7 Add Module functions in place of module providers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97608 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 23:58:54 +00:00
Duncan Sands
1df9859c40 There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy().  Convert most instances of the first form to the second form.
Requested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 11:11:14 +00:00
Bill Wendling
89ee706b6b Apply patch from http://llvm.org/bugs/attachment.cgi?id=4136 now that PR5004 is
finished.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96304 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 00:58:02 +00:00
Duncan Sands
b0bc6c361d Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy.  Requested by Chris!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 16:12:20 +00:00
Jeffrey Yasskin
3174f6703e Make JIT::runFunction clean up the generated stub function.
Patch by Shivram K!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 23:05:31 +00:00
Jeffrey Yasskin
40966a7c68 Make it possible to create multiple JIT instances at the same time, by removing
the global TheJIT and TheJITResolver variables.  Lazy compilation is supported
by a global map from a stub address to the JITResolver that knows how to
compile it.

Patch by Olivier Meurant!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 01:07:39 +00:00
Dan Gohman
f451cb870e Fix "the the" and similar typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 16:03:48 +00:00
Jeffrey Yasskin
4688261c20 Move --march, --mcpu, and --mattr from JIT/TargetSelect.cpp to lli.cpp.
llc.cpp also defined these flags, meaning that when I linked all of LLVM's
libraries into a single shared library, llc crashed on startup with duplicate
flag definitions.  This patch passes them through the EngineBuilder into
JIT::selectTarget().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 16:19:36 +00:00
Jeffrey Yasskin
3a813dc707 r94686 changed all ModuleProvider parameters to Modules, which made the
1-argument ExecutionEngine::create(Module*) ambiguous with the signature that
used to be ExecutionEngine::create(ModuleProvider*, defaulted_params).  Fixed
by removing the 1-argument create().  Fixes PR6221.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 19:18:04 +00:00
Benjamin Kramer
12ea66a727 Replace strcpy with memcpy when we have the length around anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 18:04:38 +00:00
Jeffrey Yasskin
f0356fe140 Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 20:34:15 +00:00
Chris Lattner
85fe07866a Add support for target-specific 32-bit custom-lowered
jump table entries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94505 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 04:05:28 +00:00
Chris Lattner
13af11acbf make jit jump table emission be based on the EntryKind instead of magic variables.
JITInfo::getPICJumpTableEntry can probably be removed now, but I don't plan to do 
this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94501 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 03:47:15 +00:00
Chris Lattner
071c62fad0 Rearrange handling of jump tables. Highlights:
1. MachineJumpTableInfo is now created lazily for a function the first time
   it actually makes a jump table instead of for every function.
2. The encoding of jump table entries is now described by the
   MachineJumpTableInfo::JTEntryKind enum.  This enum is determined by the
   TLI::getJumpTableEncoding() hook, instead of by lots of code scattered
   throughout the compiler that "knows" that jump table entries are always
   32-bits in pic mode (for example).
3. The size and alignment of jump table entries is now calculated based on
   their kind, instead of at machinefunction creation time.

Future work includes using the EntryKind in more places in the compiler,
eliminating other logic that "knows" the layout of jump tables in various
situations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 23:26:13 +00:00
Chris Lattner
43b5f9312d make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 20:43:08 +00:00
Jeffrey Yasskin
bf1f76b493 Make OProfile support compile again after r93630 removed
DebugLocTuple.  Also use an AssertingVH to ensure that MDNodes aren't
destroyed while the FilenameCache is using them.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94245 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 23:04:39 +00:00
Chris Lattner
e73a31f667 Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 06:49:46 +00:00
Devang Patel
c99fd879c0 Avoid including DebugInfo.h in AsmPrinter.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 06:09:04 +00:00
Devang Patel
6b61f5816e Replace DebugLocTuple with DILocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 06:09:35 +00:00
Jay Foad
5b3701256c Fix http://llvm.org/PR6028, an assertion failure when an UndefValue of
integer type is used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93509 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 08:32:58 +00:00
Chris Lattner
d686c8e73f "In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for."
Patch by James Y Knight!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 22:27:07 +00:00
Benjamin Kramer
8c65f6e71c Move remaining stuff to the isInteger predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 21:05:54 +00:00
Benjamin Kramer
11acaa374c Convert a ton of simple integer type equality tests to the new predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 20:07:06 +00:00
Benjamin Kramer
f012705c7e Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 13:12:22 +00:00
David Greene
c74fe78c2d These should probably be errs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:53:59 +00:00
David Greene
ae7c59a012 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:27:39 +00:00
David Greene
4ac99a8c26 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:27:26 +00:00
David Greene
ef573a3a75 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:27:23 +00:00
David Greene
bd8c8afe1b Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92562 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:23:38 +00:00
David Greene
c9ec9931d8 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92561 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:23:36 +00:00
David Greene
4a54016b07 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:23:34 +00:00
Bill Wendling
abeca44d63 Remove dead store and simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 01:53:00 +00:00
Jeffrey Yasskin
c5818fb837 Partially revert r91626. Materializing extra functions to determine whether
they're available_externally broke VMKit, which was relying on the fact that
functions would only be materialized when they were first called.  We'll have
to wait for http://llvm.org/PR5737 to really fix this.

I also added a test for one of the F->isDeclaration() calls which wasn't
covered by anything else in the test suite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91943 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 23:47:23 +00:00
Jeffrey Yasskin
92fdf4537b Fix a crash in JIT::recompileAndRelinkFunction(). It doesn't pass the MCI
argument to runJITOnFunction(), which caused a null pointer dereference at
every call.

Patch by Gianluca Guida!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91939 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 23:18:18 +00:00
Jeffrey Yasskin
aad0d52c5b Don't codegen available_externally functions. Fixes http://llvm.org/PR5735.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91626 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 21:35:29 +00:00
Jeffrey Yasskin
32d7e6ebde Change indirect-globals to use a dedicated allocIndirectGV. This lets us
remove start/finishGVStub and the BufferState helper class from the
MachineCodeEmitter interface.  It has the side-effect of not setting the
indirect global writable and then executable on ARM, but that shouldn't be
necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 22:42:46 +00:00
Chris Lattner
4bbf4ee149 Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait.  This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 07:26:43 +00:00
Eric Christopher
0c479d3c6b Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 00:40:55 +00:00
Jeffrey Yasskin
898e9df8db Reinstate r91208 to fix available_externally linkage for globals, with
nlewycky's fix to add -rdynamic so the JIT can look symbols up in Linux builds
of the JITTests binary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-13 20:30:32 +00:00
Jeffrey Yasskin
9b8ff28870 Revert r91208. Something on Linux prevents the JIT from looking up a symbol
defined in the test, and I don't have time tonight to figure it out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 06:18:46 +00:00
Jeffrey Yasskin
5cc966a6c1 Fix available_externally linkage for globals. It's probably still not
supported by emitGlobals, but I don't have a test case for that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 05:58:14 +00:00
Torok Edwin
f05e45eb37 Comparing std::string with NULL is a bad idea, so just check whether its empty.
This code was crashing always with oprofile enabled, since it tried to create a StringRef
out of NULL, which run strlen on NULL.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 10:01:47 +00:00