Commit Graph

301 Commits

Author SHA1 Message Date
Dan Gohman e69b99baaf Implement operators |=, &=, and ^= for SmallBitVector, and remove the
restriction in BitVector for |= and ^= that the operand must be the
same length.

llvm-svn: 95768
2010-02-10 05:54:04 +00:00
Dale Johannesen 7c7b9a2807 Disable unittests/ADT/BitVectorTest on PPC Darwin.
It fails with a release build only, for reasons
as yet unknown.  (If there's a better way to Xfail
things here let me know, doesn't seem to be any
prior art in unittests.)

llvm-svn: 95700
2010-02-09 22:15:27 +00:00
Jeffrey Yasskin ddfe8092e9 Add support for TypeBuilder<const/volatile void*, false>.
Thanks to Jochen Wilhelmy for the suggestion!

llvm-svn: 95677
2010-02-09 19:07:19 +00:00
John McCall df951bddb8 Make APInt::countLeadingZerosSlowCase() treat the contents of padding bits
as undefined.  Fixes an assertion in APFloat::toString noticed by Dale.

llvm-svn: 95196
2010-02-03 03:42:44 +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
Jeffrey Yasskin 6d7deae2df Roll r94484 (avoiding RTTI problems in tests) forward again in a way that isn't
broken by setting CXXFLAGS on the command line.

llvm-svn: 94619
2010-01-26 23:30:46 +00:00
Bob Wilson 9c71bb03f3 Revert 94484. Re-disable unittests that need RTTI.
llvm-svn: 94569
2010-01-26 19:04:37 +00:00
Jeffrey Yasskin 9f4d96ccc7 Re-enable unit tests disabled in r94164 by telling GTest about the
lack of RTTI.

llvm-svn: 94484
2010-01-26 01:26:46 +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
Torok Edwin fbcd2c76d5 Fix TimeValue::now() on Unix.
TimeValue()::now().toEpochTime() is supposed to be the same as time(),
but it wasn't, because toEpoch subtracted PosixZeroTime, but now()
didn't add PosixZeroTime!
Add a unittest to check this works.

llvm-svn: 94178
2010-01-22 15:51:31 +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 e307348325 NamedMDNode is a collection MDNodes.
llvm-svn: 92761
2010-01-05 20:41:31 +00:00
Dan Gohman 5976e7d5dd Add a SmallBitVector class, which mimics BitVector but uses only
a single pointer (PointerIntPair) member. In "small" mode, the
pointer field is reinterpreted as a set of bits. In "large" mode,
the pointer points to a heap-allocated object.

Also, give BitVector empty and swap functions.

And, add some simple unittests for BitVector and SmallBitVector.

llvm-svn: 92730
2010-01-05 15:04:49 +00:00
Benjamin Kramer 738800dd1d Silence compiler warning.
warning: comparison between signed and unsigned integer expressions
llvm-svn: 92359
2009-12-31 16:27:13 +00:00
Douglas Gregor 5639af4eac Document the edit-distance algorithm used in StringRef, switch it over
to SmallVector, and add a unit test.

llvm-svn: 92340
2009-12-31 04:24:34 +00:00
Chris Lattner 1e6e36785e don't unittest mdnode printing, we have disassembler tests for this.
llvm-svn: 92328
2009-12-31 02:12:13 +00:00
Chris Lattner 9b493028df rename "elements" of metadata to "operands". "Elements" are
things that occur in types.  "operands" are things that occur
in values.

llvm-svn: 92322
2009-12-31 01:22:29 +00:00
John McCall dd5044ac55 Implement support for converting to string at "natural precision", and fix some
major bugs in long-precision conversion.

llvm-svn: 92150
2009-12-24 23:18:09 +00:00
Douglas Gregor 4ee2cf658c Move the two definitions of operator<< into namespace llvm, so they
will be found by argument-dependent lookup. As with the previous
commit, GCC is allowing ill-formed code.

llvm-svn: 92146
2009-12-24 21:15:37 +00:00
Douglas Gregor 1f21000902 Define the new operator<< for sets into namespace std, so that
argument-dependent lookup can find it. This is another case where an
LLVM bug (not making operator<< visible) was masked by a GCC bug
(looking in the global namespace when it shouldn't).

llvm-svn: 92144
2009-12-24 21:11:45 +00:00
John McCall 29b5c284ae Add accessors for the largest-magnitude, smallest-magnitude, and
smallest-normalized-magnitude values in a given FP semantics.
Provide an APFloat-to-string conversion which I am quite ready to admit could
be much more efficient.

llvm-svn: 92126
2009-12-24 08:56:26 +00:00
Jeffrey Yasskin 60958a1e56 Disable JITTest.FunctionIsRecompiledAndRelinked on ARM where it's not
implemented.

llvm-svn: 91963
2009-12-23 00:58:02 +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
Eli Friedman 00879d8faa Change StringRef::startswith and StringRef::endswith to versions which are a
bit more verbose, but optimize to much shorter code.

llvm-svn: 91817
2009-12-21 06:49:24 +00:00
Rafael Espindola 2c5792a6bd Catch more cases of a pointer being marked garbage twice. This helps when
debugging some leaks (PR5770 in particular).

llvm-svn: 91713
2009-12-18 20:35:38 +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 28f244863e This fixes a memory leak in OpaqueType found by Google's internal heapchecker.
llvm-svn: 91611
2009-12-17 19:55:06 +00:00
Jeffrey Yasskin 8c17e6de2b 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.

llvm-svn: 91250
2009-12-13 20:30:32 +00:00
Jeffrey Yasskin 9ad6ba3766 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.

llvm-svn: 91209
2009-12-12 06:18:46 +00:00
Jeffrey Yasskin 2d2dcdcbf7 Fix available_externally linkage for globals. It's probably still not
supported by emitGlobals, but I don't have a test case for that.

llvm-svn: 91208
2009-12-12 05:58:14 +00:00
Daniel Dunbar ff53d4694c Add an implementation of the delta debugging algorithm.
- This is a pretty slow / memory intensive implementation, and I will likely
   change it to an iterative model, but it works.

llvm-svn: 90447
2009-12-03 11:12:42 +00:00
Jeffrey Yasskin 9c2d34012d Oops. Re-disable JITTest.NoStubs on ARM and PPC since they still use stubs to
make far calls work.

llvm-svn: 89733
2009-11-24 02:11:14 +00:00
Jeffrey Yasskin f2ad571443 * Move stub allocation inside the JITEmitter, instead of exposing a
way for each TargetJITInfo subclass to allocate its own stubs. This
means stubs aren't as exactly-sized anymore, but it lets us get rid of
TargetJITInfo::emitFunctionStubAtAddr(), which lets ARM and PPC
support the eager JIT, fixing http://llvm.org/PR4816.

* Rename the JITEmitter's stub creation functions to describe the kind
of stub they create. So far, all of them create lazy-compilation
stubs, but they sometimes get used when far-call stubs are needed.
Fixing http://llvm.org/PR5201 will involve fixing this.

llvm-svn: 89715
2009-11-23 23:35:19 +00:00
Duncan Sands c8cee4f64f Only run this mutex test if threading is enabled. This
fixes PR5395.

llvm-svn: 89385
2009-11-19 20:48:14 +00:00
Benjamin Kramer 99b5bd9074 Reenable Split2 StringRef test with Apple gcc.
llvm-svn: 89357
2009-11-19 16:04:41 +00:00
Daniel Dunbar 1acdfbd60b "XFAIL" the Split2 StringReft test with Apple gcc, which miscompiles it.
- I plan on fixing/workarounding this, but until then I'd like the bots to stay
   green.

llvm-svn: 89077
2009-11-17 09:29:59 +00:00
Jeffrey Yasskin 0632b53bfe Revert the test from r88984. It relies on being able to mmap 16GB of
address space (though it only uses a small fraction of that), and the
buildbots disallow that.

Also add a comment to the Makefile's ulimit line warning future
developers that changing it won't work.

llvm-svn: 88994
2009-11-16 23:32:30 +00:00
Jeffrey Yasskin 10d3604a9e Make X86-64 in the Large model always emit 64-bit calls.
The large code model is documented at
http://www.x86-64.org/documentation/abi.pdf and says that calls should
assume their target doesn't live within the 32-bit pc-relative offset
that fits in the call instruction.

To do this, we turn off the global-address->target-global-address
conversion in X86TargetLowering::LowerCall(). The first attempt at
this broke the lazy JIT because it can separate the movabs(imm->reg)
from the actual call instruction. The lazy JIT receives the address of
the movabs as a relocation and needs to record the return address from
the call; and then when that call happens, it needs to patch the
movabs with the newly-compiled target. We could thread the call
instruction into the relocation and record the movabs<->call mapping
explicitly, but that seems to require at least as much new
complication in the code generator as this change.

To fix this, we make lazy functions _always_ go through a call
stub. You'd think we'd only have to force lazy calls through a stub on
difficult platforms, but that turns out to break indirect calls
through a function pointer. The right fix for that is to distinguish
between calls and address-of operations on uncompiled functions, but
that's complex enough to leave for someone else to do.

Another attempt at this defined a new CALL64i pseudo-instruction,
which expanded to a 2-instruction sequence in the assembly output and
was special-cased in the X86CodeEmitter's emitInstruction()
function. That broke indirect calls in the same way as above.

This patch also removes a hack forcing Darwin to the small code model.
Without far-call-stubs, the small code model requires things of the
JITMemoryManager that the DefaultJITMemoryManager can't provide.

Thanks to echristo for lots of testing!

llvm-svn: 88984
2009-11-16 22:41:33 +00:00
Benjamin Kramer 4197054ece This test doesn't work on arm either.
llvm-svn: 88794
2009-11-14 15:15:39 +00:00
Bill Wendling 6787318557 Disable the JITTest.NoStubs test for Darwin PPC. It apparently doesn't implement
emitFunctionStubAtAddr.

llvm-svn: 88708
2009-11-13 21:58:54 +00:00
Rafael Espindola ff2c72b858 Distinguish "a," from "a". The first one splits into "a" + "" and the second one into
"a" + 0.

llvm-svn: 87084
2009-11-13 04:55:09 +00:00
Rafael Espindola 7c6854995d Switch to smallvector. Also fix issue with using unsigend for MaxSplit.
llvm-svn: 87068
2009-11-13 02:18:25 +00:00
Rafael Espindola d554e44092 Add a new split method to StringRef that puts the substrings in a vector.
llvm-svn: 87058
2009-11-13 01:24:40 +00:00
Eric Christopher cb5e227373 Use stubs when we have them, otherwise use code we already have,
otherwise create a stub.

Add a test to make sure we don't create extraneous stubs.

llvm-svn: 86941
2009-11-12 03:12:18 +00:00
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
Jeffrey Yasskin ccbeaf5f94 Make TypeBuilder's result depend on the LLVMContext it's passed.
TypeBuilder was using a local static variable to cache its result. This made it
ignore changes in its LLVMContext argument and always return a type constructed
from the argument to the first call.

llvm-svn: 81316
2009-09-09 05:04:01 +00:00
Daniel Dunbar 8feee907e4 Update unittests for MDNode uniquing disable.
llvm-svn: 81142
2009-09-07 04:19:02 +00:00
Daniel Dunbar da30ecdcdd Simplify, now that gtest supports raw_ostream directly.
llvm-svn: 81102
2009-09-06 02:31:26 +00:00
Nick Lewycky d592399beb Now that googletest can print ConstantRange, use EXPECT_EQ when testing for
equality. Prefer EXPECT_EQ(foo, Full) over EXPECT_TRUE(foo.isFullSet()) because
the former will print out the contents of the constant range that failed.

llvm-svn: 81094
2009-09-05 18:27:40 +00:00
Jeffrey Yasskin b797fdc365 Teach googletest to use raw_ostream instead of just std::ostream.
This can break when there are implicit conversions from types raw_ostream
understands but std::ostream doesn't, but it increases the number of cases that
Just Work.

llvm-svn: 81093
2009-09-05 18:16:17 +00:00