1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

1564 Commits

Author SHA1 Message Date
Chris Lattner
2cfc29b28d regexes are allowed to match empty things, e.g. {{.*}} in filecheck.
llvm-svn: 129193
2011-04-09 06:29:24 +00:00
Frits van Bommel
51604bed0f Fix a few instances of "warning: extra ';' outside of a function [-pedantic]".
llvm-svn: 129002
2011-04-06 12:29:56 +00:00
Roman Divacky
52e462b5e5 Add support for detection of Intel SandyBridge.
llvm-svn: 128920
2011-04-05 20:25:36 +00:00
Andrew Trick
7e2e555075 Added *hidden* flags -print-options and -print-all-options so
developers can see if their driver changed any cl::Option's. The
current implementation isn't perfect but handles most kinds of
options. This is nice to have when decomposing the stages of
compilation and moving between different drivers. It's also a good
sanity check when comparing results produced by different command line
invocations that are expected to produce the comparable results.

Note: This is not an attempt to prolong the life of cl::Option. On the
contrary, it's a placeholder for a feature that must exist when
cl::Option is replaced by a more appropriate framework. A new
framework needs: a central option registry, dynamic name lookup,
non-global containers of option values (e.g. per-module,
per-function), *and* the ability to print options values and their defaults at
any point during compilation.

llvm-svn: 128910
2011-04-05 18:54:36 +00:00
Eric Christopher
0e88a490eb Assorted bugfixes in object file handling:
- Adds support for sniffing PE/COFF files on win32 (.exe and .dll)
   which are COFF files that have an MS-DOS compatibility stub on
   the front of them.

 - Fixes a bug in the COFFObjectFile's support for the Microsoft COFF
   extension for long symbol names, wherein it was attempting to parse
   the leading '/' in an extended symbol name reference as part of the
   integer offset.

 - Fixes bugs in COFFObjectFile and ELFObjectFile wherein section
   and symbol iterators were being returned with uninitialized bytes;
   the type DataRefImpl is a union between 2 32-bit words (d.a and d.b)
   and a single intptr_t word (p). Only p was being initialized, so in
   32-bit builds the result would be iterators with random upper 32-bit
   words in their DataRefImpls. This caused random failures when
   seeking around in object files.

Patch by Graydon Hoare!

llvm-svn: 128799
2011-04-03 22:53:19 +00:00
Jakob Stoklund Olesen
37134e568d Reset StringMap's NumTombstones on clears and rehashes.
StringMap was not properly updating NumTombstones after a clear or rehash.

This was not fatal until now because the table was growing faster than
NumTombstones could, but with the previous change of preventing infinite
growth of the table the invariant (NumItems + NumTombstones <= NumBuckets)
stopped being observed, causing infinite loops in certain situations.

Patch by José Fonseca!

llvm-svn: 128567
2011-03-30 18:32:51 +00:00
Jakob Stoklund Olesen
b4df99dc06 Prevent infinite growth of SmallPtrSet instances.
Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

llvm-svn: 128566
2011-03-30 18:32:48 +00:00
Jakob Stoklund Olesen
0daa5f56cb Prevent infinite growth of SmallMap instances.
Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

llvm-svn: 128565
2011-03-30 18:32:44 +00:00
Benjamin Kramer
e6e5b11a65 Avoid turning a floating point division with a constant power of two into a denormal multiplication.
Some platforms may treat denormals as zero, on other platforms multiplication
with a subnormal is slower than dividing by a normal.

llvm-svn: 128555
2011-03-30 17:02:54 +00:00
Benjamin Kramer
7888d0935d Add APFloat::getExactInverse.
The idea is, that if an ieee 754 float is divided by a power of two, we can
turn the division into a cheaper multiplication. This function sees if we can
get an exact multiplicative inverse for a divisor and returns it if possible.

This is the hard part of PR9587.

I tested many inputs against llvm-gcc's frotend implementation of this
optimization and didn't find any difference. However, floating point is the
land of weird edge cases, so any review would be appreciated.

llvm-svn: 128545
2011-03-30 15:42:27 +00:00
Frits van Bommel
c234349939 Constant folding support for calls to umul.with.overflow(), basically identical to the smul.with.overflow() code.
llvm-svn: 128379
2011-03-27 14:26:13 +00:00
Andrew Trick
a50ee2e148 revert r128199 until it can be made to work with Frontend/dependency-gen.c.
llvm-svn: 128218
2011-03-24 16:43:37 +00:00
Michael J. Spencer
3314c920a5 Remove all uses of PATH_MAX and MAXPATHLEN from PathV2.
llvm-svn: 128199
2011-03-24 05:23:40 +00:00
Rafael Espindola
9e0fcfc02b We don't need a null terminator for the output file.
llvm-svn: 128098
2011-03-22 19:20:47 +00:00
Ted Kremenek
d582517a58 Properly initialize all fields in CrashReporterCleanupContext. This caused the buildbot failure earlier.
llvm-svn: 128071
2011-03-22 04:33:13 +00:00
Ted Kremenek
33f7ecabd4 Temporarily stop recovering resources in CrashRecoveryContext while I investigate further why this works on my machine and not on others.
llvm-svn: 128065
2011-03-22 02:06:32 +00:00
Ted Kremenek
a462a53e0b Provide a means for CrashRecovery clients to determine if code is currently running while crash recovery cleanups are being processed.
llvm-svn: 128008
2011-03-21 18:38:03 +00:00
Benjamin Kramer
dd8cb156c1 Avoid initializing posix_spawn_file_actions_t if not used.
- glibc falls back to fork+exec if a file actions object is present.
- On BSDs this saves a malloc.

llvm-svn: 127969
2011-03-20 15:52:24 +00:00
Ted Kremenek
c4fa37479a Tweak CrashRecoveryContextCleanup to provide an easy method for clients to select between 'delete' and 'destructor' cleanups, and allow the destructor of CrashRecoveryContextCleanupRegister to be pseudo re-entrant.
llvm-svn: 127929
2011-03-19 00:59:37 +00:00
Ted Kremenek
be390d8777 Tweak CrashRecoveryContext::GetCurrent() to return quickly if 'gCrsahRecoveryEnabled' is false. This avoids us needing to go to thread local storage for
the performance sensitive case where we are compiling code.

llvm-svn: 127928
2011-03-19 00:59:33 +00:00
Jim Grosbach
b89c5053bf setExecutable() should default to success if there's nothing custom for it.
llvm-svn: 127891
2011-03-18 18:51:03 +00:00
NAKAMURA Takumi
cdd69c874f raw_ostream: [PR6745] Tweak formatting (double)%e for Windows hosts.
On MSVCRT and compatible, output of %e is incompatible to Posix by default. Number of exponent digits should be at least 2. "%+03d"

FIXME: Implement our formatter in future!
llvm-svn: 127872
2011-03-18 09:30:10 +00:00
Bill Wendling
8a983f8c3f Initialize the only-used-with-PPC-double-double parts of the APFloat class. This
makes valgrind stop complaining about uninitialized variables being read when it
accesses a bitfield (category) that shares its bits with these variables.

llvm-svn: 127871
2011-03-18 09:09:44 +00:00
Rafael Espindola
33eddc52d3 Check RequiresNullTerminator first, or we might read from an invalid address.
llvm-svn: 127853
2011-03-18 02:55:51 +00:00
Ted Kremenek
1a2fa05e5f Augment CrashRecoveryContext to have registered "cleanup" objects that can be used to release resources during a crash.
llvm-svn: 127849
2011-03-18 02:05:11 +00:00
Rafael Espindola
3ecf930d14 Use RequiresNullTerminator to create buffers without a null terminator
instead of copying.

llvm-svn: 127835
2011-03-17 22:18:42 +00:00
Benjamin Kramer
a85996c235 Add an argument to APInt's magic udiv calculation to specify the number of bits that are known zero in the divided number.
This will come in handy soon.

llvm-svn: 127828
2011-03-17 20:39:06 +00:00
NAKAMURA Takumi
341bf54557 lib/Support/raw_ostream.cpp: On mingw, report_fatal_error() should not be called at dtor context.
report_fatal_error() invokes exit(). We know report_fatal_error() might not write messages to stderr when any errors were detected on FD == 2.

llvm-svn: 127726
2011-03-16 02:53:39 +00:00
NAKAMURA Takumi
bcbcf099b4 Windows/PathV2.inc: [PR8520] Recognize "NUL" as special (character) file.
FIXME: It is a temporal hack. We should detect as many "special file name" as possible.
llvm-svn: 127724
2011-03-16 02:53:32 +00:00
NAKAMURA Takumi
042801b7d2 Windows/Path.inc: [PR6270] PathV1::makeUnique(): Give arbitrary initial seed for workaround.
FIXME: We should use sys::fs::unique_file() in future.
llvm-svn: 127723
2011-03-16 02:53:24 +00:00
John Thompson
da294e31da Add scei vendor
llvm-svn: 127705
2011-03-15 21:51:56 +00:00
Rafael Espindola
222ccb2bdd Don't compute the file size if we don't need to.
llvm-svn: 127426
2011-03-10 20:54:07 +00:00
Rafael Espindola
a271db1a12 Add r127409 back now that the windows file was updated.
llvm-svn: 127417
2011-03-10 18:33:29 +00:00
Rafael Espindola
11ae298b4f Try to fix the windows build.
llvm-svn: 127416
2011-03-10 18:30:48 +00:00
Jakob Stoklund Olesen
891bfab351 Revert r127409 which broke all the Windows bots.
llvm-svn: 127413
2011-03-10 18:01:43 +00:00
Rafael Espindola
b7a2d86ef5 Add support for MemoryBuffers that are not null terminated and add
support for creating buffers that cover only a part of a file.

llvm-svn: 127409
2011-03-10 16:10:30 +00:00
NAKAMURA Takumi
e2f4b8d70e lib/Support/regcomp.c: Fix cygwin warning.
llvm-svn: 127241
2011-03-08 12:25:29 +00:00
NAKAMURA Takumi
6587cb0973 Windows/PathV2.inc: Eliminate redundant condition. DWORD is unsigned.
llvm-svn: 127140
2011-03-07 00:12:53 +00:00
Benjamin Kramer
49043825b4 raw_ostream: while it is generally desirable to do larger writes, it can lead to
inefficient file system buffering if the writes are not a multiple of the desired
buffer size. Avoid this by limiting the large write to a multiple of the buffer
size and copying the remainder into the buffer.

Thanks to Dan for pointing this out.

llvm-svn: 127026
2011-03-04 19:49:30 +00:00
Benjamin Kramer
0376064f8f raw_ostream: If writing a string that is larger than the buffer, write it directly instead of doing many buffer-sized writes.
This caps the number of write(2) calls per string to a maximum of 2.

llvm-svn: 127010
2011-03-04 18:18:16 +00:00
Daniel Dunbar
d4a7704765 Support: Add llvm::AreStatisticsEnabled().
llvm-svn: 126558
2011-02-26 23:17:12 +00:00
Cameron Zwarich
b7e676db6c The signed version of our "magic number" computation for the integer approximation
of a constant had a minor typo introduced when copying it from the book, which
caused it to favor negative approximations over positive approximations in many
cases. Positive approximations require fewer operations beyond the multiplication.

In the case of division by 3, we still generate code that is a single instruction
larger than GCC's code.

llvm-svn: 126097
2011-02-21 00:22:02 +00:00
Devang Patel
7bc042d9d4 Provide tag strings for llvm specific tags.
llvm-svn: 125986
2011-02-18 23:06:29 +00:00
Chris Lattner
9c5c450c56 improve support for OpenBSD, patch by Amit Kulkarni!
llvm-svn: 125943
2011-02-18 17:04:56 +00:00
Argyrios Kyrtzidis
7f4a6afc42 Check the errorcode.
llvm-svn: 125804
2011-02-18 00:47:07 +00:00
Nadav Rotem
ad2fd4eada Enhance constant folding of bitcast operations on vectors of floats.
Add getAllOnesValue of FP numbers to Constants and APFloat.
Add more tests.

llvm-svn: 125776
2011-02-17 21:22:27 +00:00
NAKAMURA Takumi
00228d0c2c Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 generally.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. In llvm side, i686 and x64 can be treated as similar way.

llvm-svn: 125747
2011-02-17 12:24:17 +00:00
Argyrios Kyrtzidis
bd74fadd7b Implement a function from PathV2 whose definition is missing.
llvm-svn: 125574
2011-02-15 17:51:19 +00:00
Zhanyong Wan
c1bc219fc1 Adds llvm::sys::path::is_separator() to test whether a char is a path separator
on the host OS.  Reviewed by dgregor.

llvm-svn: 125406
2011-02-11 21:24:40 +00:00
Douglas Gregor
0044fad1e6 Rip out realpath() support. It's expensive, and often a bad idea, and
I have another way to achieve the same goal.

llvm-svn: 125239
2011-02-09 23:33:15 +00:00