1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

1600 Commits

Author SHA1 Message Date
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
Cameron Zwarich
7538a1fb4a Attempt to fix the build after r125228.
llvm-svn: 125236
2011-02-09 23:02:14 +00:00
Douglas Gregor
75fafed2fd Add llvm::sys::path::canonical(), which provides the canonicalized
name of a path, after resolving symbolic links and eliminating excess
path elements such as "foo/../" and "./".

This routine still needs a Windows implementation, but I don't have a
Windows machine available. Help? Please?

llvm-svn: 125228
2011-02-09 22:11:23 +00:00
NAKAMURA Takumi
55dd89bf51 lib/Support/Errno.cpp: Check strerror_s() with HAVE_DECL_STRERROR_S in config.h.*.
AC_CHECK_FUNCS seeks a symbol only in libs. We should check the declaration in string.h.

FIXME: I have never seen mingw(s) have strerror_s() (not _strerror_s()).
FIXME: Autoconf/CMake may seek strerror_s() with the definition MINGW_HAS_SECURE_API in future.
llvm-svn: 125172
2011-02-09 04:18:48 +00:00
NAKAMURA Takumi
26a6cce27e Windows/Windows.h: Redefine _WIN32_WINNT here. mingw-w64 tends to define it as 0x0502 in its headers.
llvm-svn: 125171
2011-02-09 04:18:30 +00:00
NAKAMURA Takumi
6a5d1afdb4 Windows/Program.inc: Eliminate the declaration of SetInformationJobObject(). It should be provided with _WIN32_WINNT>=0x0500.
llvm-svn: 125170
2011-02-09 04:18:21 +00:00
NAKAMURA Takumi
8648711e14 Windows/DynamicLibrary.inc: ELM_Callback fix for mingw-w64.
llvm-svn: 125169
2011-02-09 04:18:12 +00:00
Rafael Espindola
43f9672afa Don't open the file again in the gold plugin. To be able to do this, update
MemoryBuffer::getOpenFile to not close the file descriptor.

llvm-svn: 125128
2011-02-08 22:40:47 +00:00
Anders Carlsson
909058c68b Fix a clang warning.
llvm-svn: 124960
2011-02-05 18:19:35 +00:00
NAKAMURA Takumi
aa8b506820 Windows/DynamicLibrary.inc: Split explicit symbols into explicit_symbols.inc.
config.h.* have conditions whether each symbol is defined or not.
Autoconf and CMake may check symbols in libgcc.a for JIT on Mingw.

llvm-svn: 124950
2011-02-05 15:11:53 +00:00
NAKAMURA Takumi
6008a70d4a Windows/Program.inc: Quote arguments when dubious characters (used by cmd.exe or MSYS shell) are included to invoke CreateProcess(). Thanks to Danil Malyshev.
llvm-svn: 124945
2011-02-05 08:53:12 +00:00
NAKAMURA Takumi
872c15ce42 Make Win32's header file name lower for cross build on case-sensitive filesystem.
llvm-svn: 124864
2011-02-04 12:53:04 +00:00
Daniel Dunbar
d2c741c07a raw_fd_ostream: Add a SetUseAtomicWrites() method (uses writev).
llvm-svn: 124771
2011-02-03 03:32:32 +00:00
Duncan Sands
cfc61f7efb Remove NoVendor and NoOS, added in commit 123990, from Triple. While it
may be useful to understand "none", this is not the place for it.  Tweak
the fix to Normalize while there: the fix added in 123990 works correctly,
but I like this way better.  Finally, now that Triple understands some
non-trivial environment values, teach the unittests about them.

llvm-svn: 124720
2011-02-02 10:08:38 +00:00
Evan Cheng
0e8c521bbd Patches to build EFI with Clang/LLVM. By Carl Norum.
llvm-svn: 124639
2011-02-01 01:14:13 +00:00
Daniel Dunbar
652bc3b0a3 Support/CommandLine: Fix LookupNearestOption to also search extra option names.
llvm-svn: 124124
2011-01-24 17:27:17 +00:00
Ted Kremenek
880c19c032 Null initialize a few variables flagged by
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

llvm-svn: 124073
2011-01-23 17:05:06 +00:00
Renato Golin
cf89d692dc Clang was not parsing target triples involving EABI and was generating wrong IR (wrong PCS) and passing the wrong information down llc via the target-triple printed in IR. I've fixed this by adding the parsing of EABI into LLVM's Triple class and using it to choose the correct PCS in Clang's Tools. A Clang patch is on its way to use this infrastructure.
llvm-svn: 123990
2011-01-21 18:25:47 +00:00
Daniel Dunbar
d4e20df45a Support/CommandLine: Add "Did you mean" print for mismatched operands.
llvm-svn: 123717
2011-01-18 01:59:24 +00:00
NAKAMURA Takumi
04e2fe7fd0 Windows/PathV2.inc: For CryptAcquireContext(), CRYPT_VERIFYCONTEXT may be specified for easy use.
llvm-svn: 123687
2011-01-17 22:41:34 +00:00
NAKAMURA Takumi
bfd623d7e5 Windows/PathV2.inc: MoveFileEx() can behave like Posix's mv(1) to specify MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING.
llvm-svn: 123686
2011-01-17 22:41:25 +00:00
NAKAMURA Takumi
6a74aa16c3 lib/Support/Windows/Signals.inc: "Showstopper" dialogs may be suppressed with SetErrorMode() on Windows 7.
llvm-svn: 123685
2011-01-17 22:41:15 +00:00
Michael J. Spencer
30124fea1f Support/raw_ostream: Fix uninitalized variable in raw_fd_ostream constructor.
llvm-svn: 123643
2011-01-17 15:53:12 +00:00
Michael J. Spencer
4e4cb59457 Fix rename.
llvm-svn: 123604
2011-01-16 22:18:41 +00:00
Michael J. Spencer
e1defa51ae Support/PathV2: Add identify_magic.
llvm-svn: 123548
2011-01-15 20:39:36 +00:00
Michael J. Spencer
86a5515979 Support/PathV2: Implement has_magic in terms of get_magic.
llvm-svn: 123545
2011-01-15 18:52:41 +00:00
Michael J. Spencer
78fc0cacd0 Support/PathV2: Implement get_magic.
llvm-svn: 123544
2011-01-15 18:52:33 +00:00
Michael J. Spencer
b9cf8adbe7 Support/Path: Deprecate PathV1::IsSymlink and replace all uses with PathV2::is_symlink.
llvm-svn: 123345
2011-01-12 23:55:06 +00:00
Michael J. Spencer
6d4a8a7b72 Support/Path: Deprecate PathV1::isDirectory and replace all uses with PathV2::is_directory.
llvm-svn: 123209
2011-01-11 01:21:55 +00:00
Michael J. Spencer
917b043a16 Support/Path: Deprecate PathV1::exists and replace all uses with PathV2::fs::exists.
llvm-svn: 123151
2011-01-10 02:34:23 +00:00
Abramo Bagnara
d4c067af6e Fixed parsing of hex floats.
llvm-svn: 122963
2011-01-06 16:55:14 +00:00
Michael J. Spencer
76c9f102b3 Support/PathV2: Implement remove_all.
llvm-svn: 122884
2011-01-05 16:39:38 +00:00
Michael J. Spencer
674358d496 Support/Windows/PathV2: Make directory iteration ignore . and ..
llvm-svn: 122883
2011-01-05 16:39:30 +00:00
Michael J. Spencer
bacdde1270 Support/Windows/PathV2: Fix remove to handle both files and directories.
llvm-svn: 122882
2011-01-05 16:39:22 +00:00
Michael J. Spencer
6bae59fb06 Support/PathV2: Implement directory_entry::status.
llvm-svn: 122881
2011-01-05 16:39:13 +00:00
Michael J. Spencer
e369cc8053 Support/PathV2: Implement directory iteration on POSIX.
llvm-svn: 122879
2011-01-05 16:38:57 +00:00
Benjamin Kramer
133004a64d Fix a signed/unsigned comparison warning.
llvm-svn: 122597
2010-12-28 13:05:13 +00:00
Michael J. Spencer
b604751adb Support/Path: Deprecate Path::hasMagicNumber and replace all uses with fs::has_magic.
llvm-svn: 122589
2010-12-28 01:49:21 +00:00
Michael J. Spencer
018595cf3a Support/PathV2: Implement has_magic.
llvm-svn: 122587
2010-12-28 01:49:01 +00:00
Michael J. Spencer
26654048d7 Support/PathV1: Deprecate GetRootDirectory.
llvm-svn: 122580
2010-12-27 03:21:41 +00:00
Michael J. Spencer
b3e50a570f Support/PathV1: Deprecate makeAbsolute and remove Unix impl because it annoys people.
llvm-svn: 122553
2010-12-25 20:10:11 +00:00
Jeffrey Yasskin
a199652a3e Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.

llvm-svn: 122458
2010-12-23 00:58:24 +00:00
Jakob Stoklund Olesen
86786c46c2 Use IntEqClasses to compute connected components of live intervals.
llvm-svn: 122296
2010-12-21 00:48:17 +00:00
Jakob Stoklund Olesen
26b4e8ec0a Add ADT/IntEqClasses.h as a light-weight implementation of EquivalenceClasses.h.
This implementation already exists as ConnectedVNInfoEqClasses in
LiveInterval.cpp, and it seems to be generally useful to have a light-weight way
of forming equivalence classes of small integers.

IntEqClasses doesn't allow enumeration of the elements in a class.

llvm-svn: 122293
2010-12-21 00:04:46 +00:00
Michael J. Spencer
8e93c3829f Support/PathV2: Add missing has_relative_path impl.
llvm-svn: 122243
2010-12-20 13:30:28 +00:00
Nick Lewycky
c85935836b Add missing standard headers. Patch by Joerg Sonnenberger!
llvm-svn: 122193
2010-12-19 20:43:38 +00:00
Michael J. Spencer
bb238417bb Support/PathV1: Deprecate getLast.
llvm-svn: 122116
2010-12-18 00:19:10 +00:00
Benjamin Kramer
8aca840aff PathV2: Use StringRef::substr to simplify substring creation.
llvm-svn: 122085
2010-12-17 20:27:37 +00:00
Benjamin Kramer
a7366b3f19 Missed some StringRefRefs.
llvm-svn: 122077
2010-12-17 18:59:09 +00:00
Benjamin Kramer
89db30db3a Pass StringRefs by value, for consistency.
llvm-svn: 122074
2010-12-17 18:19:06 +00:00
Jim Grosbach
3bb926adff Trailing whitespace and 80 column fixups.
llvm-svn: 122026
2010-12-17 02:10:59 +00:00
Michael J. Spencer
86f6a9ac6e MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
llvm-svn: 121958
2010-12-16 03:29:14 +00:00
NAKAMURA Takumi
b542a59c37 lib/Support/regexec.c: Let Regex LLP64-aware.
On LLP64 Win64, 'states1' (for small version) was expanded to 'char *' for large version. Thus small version would be mischosen when nstates > 32 regardless of sizeof(long) on Win64.

llvm-svn: 121942
2010-12-16 01:48:15 +00:00
Michael J. Spencer
3dbfb7c62e Support/Windows/PathV2: Fix header comment.
llvm-svn: 121383
2010-12-09 17:37:42 +00:00
Michael J. Spencer
95b8bf9f67 Fix whitespace.
llvm-svn: 121382
2010-12-09 17:37:32 +00:00
Michael J. Spencer
c4c4e1133d Support: Move c_str from SmallVector back to SmallString and add a free standing
templated c_str in Windows.h to replace it.

llvm-svn: 121381
2010-12-09 17:37:18 +00:00
Michael J. Spencer
1d95a8f9bc Support/FileSystem: Change file_status predicate functions that cannot fail to
return their result instead of an error_code. Also add some missing predicate
functions.

llvm-svn: 121380
2010-12-09 17:37:02 +00:00
Michael J. Spencer
15483143ec Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
llvm-svn: 121379
2010-12-09 17:36:48 +00:00
Michael J. Spencer
3885add959 Support: Remove Alarm. It is unused (via local grep and google code search).
llvm-svn: 121160
2010-12-07 18:41:59 +00:00
Michael J. Spencer
3dc94b3cc1 Support/PathV2: Remove const from bool return types.
llvm-svn: 121157
2010-12-07 18:12:07 +00:00
Michael J. Spencer
7979bb402f Support/PathV2: Change most functions in the path namespace to return their work
via their return value instead of an out parameter.

llvm-svn: 121149
2010-12-07 17:04:04 +00:00
Daniel Dunbar
6d79685e20 build: Go back to dropping __eprintf reference when building with Clang, see
comment.

llvm-svn: 121146
2010-12-07 16:29:44 +00:00
Jay Foad
79e18ed269 PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

llvm-svn: 121120
2010-12-07 08:25:19 +00:00
Owen Anderson
4ad5307d6a Don't leak the mutex when loading dynamic libraries.
llvm-svn: 121119
2010-12-07 07:56:20 +00:00
Michael J. Spencer
0ce07529b3 Support/PathV2: Cleanup separator handling.
llvm-svn: 121110
2010-12-07 03:57:48 +00:00