Benjamin Kramer
172f80849f
Use access(2) instead of stat(2) to check if a file exists.
...
Apart from being slightly cheaper, this fixes a real bug that hits 32 bit
linux systems. When passing a file larger than 2G to be linked (which isn't
that uncommon with large projects such as WebKit), clang's driver checks
if the file exists but the file size doesn't fit in an off_t and stat(2)
fails with EOVERFLOW. Clang then says that the file doesn't exist instead
of passing it to the linker.
llvm-svn: 157891
2012-06-02 16:28:09 +00:00
NAKAMURA Takumi
b030e8a5c8
Path::GetTemporaryDirectory(): Add an assertion if TempDirectory is alive, to check when someone would remove the tempdir.
...
llvm-svn: 157529
2012-05-27 13:02:04 +00:00
Justin Holewinski
907f7606f2
Remove the PTX back-end and all of its artifacts (triple, etc.)
...
This back-end was deprecated in favor of the NVPTX back-end.
NV_CONTRIB
llvm-svn: 157417
2012-05-24 21:38:21 +00:00
Patrik Hägglund
26dcb95dfc
Fix -Wcovered-switch-default warning.
...
llvm-svn: 157381
2012-05-24 07:51:46 +00:00
Nuno Lopes
63afc08ca7
fix corner case in ConstantRange::intersectWith().
...
this fixes the missed optimization I was seeing in the CorrelatedValuePropagation pass
llvm-svn: 157032
2012-05-18 00:14:36 +00:00
Michael J. Spencer
c10948d02b
[Support/YAMLParser] Use rtrim on plain scalars.
...
llvm-svn: 156787
2012-05-14 22:43:34 +00:00
Michael J. Spencer
93303819ac
[Support/StringRef] Add find_last_not_of and {r,l,}trim.
...
llvm-svn: 156652
2012-05-11 22:08:50 +00:00
Eric Christopher
b6148ed72c
Allow unique_file to take a mode for file permissions, but default
...
to user only read/write.
Part of rdar://11325849
llvm-svn: 156591
2012-05-11 00:07:44 +00:00
Chad Rosier
9d7b1cee39
Set the default iOS version to 3.0.
...
llvm-svn: 156492
2012-05-09 18:23:00 +00:00
Bob Wilson
8d4e2fab63
Use the cpuid 64 bit flag to pick the default CPU name for an unknown model.
...
For the Family 6 switch in sys::getHostCPUName, an unrecognized model was
reported as "i686". That's a really bad default since it means that new
CPUs will be treated as if they can only use 32-bit code. This just looks
at the cpuid extended feature flag for 64 bit support, and if that is set,
it uses a default x86-64 cpu. Similar logic is already used for the Family
15 code. <rdar://problem/11314502>
llvm-svn: 156486
2012-05-09 17:47:03 +00:00
Chad Rosier
2778cbc880
Don't return true on a function with a void return type.
...
llvm-svn: 156484
2012-05-09 17:38:47 +00:00
Chad Rosier
d84eaac673
Add Triple::getiOSVersion.
...
This new function provides a way to get the iOS version number from ios triples.
Part of rdar://11409204
llvm-svn: 156483
2012-05-09 17:23:48 +00:00
Kevin Enderby
fe3d005ca5
Fix it so llvm-objdump -arch does accept x86 and x86-64 as valid arch names.
...
PR12731. Patch by Meador Inge!
llvm-svn: 156444
2012-05-08 23:38:45 +00:00
Daniel Dunbar
5f1c956eb0
[Support] Fix sys::GetRandomNumber() to always use a high quality seed.
...
llvm-svn: 156414
2012-05-08 20:38:00 +00:00
NAKAMURA Takumi
3b7f995b75
Windows/PathV2.inc: Retry rename() for (maximum) 2 seconds.
...
Files might be opend by system scanners (eg. file indexer, virus scanner, &c).
llvm-svn: 156380
2012-05-08 14:31:46 +00:00
Matt Beaumont-Gay
a1b3b007f3
Don't assume size_t is unsigned long long.
...
Fixes a -Woverflow warning from gcc when building for 32-bit platforms.
llvm-svn: 156313
2012-05-07 18:12:42 +00:00
Chris Lattner
854f366a1f
make SourceMgr tolerate empty SMLoc()'s better.
...
llvm-svn: 156260
2012-05-06 16:20:49 +00:00
NAKAMURA Takumi
7bec74112d
Unix/Process.inc: Give more useful random seed to srand. Workaround for PR12743.
...
llvm-svn: 156252
2012-05-06 08:24:24 +00:00
NAKAMURA Takumi
54acb28882
Support/Process: Move llvm::sys::Process::GetRandomNumber() from Process.cpp to Unix/Process.inc.
...
FIXME: GetRandomNumber() is not implemented in Win32.
llvm-svn: 156251
2012-05-06 08:24:18 +00:00
Chris Lattner
9322ba824c
reapply my patch, with a fix for an off-by-one error. Turned out to be a lot
...
of work for a drive-by fix :)
llvm-svn: 156246
2012-05-05 22:17:32 +00:00
Chris Lattner
64f65d33df
revert my patches, which are causing problems.
...
llvm-svn: 156245
2012-05-05 22:11:04 +00:00
Chris Lattner
cd60bc491e
refactor some code to expose column numbers more and make diagnostic printing slightly more efficient.
...
llvm-svn: 156243
2012-05-05 21:39:51 +00:00
Daniel Dunbar
d5f82d92f3
[Support] Add missing include.
...
llvm-svn: 156240
2012-05-05 16:49:11 +00:00
Daniel Dunbar
58ed0c6c09
[Support] Fix up comments.
...
llvm-svn: 156239
2012-05-05 16:39:22 +00:00
Daniel Dunbar
3f0fa19bc4
[Support] Rewrite sys::fs::unique_file to not be stupid with /dev/urandom.
...
- Just use sys::Process::GetRandomNumber instead of having two poor
implementations.
- This is ~70 times (!) faster on my OS X machine.
llvm-svn: 156238
2012-05-05 16:36:24 +00:00
Daniel Dunbar
b57ddd4e29
[Support] Add sys::Process::GetRandomNumber().
...
- Primitive API, but we rarely have need for random numbers.
llvm-svn: 156237
2012-05-05 16:36:20 +00:00
Justin Holewinski
ae556d3ef7
This patch adds a new NVPTX back-end to LLVM which supports code generation for NVIDIA PTX 3.0. This back-end will (eventually) replace the current PTX back-end, while maintaining compatibility with it.
...
The new target machines are:
nvptx (old ptx32) => 32-bit PTX
nvptx64 (old ptx64) => 64-bit PTX
The sources are based on the internal NVIDIA NVPTX back-end, and
contain more functionality than the current PTX back-end currently
provides.
NV_CONTRIB
llvm-svn: 156196
2012-05-04 20:18:50 +00:00
Preston Gurd
c0b976c42a
Change the Intel Atom detection code to recognize
...
Lincroft and Medfield.
llvm-svn: 156025
2012-05-02 21:38:46 +00:00
Benjamin Kramer
84b857e4e6
YAMLParser: get rid of global ctors & dtors.
...
llvm-svn: 155907
2012-05-01 10:19:59 +00:00
Michael J. Spencer
6033113e35
[Support/YAMLParser] Fix ASan found bugs.
...
llvm-svn: 155735
2012-04-27 21:12:20 +00:00
Michael J. Spencer
a6c2c29152
[Support/YAML] Properly fix unitialized variable warning by inserting a
...
'REPLACEMENT CHARACTER' (U+FFFD) when getAsInteger fails.
llvm-svn: 155653
2012-04-26 19:27:11 +00:00
Evan Cheng
7fd160700f
Add a missing cpu subtype.
...
llvm-svn: 155402
2012-04-23 22:41:39 +00:00
Michael J. Spencer
04b795bc1d
[Support/Unix] Unconditionally include time.h.
...
When building LLVM on Linux with libc++ with CMake TIME_WITH_SYS_TIME is
undefined, and HAVE_SYS_TIME_H is defined. This ends up including
sys/time.h but not time.h. Unix/TimeValue.inc requires time.h for asctime_r
and localtime. libstdc++ seems to include time.h anyway, but libc++ does
not.
Fix this by always including time.h
llvm-svn: 155382
2012-04-23 19:00:27 +00:00
Sylvestre Ledru
3099f4bda8
Conflict with st_dev/st_ino identifiers under Debian GNU/Hurd
...
The problem is that the struct file_status on UNIX systems has two
members called st_dev and st_ino; those are also members of the
struct stat, and they are reserved identifiers which can also be
provided as #define (and this is the case for st_dev on Hurd).
The solution (attached) is to rename them, for example adding a
"fs_" prefix (= file status) to them.
Patch by Pino Toscano
llvm-svn: 155354
2012-04-23 16:37:23 +00:00
Chris Lattner
5e14666149
Don't die with an assertion if the Result bitwidth is already correct. This
...
fixes an assert reading "1239123123123123" when the result is already 64-bit.
llvm-svn: 155329
2012-04-23 00:27:54 +00:00
Bill Wendling
f9774c3253
Remove some potential warnings about variables used uninitialized.
...
llvm-svn: 155307
2012-04-22 07:23:04 +00:00
Chris Lattner
0a1bafed7b
No need for "else if" after a return. Autosense "0o123" as octal in
...
StringRef::getAsInteger
llvm-svn: 155298
2012-04-21 22:03:05 +00:00
Nuno Lopes
e568efbc4d
move Signals to .rodata
...
llvm-svn: 155283
2012-04-21 14:45:37 +00:00
Benjamin Kramer
0aa0d3d633
YAMLParser: silence warning about tautological comparison on unsigned-char platforms.
...
No functionality change.
llvm-svn: 155280
2012-04-21 10:51:42 +00:00
Benjamin Kramer
bb73d19794
SourceMgr: Colorize diagnostics.
...
Same color scheme as clang uses. The colors are only enabled if the output is a tty.
llvm-svn: 155035
2012-04-18 19:04:15 +00:00
Benjamin Kramer
94988cb34c
SmallPtrSet: Reuse DenseMapInfo's pointer hash function instead of inventing a bad one ourselves.
...
DenseMap's hash function uses slightly more entropy and reduces hash collisions
significantly. I also experimented with Hashing.h, but it didn't gave a lot of
improvement while being much more expensive to compute.
llvm-svn: 154996
2012-04-18 10:37:32 +00:00
Seth Cantrell
3d013bccfa
fix error check in assert
...
llvm-svn: 154971
2012-04-18 00:40:23 +00:00
David Blaikie
1b5d8d46fb
C++ has newlines at the end of files (including include files).
...
llvm-svn: 154962
2012-04-17 23:46:51 +00:00
Seth Cantrell
75dbcb8bdd
platform support for counting column widths and checking isprint
...
llvm-svn: 154944
2012-04-17 20:03:03 +00:00
Manuel Klimek
1f8918f69d
Goodbye, JSONParser...
...
llvm-svn: 154930
2012-04-17 17:21:17 +00:00
Benjamin Kramer
13d16f3bf3
Reapply 'Add reverseColor to raw_ostream'.
...
To be used in printing unprintable source in clang diagnostics.
Patch by Seth Cantrell, with a minor fix for mingw by me.
llvm-svn: 154805
2012-04-16 08:56:50 +00:00
Argyrios Kyrtzidis
64104f16d4
Revert r154800 which breaks windows builders.
...
llvm-svn: 154802
2012-04-16 07:59:39 +00:00
Argyrios Kyrtzidis
d17db2e0ee
Add reverseColor to raw_ostream.
...
To be used in printing unprintable source in clang diagnostics.
Patch by Seth Cantrell!
llvm-svn: 154800
2012-04-16 07:07:38 +00:00
Sylvestre Ledru
14ada94682
Fix the build under Debian GNU/Hurd.
...
Thanks to Pino Toscano for the patch
llvm-svn: 154500
2012-04-11 15:35:36 +00:00
Benjamin Kramer
63057a5ff0
FoldingSet: Push the hash through FoldingSetTraits::Equals, so clients can use it.
...
llvm-svn: 154496
2012-04-11 14:06:47 +00:00