1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

523 Commits

Author SHA1 Message Date
Chandler Carruth
c8e6351626 As Doug pointed out (and I really should know), it is perfectly easy to
make VariadicFunction actually be trivial. Do so, and also make it look
more like your standard trivial functor by making it a struct with no
access specifiers. The unit test is updated to initialize its functors
properly.

llvm-svn: 146827
2011-12-17 10:20:15 +00:00
Dylan Noblesmith
91b9af8f44 APInt: update asserts for base-36
Hexatridecimal was added in r139695.

And fix the unittest that now triggers the assert.

llvm-svn: 146754
2011-12-16 20:36:31 +00:00
Manuel Klimek
2f7cf4e64b Adds a JSON parser and a benchmark (json-bench) to catch performance regressions.
llvm-svn: 146735
2011-12-16 13:09:10 +00:00
Chandler Carruth
9ad7094a8c Put the '*' in the right place in the unit test. Forgot to fix up this
bit of style, sorry.

llvm-svn: 146733
2011-12-16 09:37:55 +00:00
Chandler Carruth
1cf4d2d1ae Add a generic collection of class templates to ADT for building
variadic-like functions in C++98. See the comments in the header file
for a more detailed description of how these work. We plan to use these
extensively in the AST matching library. This code and idea were
originally authored by Zhanyong Wan. I've condensed it using macros
to reduce repeatition and adjusted it to fit better with LLVM's ADT.

Thanks to both David Blaikie and Doug Gregor for the review!

llvm-svn: 146729
2011-12-16 08:58:59 +00:00
NAKAMURA Takumi
e7a3e38c9e Tweak CMake build on Cygwin.
llvm-svn: 146725
2011-12-16 06:21:08 +00:00
Daniel Dunbar
d2627d2855 build/unittests: Fix llvm-config names for gtest libraries, and bring Makefile
library names in line with those used by CMake.
 - Patch by Johannes Obermayr, with tweaks by me.

llvm-svn: 146706
2011-12-15 23:35:08 +00:00
Chad Rosier
dc87aebd3c Revert r146363 to allow buildbots to make forward progress.
Original commit message:
Support/FileSystem: Implement canonicalize.

llvm-svn: 146378
2011-12-12 17:58:31 +00:00
Michael J. Spencer
b6d86d4978 Support/FileSystem: Implement bool equivalent(file_status A, file_status B);
llvm-svn: 146364
2011-12-12 06:04:28 +00:00
Michael J. Spencer
fd161c5276 Support/FileSystem: Implement canonicalize.
llvm-svn: 146363
2011-12-12 06:04:01 +00:00
Dylan Noblesmith
abec08060e re-enable unittest
Accidentally left out since r145214/r145217.

llvm-svn: 146356
2011-12-12 04:20:41 +00:00
NAKAMURA Takumi
134987f6e7 unittests/Support/Path.cpp: [recursive_directory_iterator] Work around for end iterator.
FIXME: It should be more robust.
llvm-svn: 146294
2011-12-09 23:20:03 +00:00
Michael J. Spencer
fd9b0302a7 unittests/SupportTests: Fix test. pop modifies the current entry, thus the
dontlookhere check must be after it.

llvm-svn: 146217
2011-12-09 01:14:41 +00:00
Michael J. Spencer
4239ea1e2e unittests/SupportTests: Add some outs()'s to debug the issues on some bots.
I have run these tests under many configurations on the exact same OS as
the failures, and I can't reproduce them :(.

llvm-svn: 146214
2011-12-09 00:45:09 +00:00
Michael J. Spencer
d85f1f84f3 Support/FileSystem: Implement recursive_directory_iterator and make
directory_iterator preserve InputIterator semantics on copy.

llvm-svn: 146200
2011-12-08 22:50:09 +00:00
Nadav Rotem
1a91e4381d Add support for vectors of pointers.
llvm-svn: 145801
2011-12-05 06:29:09 +00:00
Dylan Noblesmith
6978c891cf unittests: add ErrorStr to ExecutionEngine test
Makes failures more self-explanatory.

llvm-svn: 145704
2011-12-02 20:53:53 +00:00
Eli Friedman
448be745f6 Fix APFloat::convert so that it handles narrowing conversions correctly; it
was returning incorrect values in rare cases, and incorrectly marking
exact conversions as inexact in some more common cases. Fixes PR11406, and a
missed optimization in test/CodeGen/X86/fp-stack-O0.ll.

llvm-svn: 145141
2011-11-26 03:38:02 +00:00
Nick Lewycky
d12c8cc065 Fix Windows build, don't try to #include <pthread.h> when we know it's not
available.

llvm-svn: 144574
2011-11-14 22:10:23 +00:00
Nick Lewycky
53185e9016 Add support for tsan annotations (thread sanitizer, a valgrind-based tool).
These annotations are disabled entirely when either ENABLE_THREADS is off, or
building a release build. When enabled, they add calls to functions with no
statements to ManagedStatic's getters.

Use these annotations to inform tsan that the race used inside ManagedStatic
initialization is actually benign. Thanks to Kostya Serebryany for helping
write this patch!

llvm-svn: 144567
2011-11-14 20:50:16 +00:00
NAKAMURA Takumi
91dabac407 unittests/MultiJITTest.cpp: Tweak how to check symbol value for Win32 --enable-shared.
getPointerToNamedFunction might be indirect jump on Win32 --enable-shared.
FF 25 <disp32>: jmp *(pointer to IAT)

llvm-svn: 144178
2011-11-09 08:30:43 +00:00
Benjamin Kramer
0638353f56 Implement comparison operators for BranchProbability in a way that can't overflow INT64_MAX.
Add a test case for the edge case that triggers this. Thanks to Chandler for bringing this to my attention.

llvm-svn: 142794
2011-10-24 13:50:56 +00:00
Benjamin Kramer
9adc582e35 Add compare operators to BranchProbability and use it to determine if an edge is hot.
llvm-svn: 142751
2011-10-23 11:19:14 +00:00
Chris Lattner
321335142c Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang does. Enhance
the X86 asmparser to produce ranges in the one case that was annoying me, for example:

test.s:10:15: error: invalid operand for instruction
movl 0(%rax), 0(%edx)
              ^~~~~~~

It should be straight-forward to enhance filecheck, tblgen, and/or the .ll parser to use 
ranges where appropriate if someone is interested.

llvm-svn: 142106
2011-10-16 04:47:35 +00:00
Benjamin Kramer
0c20486517 Add a bad char heuristic to StringRef::find.
Based on Horspool's simplified version of Boyer-Moore. We use a constant-sized table of
uint8_ts to keep cache thrashing low, needles bigger than 255 bytes are uncommon anyways.

The worst case is still O(n*m) but we do a lot better on the average case now.

llvm-svn: 142061
2011-10-15 10:08:31 +00:00
Eli Friedman
b70efeb6fc Attempt to fix MSVC build.
llvm-svn: 141831
2011-10-12 23:14:41 +00:00
Eli Friedman
cda27f4c18 Fix APFloat::getLargest so that it actually returns the correct value. Found by accident while reviewing a patch to nearby code.
llvm-svn: 141816
2011-10-12 21:51:36 +00:00
Eli Friedman
433785c651 Fix APInt::operator*= so that it computes the correct result for large integers where there is unsigned overflow. Fix APFloat::toString so that it doesn't depend on the incorrect behavior in common cases (and computes the correct result in some rare cases). Fixes PR11086.
llvm-svn: 141441
2011-10-07 23:40:49 +00:00
Nick Lewycky
6833d72fc0 The product of two chrec's can always be represented as a chrec.
llvm-svn: 141066
2011-10-04 06:51:26 +00:00
Jakob Stoklund Olesen
783b18e818 Fix a bug in compare_numeric().
Thanks to Alexandru Dura and Jonas Paulsson for finding it.

llvm-svn: 140859
2011-09-30 17:03:55 +00:00
Eli Friedman
3b5162de17 NULL cannot be portably used as the last argument to a function with __attribute((sentinel)), even though it usually works. Use (void*)0 instead. PR11002.
llvm-svn: 140720
2011-09-28 20:41:50 +00:00
Douglas Gregor
8c0777c5f3 Add APInt support for converting to/from hexatridecimal strings
llvm-svn: 139695
2011-09-14 15:54:46 +00:00
NAKAMURA Takumi
c7c5395326 unittests/Support/DataExtractorTest.cpp: Specify ULL explicitly to a few constants.
It seems i686-cygwin-gcc-4.3 does not accept 64-bit constant without LL.

llvm-svn: 139664
2011-09-13 23:23:49 +00:00
Benjamin Kramer
fcc23eeec7 Add the DataExtractor utility class.
It is an endian-aware helper that can read data from a StringRef. It will
come in handy for DWARF parsing. This class is inspired by LLDB's
DataExtractor, but is stripped down to the bare minimum needed for DWARF.

Comes with unit tests!

llvm-svn: 139626
2011-09-13 19:42:16 +00:00
Andrew Trick
8b968beebd Exclude more arm jit failures pending PR10783.
llvm-svn: 139074
2011-09-03 01:08:35 +00:00
Jeffrey Yasskin
8f36e758c2 Fix C++0x narrowing errors when char is unsigned.
In the case of EDInstInfo, this would actually cause a bug when -1 became 255
and was then compared >=0 in llvm-mc/Disassembler.cpp.

llvm-svn: 138825
2011-08-30 20:53:29 +00:00
Matt Beaumont-Gay
f26343ced2 Fix a test that wasn't testing the right thing.
The APFloat "Zero" test was actually calling the
APFloat(const fltSemantics &, integerPart) constructor, and EXPECT_EQ was
treating 0 and -0 as equal.

llvm-svn: 138745
2011-08-29 17:54:20 +00:00
John McCall
19f9288b81 The 'expected' argument to EXPECT_EQ is actually the first one;
flip these tests around.

llvm-svn: 138708
2011-08-27 19:23:22 +00:00
Andrew Trick
eb9fa3f9bc Excluding ARM JIT tests until someone can fix this compilation path.
llvm-svn: 138676
2011-08-26 23:39:30 +00:00
Evan Cheng
420bf5446c Move TargetRegistry and TargetSelect from Target to Support where they belong.
These are strictly utilities for registering targets and components.

llvm-svn: 138450
2011-08-24 18:08:43 +00:00
Duncan Sands
652364a5ec Avoid undefined behaviour if somehow NUM_GRAPHS equals 2^32 (or
whatever the size of unsigned is), though this can't actually
occur for any integer value of NUM_NODES.

llvm-svn: 136460
2011-07-29 07:50:02 +00:00
Jakub Staszak
ba1160825b Remove extra semicolon.
llvm-svn: 136432
2011-07-29 00:05:35 +00:00
Duncan Sands
cfca795839 Use unsigned rather than uint16_t in case anyone feels like testing
more graphs, like all graphs with 5 nodes or less.  With a 32 bit
unsigned type, the maximum is graphs with 6 nodes or less, but that
would take a while to test - 5 nodes or less already requires a few
seconds.

llvm-svn: 136354
2011-07-28 14:37:53 +00:00
Duncan Sands
bda9b8bd4b Check an additional property specific to the way LLVM
iterates over SCC's.

llvm-svn: 136353
2011-07-28 14:33:01 +00:00
Duncan Sands
f9a0cc2e7b Add a unittest for the simply connected components (SCC) iterator class.
This computes every graph with 4 or fewer nodes, and checks that the SCC
class indeed returns exactly the simply connected components reachable
from the initial node.

llvm-svn: 136351
2011-07-28 14:17:11 +00:00
Jakub Staszak
4e897c8ac3 Add test cases for BlockFrequency.
llvm-svn: 136244
2011-07-27 18:57:40 +00:00
Jay Foad
0312e901da Remove some code that is no longer needed now that googletest knows how
to print STL containers.

llvm-svn: 136213
2011-07-27 09:26:13 +00:00
Jeffrey Yasskin
8a0f9f17a3 Explicitly cast narrowing conversions inside {}s that will become errors in
C++0x.

llvm-svn: 136211
2011-07-27 06:22:51 +00:00
Jay Foad
6513dac6e2 Convert GetElementPtrInst to use ArrayRef.
llvm-svn: 135904
2011-07-25 09:48:08 +00:00
Chris Lattner
0e3472660b Add Twine support for characters, and switch twine to use a union internally
to eliminate some casting.

llvm-svn: 135888
2011-07-24 20:44:30 +00:00