Commit Graph

206 Commits

Author SHA1 Message Date
Jeffrey Yasskin e822c99eaa Fix JITTest.ModuleDeletion in -Asserts mode (which turns off JITEmitDebugInfo
by default).

llvm-svn: 86807
2009-11-11 05:30:02 +00:00
Daniel Dunbar 9806e4ab20 Add From arguments to StringRef search functions, and tweak doxyments.
Also, add unittests for find_first_of and find_first_not_of.

llvm-svn: 86770
2009-11-11 00:28:53 +00:00
Jeffrey Yasskin b40d3f76a0 Fix DenseMap iterator constness.
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.

The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.

Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.

Patch by Victor Zverovich!

llvm-svn: 86636
2009-11-10 01:02:17 +00:00
Jeffrey Yasskin 8483f12ac5 Remove dlsym stubs, with Nate Begeman's permission.
llvm-svn: 86606
2009-11-09 22:34:19 +00:00
Jeffrey Yasskin 7e30b39c67 Fix the ModuleDeletion test on PPC and ARM.
llvm-svn: 85352
2009-10-28 00:28:31 +00:00
Jeffrey Yasskin aa8814a877 Revert the API changes from r85295 to make it easier for people to build
against both 2.6 and HEAD.  The default is still changed to eager jitting.

llvm-svn: 85330
2009-10-27 22:39:42 +00:00
Devang Patel 11cf3f4a27 Factor out redundancy from clone() implementations.
llvm-svn: 85327
2009-10-27 22:16:29 +00:00
Jeffrey Yasskin 4567db45b8 Change the JIT to compile eagerly by default as agreed in
http://llvm.org/PR5184, and beef up the comments to describe what both options
do and the risks of lazy compilation in the presence of threads.

llvm-svn: 85295
2009-10-27 20:30:28 +00:00
Chris Lattner 26a7ae4fba Type.h doesn't need to #include LLVMContext.h
llvm-svn: 85254
2009-10-27 17:08:31 +00:00
Jeffrey Yasskin bf43f6543d Automatically do the equivalent of freeMachineCodeForFunction(F) when F is
being destroyed. This allows users to run global optimizations like globaldce
even after some functions have been jitted.

This patch also removes the Function* parameter to
JITEventListener::NotifyFreeingMachineCode() since it can cause that to be
called when the Function is partially destroyed. This change will be even more
helpful later when I think we'll want to allow machine code to actually outlive
its Function.

llvm-svn: 85182
2009-10-27 00:03:05 +00:00
Julien Lerouge d0c160e36c Remove / use flags that are now set in the Makefile.config.
llvm-svn: 85149
2009-10-26 20:01:35 +00:00
Chandler Carruth 56869f22c4 Move DataTypes.h to include/llvm/System, update all users. This breaks the last
direct inclusion edge from System to Support.

llvm-svn: 85086
2009-10-26 01:35:46 +00:00
Jeffrey Yasskin d0fc8f809a Fix http://llvm.org/PR4822: allow module deletion after a function has been
compiled.

When functions are compiled, they accumulate references in the JITResolver's
stub maps. This patch removes those references when the functions are
destroyed.  It's illegal to destroy a Function when any thread may still try to
call its machine code.

This patch also updates r83987 to use ValueMap instead of explicit CallbackVHs
and fixes a couple "do stuff inside assert()" bugs from r84522.

llvm-svn: 84975
2009-10-23 22:37:43 +00:00
Jeffrey Yasskin 61ade25834 Fix stylistic and documentation problems in ValueMap found by Nick Lewycky and
Evan Cheng.

llvm-svn: 84967
2009-10-23 20:54:00 +00:00
Jeffrey Yasskin 4546d31235 Try r84890 again (adding ValueMap<>), now that I've tested the compile on
gcc-4.4.

llvm-svn: 84902
2009-10-22 22:11:22 +00:00
Jeffrey Yasskin 66db004d7e Revert r84890, which broke the linux build.
llvm-svn: 84892
2009-10-22 20:23:43 +00:00
Jeffrey Yasskin 6b80e6e2b7 Add a ValueMap<ValueOrSubclass*, T> type. ValueMap<Value*, T> is safe to use
even when keys get RAUWed and deleted during its lifetime. By default the keys
act like WeakVHs, but users can pass a third template parameter to configure
how updates work and whether to do anything beyond updating the map on each
action.

It's also possible to automatically acquire a lock around ValueMap updates
triggered by RAUWs and deletes, to support the ExecutionEngine.

llvm-svn: 84890
2009-10-22 20:10:20 +00:00
Jeffrey Yasskin 27c669242a Move the Function*->allocated blocks map from the JITMemoryManager to the
JITEmitter.

I'm gradually making Functions auto-remove themselves from the JIT when they're
destroyed. In this case, the Function needs to be removed from the JITEmitter,
but the map recording which Functions need to be removed lived behind the
JITMemoryManager interface, which made things difficult.

This patch replaces the deallocateMemForFunction(Function*) method with a pair
of methods deallocateFunctionBody(void *) and deallocateExceptionTable(void *)
corresponding to the two startFoo/endFoo pairs.

llvm-svn: 84651
2009-10-20 18:13:21 +00:00
Daniel Dunbar 7e858573a8 PowerPC ifdef'ing considered more complicated than one might like.
llvm-svn: 84603
2009-10-20 05:33:23 +00:00
Nick Lewycky 393c71cdd7 Correct test for PowerPC.
llvm-svn: 84595
2009-10-20 04:09:50 +00:00
Daniel Dunbar b16c77cbd3 Also check for __POWERPC__ when skipping these tests.
llvm-svn: 84482
2009-10-19 09:19:32 +00:00
Daniel Dunbar 4108c43fd1 Add raw_ostream::write_escaped, for writing escaped strings.
llvm-svn: 84355
2009-10-17 20:43:08 +00:00
Benjamin Kramer 01b48676cd Disable another unittest that doesn't work on arm and ppc.
llvm-svn: 84186
2009-10-15 16:49:16 +00:00
Nick Lewycky a39f121155 The ARM and PowerPC jits are broken in this regard.
llvm-svn: 84128
2009-10-14 20:04:41 +00:00
Jeffrey Yasskin d162dbac7f Keep track of stubs that are created. This fixes PR5162 and probably PR4822 and
4406. Patch by Nick Lewycky!

llvm-svn: 84032
2009-10-13 21:32:57 +00:00
Jeffrey Yasskin f98e981cd0 Make the ExecutionEngine automatically remove global mappings on when their
GlobalValue is destroyed.  Function destruction still leaks machine code and
can crash on leaked stubs, but this is some progress.

llvm-svn: 83987
2009-10-13 17:42:08 +00:00
Duncan Sands f7ad620c62 Pacify the compiler (signed with unsigned comparison) by making
these constants unsigned.

llvm-svn: 83962
2009-10-13 09:23:11 +00:00
Dan Gohman c4e367b854 Add a ceilLogBase2 function to APInt.
llvm-svn: 83932
2009-10-13 01:49:02 +00:00
Jeffrey Yasskin 406ac811ab Fix http://llvm.org/PR5160, to let CallbackVHs modify other ValueHandles on the
same Value without breaking things.

llvm-svn: 83861
2009-10-12 17:43:32 +00:00
Jeffrey Yasskin 307c053f2e ExecutionEngine::clearGlobalMappingsFromModule failed to remove reverse
mappings, which could cause errors and assert-failures.  This patch fixes that,
adds a test, and refactors the global-mapping-removal code into a single place.

llvm-svn: 83678
2009-10-09 22:10:27 +00:00
Jeffrey Yasskin 531ccba54e Fix illegal cross-type aliasing. Found by baldrick on a newer gcc.
llvm-svn: 83401
2009-10-06 19:06:16 +00:00
Duncan Sands 9ed7b16bf3 Introduce and use convenience methods for getting pointer types
where the element is of a basic builtin type.  For example, to get
an i8* use getInt8PtrTy.

llvm-svn: 83379
2009-10-06 15:40:36 +00:00
Jeffrey Yasskin e97fe329e9 Fix http://llvm.org/PR5116 by rolling back r60822. This passes `make unittests
check-lit` on both x86-64 Linux and x86-32 Darwin.

llvm-svn: 83353
2009-10-06 00:35:55 +00:00
Benjamin Kramer 8de74bbbd8 Try to fix unit test linking on linux ...
llvm-svn: 83252
2009-10-02 19:52:33 +00:00
Benjamin Kramer f01ee30328 MingW build fixes
- MingW needs -lpsapi (in ${LIBS}) linked after -lLLVMSystem.
  Noticed by Ronald Pijnacker!

- Some parts of the System library must be build with exceptions on windows.
  Based on a patch by Jay Foad!

llvm-svn: 83251
2009-10-02 19:36:31 +00:00
Nick Lewycky 1f71578e0d New unit test for the cloning module, which so far only covers cloning of
instructions' optimization flags.

llvm-svn: 82934
2009-09-27 21:39:46 +00:00
Nick Lewycky 199c563cc8 Link order: it matters.
llvm-svn: 82925
2009-09-27 20:58:01 +00:00
Chris Lattner 37d8015dc1 remove support for "NoSub" from regex. It seems like a minor optimization
and makes the API more annoying.  Add a Regex::getNumMatches() method.

llvm-svn: 82877
2009-09-26 21:27:04 +00:00
Jeffrey Yasskin 14a5cc54e5 Fix a compile failure introduced by r82675 on MinGW which doesn't have
setenv().  This patch just disables the test rather than getting putenv() to
work.  Thanks to Sandeep Patel for reporting the problem.

llvm-svn: 82797
2009-09-25 21:07:20 +00:00
Chris Lattner f08d2db928 add and document regex support for FileCheck. You can now do stuff like:
; CHECK: movl {{%e[a-z][xi]}}, %eax

or whatever.

llvm-svn: 82717
2009-09-24 21:47:32 +00:00
Jeffrey Yasskin a75d6bf3a8 Roll back r82348, which introduced an infinite loop in ParseCStringVector() that
a trivial unittest would have caught.  This revision also adds the trivial
unittest.

llvm-svn: 82675
2009-09-24 01:14:07 +00:00
Daniel Dunbar 73e76a1d60 Fix a few more conversion warnings on 4.0
llvm-svn: 82232
2009-09-18 17:48:05 +00:00
Daniel Dunbar 0ec4ed7b74 Another try at fixing compile warnings on 4.0
llvm-svn: 82148
2009-09-17 17:46:53 +00:00
Daniel Dunbar 4498168753 Add StringRef::{rfind, rsplit}
llvm-svn: 82087
2009-09-16 22:38:48 +00:00
Daniel Dunbar 316b4a0206 Drop the raw_ostream required buffer size to 1.
- As best I can tell, we have eliminated all the code which used to require a
   larger buffer size.

llvm-svn: 81912
2009-09-15 20:31:46 +00:00
Daniel Dunbar 6ced391121 Attempt to fix some 4.0.0 build warnings.
llvm-svn: 81752
2009-09-14 02:38:53 +00:00
Daniel Dunbar 96ccc47a13 Build (not test) the unittests as part of a normal build.
- 'make unittests' still builds and tests.
 - 'make unitcheck' inside a unittest directory runs the tests in that directory.

llvm-svn: 81725
2009-09-13 22:39:27 +00:00
Daniel Dunbar 6be903e185 Move unittest driver to utils/unittest/UnitTestMain.
- This eliminates a race between building the unittests and linking the
   UnitTestMain library.

llvm-svn: 81719
2009-09-13 21:31:21 +00:00
Daniel Dunbar 63f5a77822 Revert unittests build changes temporarily, the unit test build isn't -j safe.
llvm-svn: 81692
2009-09-13 18:58:14 +00:00
Daniel Dunbar 37af2a9588 Build (not test) the unittests as part of a normal build.
- 'make unittests' still builds and tests.
 - 'make unitcheck' inside a unittest directory runs the tests in that directory.

llvm-svn: 81687
2009-09-13 18:43:46 +00:00