Commit Graph

1038 Commits

Author SHA1 Message Date
Torok Edwin 921e80b1f5 Typo noticed by Duncan.
llvm-svn: 99918
2010-03-30 20:15:13 +00:00
Torok Edwin cc1db61180 Don't overwrite previous value, if it succeeded.
llvm-svn: 99886
2010-03-30 12:52:03 +00:00
Torok Edwin 61b798a5ac Honour addGlobalMapping() in the interpreter, if it was used to add mappings for
external Functions (the JIT does honour this).

llvm-svn: 99885
2010-03-30 12:31:58 +00:00
Jeffrey Yasskin a4044332a9 Avoid leaking the memory allocated for GlobalVariables in the interpreter, by
freeing that memory when the GV is destroyed.

llvm-svn: 99706
2010-03-27 04:53:56 +00:00
Jeffrey Yasskin bfd38abbed Avoid leaking argv and env arrays from lli.
llvm-svn: 99589
2010-03-26 00:59:12 +00:00
Jeffrey Yasskin 7d83d9b23c Avoid a memory leak in JITDebugRegisterer.
llvm-svn: 98612
2010-03-16 05:54:54 +00:00
Chris Lattner f1c2b9d3b1 fix these two get the mcsymbol operand instead of imm operand.
llvm-svn: 98487
2010-03-14 08:28:48 +00:00
Chris Lattner d5e8d9f29a Now that DBG_LABEL is updated, we can finally make MachineMove
contain an MCSymbol instead of a label index.

llvm-svn: 98482
2010-03-14 08:12:40 +00:00
Chris Lattner 34adc8d225 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.

llvm-svn: 98459
2010-03-14 01:41:15 +00:00
Richard Osborne 6d3e92dfee Add a new jump table encoding to indicate jump tables entries
are inside the function by the target at the point of use.

llvm-svn: 98255
2010-03-11 14:58:16 +00:00
Chris Lattner c3b70f636f 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.

llvm-svn: 98031
2010-03-09 01:51:43 +00:00
Jeffrey Yasskin c3b7d1edfa 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.

llvm-svn: 97737
2010-03-04 19:45:09 +00:00
Jeffrey Yasskin 391aad6327 Fix PR5291, in which a SmallPtrSet iterator was held across an insertion into
the set.

llvm-svn: 97720
2010-03-04 06:50:01 +00:00
Jeffrey Yasskin 950e0fba8e 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.

llvm-svn: 97698
2010-03-04 00:32:33 +00:00
Erick Tryzelaar ad0e0cb0df Add Module functions in place of module providers.
llvm-svn: 97608
2010-03-02 23:58:54 +00:00
Duncan Sands 19d0b47b1f 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.

llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Bill Wendling 1776295bf1 Apply patch from http://llvm.org/bugs/attachment.cgi?id=4136 now that PR5004 is
finished.

llvm-svn: 96304
2010-02-16 00:58:02 +00:00
Duncan Sands 9dff9bec31 Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy.  Requested by Chris!

llvm-svn: 96223
2010-02-15 16:12:20 +00:00
Jeffrey Yasskin 2d36eb6e18 Make JIT::runFunction clean up the generated stub function.
Patch by Shivram K!

llvm-svn: 96037
2010-02-12 23:05:31 +00:00
Jeffrey Yasskin e0913883b7 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!

llvm-svn: 95837
2010-02-11 01:07:39 +00:00
Dan Gohman 4a618827de Fix "the the" and similar typos.
llvm-svn: 95781
2010-02-10 16:03:48 +00:00
Jeffrey Yasskin 31faefff92 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().

llvm-svn: 95390
2010-02-05 16:19:36 +00:00
Jeffrey Yasskin 099552a0ca 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.

llvm-svn: 95236
2010-02-03 19:18:04 +00:00
Benjamin Kramer 29063eac23 Replace strcpy with memcpy when we have the length around anyway.
llvm-svn: 94746
2010-01-28 18:04:38 +00:00
Jeffrey Yasskin 091217be6f 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.

llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Chris Lattner 5fc4160ea3 Add support for target-specific 32-bit custom-lowered
jump table entries.

llvm-svn: 94505
2010-01-26 04:05:28 +00:00
Chris Lattner 7a2607026b 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.

llvm-svn: 94501
2010-01-26 03:47:15 +00:00
Chris Lattner b6db2c6b31 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.

llvm-svn: 94470
2010-01-25 23:26:13 +00:00
Chris Lattner 823aed16f9 make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Jeffrey Yasskin 690818fc27 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.

llvm-svn: 94245
2010-01-22 23:04:39 +00:00
Chris Lattner 7ba0661f27 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.

llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Devang Patel 1083b5fc3f Avoid including DebugInfo.h in AsmPrinter.h
llvm-svn: 93864
2010-01-19 06:09:04 +00:00
Devang Patel c0e17df3ce Replace DebugLocTuple with DILocation.
llvm-svn: 93630
2010-01-16 06:09:35 +00:00
Jay Foad bcbdbfb345 Fix http://llvm.org/PR6028, an assertion failure when an UndefValue of
integer type is used.

llvm-svn: 93509
2010-01-15 08:32:58 +00:00
Chris Lattner 25963c6113 "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!

llvm-svn: 93079
2010-01-09 22:27:07 +00:00
Benjamin Kramer d2564e3afb Move remaining stuff to the isInteger predicate.
llvm-svn: 92771
2010-01-05 21:05:54 +00:00
Benjamin Kramer a81a6dff0d Convert a ton of simple integer type equality tests to the new predicate.
llvm-svn: 92760
2010-01-05 20:07:06 +00:00
Benjamin Kramer ccce8bae14 Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
llvm-svn: 92726
2010-01-05 13:12:22 +00:00
David Greene 1df14c41b5 These should probably be errs().
llvm-svn: 92673
2010-01-05 01:53:59 +00:00
David Greene 0967d2df4a Change errs() to dbgs().
llvm-svn: 92621
2010-01-05 01:27:39 +00:00
David Greene 80c1cfb083 Change errs() to dbgs().
llvm-svn: 92618
2010-01-05 01:27:26 +00:00
David Greene 8121a81806 Change errs() to dbgs().
llvm-svn: 92616
2010-01-05 01:27:23 +00:00
David Greene 2baba9643c Change errs() to dbgs().
llvm-svn: 92562
2010-01-05 01:23:38 +00:00
David Greene 85814ac1b7 Change errs() to dbgs().
llvm-svn: 92561
2010-01-05 01:23:36 +00:00
David Greene 1c10c25354 Change errs() to dbgs().
llvm-svn: 92560
2010-01-05 01:23:34 +00:00
Bill Wendling 9bea533c8e Remove dead store and simplify code.
llvm-svn: 92191
2009-12-28 01:53:00 +00:00
Jeffrey Yasskin 6523429779 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.

llvm-svn: 91943
2009-12-22 23:47:23 +00:00
Jeffrey Yasskin ad46e4416b 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!

llvm-svn: 91939
2009-12-22 23:18:18 +00:00
Jeffrey Yasskin 2b73a4e90f Don't codegen available_externally functions. Fixes http://llvm.org/PR5735.
llvm-svn: 91626
2009-12-17 21:35:29 +00:00
Jeffrey Yasskin e0d8e14e11 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.

llvm-svn: 91464
2009-12-15 22:42:46 +00:00