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

1600 Commits

Author SHA1 Message Date
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
Michael J. Spencer
a96fe51fa6 Support/PathV2: Remove the error_code return type from all functions in the path
namespace. None of them return anything except for success anyway. These will be
converted to returning their result soon.

llvm-svn: 121109
2010-12-07 03:57:37 +00:00
Michael J. Spencer
7c3efd63d4 Support/PathV2: Move make_absolute from path to fs.
llvm-svn: 121108
2010-12-07 03:57:17 +00:00
Michael J. Spencer
2953ba9e66 Support/Unix/PathV2: Return the real error from realpath instead of any error
that close or unlink set.

llvm-svn: 121094
2010-12-07 01:23:39 +00:00
Michael J. Spencer
6874ebd344 Support/Unix/PathV2: Use 0770 instead of 0700 when creating a directory. Also use
the standard macros instead of octal notation.

llvm-svn: 121093
2010-12-07 01:23:29 +00:00
Michael J. Spencer
cfd185355b Support/PathV2: Use SmallVector::clear instead of set_size.
llvm-svn: 121092
2010-12-07 01:23:19 +00:00
Michael J. Spencer
a59a7b3965 Support/PathV2: Clarify and correct documentation.
llvm-svn: 121091
2010-12-07 01:23:08 +00:00
Michael J. Spencer
898af0f235 Support/PathV2: Move current_path from path to fs and fix the Unix implementation.
Unix bug spotted by Dan Gohman.

llvm-svn: 121090
2010-12-07 01:22:31 +00:00
Michael J. Spencer
b31b7d5b4e Support/Windows: Make MinGW happy.
llvm-svn: 120991
2010-12-06 06:02:07 +00:00
Michael J. Spencer
244b426701 Support/FileSystem: Add directory_iterator implementation.
llvm-svn: 120989
2010-12-06 04:28:42 +00:00
Michael J. Spencer
36a2df800d Support/PathV2: Fix append to not add a slash to empty or root paths.
llvm-svn: 120988
2010-12-06 04:28:23 +00:00
Michael J. Spencer
61043e9f3a Support/Windows: Add ScopedHandle and move some clients over to it.
llvm-svn: 120987
2010-12-06 04:28:13 +00:00
Bill Wendling
18e834f217 Silence 'may be used uninitialized in this function' warnings. Static analysis
may determine that they cannot be used uninitialized. But that might be a bit
too much for the compiler to determine.

llvm-svn: 120916
2010-12-04 20:20:34 +00:00
Michael J. Spencer
2cd429339f Support/PathV2: Remove redundant calls to make_error_code.
llvm-svn: 120913
2010-12-04 18:45:32 +00:00
Benjamin Kramer
e2e8053264 APInt: microoptimize a few methods.
llvm-svn: 120912
2010-12-04 18:05:36 +00:00
Michael J. Spencer
5a2272dcef Support/FileSystem: Add status implementation.
llvm-svn: 120870
2010-12-04 00:32:40 +00:00
Michael J. Spencer
090a4bd632 Support/Windows/FileSystem: Fix MinGW warnings.
llvm-svn: 120868
2010-12-04 00:32:14 +00:00
Michael J. Spencer
e1360680ce Support/FileSystem: Add file_size implementation.
llvm-svn: 120867
2010-12-04 00:31:48 +00:00
Jakob Stoklund Olesen
4cd667151d Add IntervalMap::iterator::set{Start,Stop,Value} methods that allow limited
editing of the current interval.

These methods may cause coalescing, there are corresponding set*Unchecked
methods for editing without coalescing. The non-coalescing methods are useful
for applying monotonic transforms to all keys or values in a map without
accidentally coalescing transformed and untransformed intervals.

llvm-svn: 120829
2010-12-03 19:02:00 +00:00
Michael J. Spencer
6cf89ea23a Support/FileSystem: Add equivalent implementation.
llvm-svn: 120827
2010-12-03 18:49:13 +00:00
Michael J. Spencer
ce950c50c4 Support/FileSystem: Fix MinGW build. It doesn't have _chsize_s.
llvm-svn: 120826
2010-12-03 18:48:56 +00:00
Michael J. Spencer
60c2f39a49 And I really hate line endings.
llvm-svn: 120821
2010-12-03 18:04:11 +00:00
Michael J. Spencer
94cf759d48 Support/Windows/FileSystem: Fix MinGW build.
llvm-svn: 120820
2010-12-03 18:03:28 +00:00
Michael J. Spencer
a0346605ae Support/FileSystem: Add resize_file implementation.
llvm-svn: 120819
2010-12-03 17:54:07 +00:00
Michael J. Spencer
ba3176e790 Support/FileSystem: Add rename implementation.
llvm-svn: 120818
2010-12-03 17:53:55 +00:00
Michael J. Spencer
1d9a2b7541 Support/FileSystem: Add remove implementation.
llvm-svn: 120817
2010-12-03 17:53:43 +00:00
Michael J. Spencer
8c7c12a74e Fix line endings.
llvm-svn: 120816
2010-12-03 17:53:23 +00:00
Eric Christopher
25f7b89a9e Apparently OS X 10.4 doesn't have __crashreporter_info__.
Try to fix building on the wayback machine.

llvm-svn: 120801
2010-12-03 07:45:22 +00:00
Michael J. Spencer
98d9d1509e Support/FileSystem: Add create_symlink implementation.
llvm-svn: 120800
2010-12-03 07:41:25 +00:00
Michael J. Spencer
efc69d250d Support/FileSystem: Add create_hard_link implementation.
llvm-svn: 120792
2010-12-03 05:58:41 +00:00
Michael J. Spencer
5328e94513 Support/ADT/Twine: Make toNullTerminatedStringRef not rely on UB :(.
llvm-svn: 120791
2010-12-03 05:42:25 +00:00
Michael J. Spencer
96236c93ff Support/FileSystem: Add create_director{y,ies} implementations.
llvm-svn: 120790
2010-12-03 05:42:11 +00:00
Michael J. Spencer
d9f355beb0 Support/Windows/FileSystem: Remove unneeded toNullTerminatedStringRef.
llvm-svn: 120777
2010-12-03 01:21:38 +00:00
Michael J. Spencer
4e1623c715 Support/FileSystem: Add unique_file and exists implementations.
llvm-svn: 120776
2010-12-03 01:21:28 +00:00
Michael J. Spencer
8908ec62e4 Support/FileSystem: Fix copy_file implementation to use toNullTerminatedStringRef
instead of toStringRef. The file system APIs need c strings.

llvm-svn: 120601
2010-12-01 20:37:42 +00:00
Michael J. Spencer
03bbd0f21d Support/ADT/Twine: Add toNullTerminatedStringRef.
llvm-svn: 120600
2010-12-01 20:37:30 +00:00
Michael J. Spencer
42a5674c7a Support/FileSystem: Add copy_file implementation. Not tests yet because the
file creation APIs aren't implemented.

llvm-svn: 120593
2010-12-01 19:32:01 +00:00
Jay Foad
789e8ac4f7 PR5207: Rename overloaded APInt methods set(), clear(), flip() to
setAllBits(), setBit(unsigned), etc.

llvm-svn: 120564
2010-12-01 08:53:58 +00:00
Michael J. Spencer
1796028f41 Support/PathV2: Add is_{absolute,relative} implementation.
llvm-svn: 120560
2010-12-01 06:21:53 +00:00
Michael J. Spencer
5aa4703418 Support/PathV2: Add has_{root_path,root_name,root_directory,parent_path,filename,stem,extension} implementation.
llvm-svn: 120559
2010-12-01 06:03:50 +00:00
Michael J. Spencer
f6333e887f Support/PathV2: Add extension implementation.
llvm-svn: 120550
2010-12-01 03:37:41 +00:00
Michael J. Spencer
14039e9883 Support/PathV2: Add stem implementation.
llvm-svn: 120547
2010-12-01 03:18:33 +00:00
Michael J. Spencer
c3aaf36678 Support/PathV2: Add filename implementation.
llvm-svn: 120546
2010-12-01 03:18:17 +00:00
Michael J. Spencer
4beee08409 Support/PathV2: Add native implementation.
llvm-svn: 120539
2010-12-01 02:48:27 +00:00
Dan Gohman
3ff3bc0c31 Delete Path::appendSuffix's return value; it wasn't used anywhere, which
is fine since isn't really necessary to check isValid there anyway.

llvm-svn: 120538
2010-12-01 02:46:41 +00:00
Michael J. Spencer
8d5c96c575 Support/PathV2: Add replace_extension implementation.
llvm-svn: 120514
2010-12-01 00:52:55 +00:00
Michael J. Spencer
5ac386d311 Support/PathV2: Add remove_filename implementation.
llvm-svn: 120513
2010-12-01 00:52:28 +00:00
Michael J. Spencer
a10e76dd58 Support/PathV2: Implement reverse iteration and parent_path.
llvm-svn: 120496
2010-11-30 23:28:07 +00:00
Michael J. Spencer
090cf77d32 Support/ADT/StringRef: Add find_last_of.
llvm-svn: 120495
2010-11-30 23:27:35 +00:00
Jay Foad
c663d7e4f6 PR5207: Make APInt::set(), APInt::clear() and APInt::flip() return void.
llvm-svn: 120413
2010-11-30 09:02:01 +00:00
Michael J. Spencer
8ac563a538 Support: Add PathV2 implementation.
llvm-svn: 120329
2010-11-29 22:28:51 +00:00
Charles Davis
e7f14dfdb8 Now to chant the magical incantation that will exorcise the System library
from LLVM forever:

grep -lR "llvm/System" * | grep -v .svn | xargs sed -ie 's#llvm/System#llvm/Support#g'

llvm-svn: 120314
2010-11-29 19:44:50 +00:00
Michael J. Spencer
0d9e3b3a88 Missed a spot.
llvm-svn: 120301
2010-11-29 18:29:55 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Jay Foad
7378352505 PR5207: change APInt::doubleToBits() and APInt::floatToBits() to be
static methods that return a new APInt.

llvm-svn: 120261
2010-11-28 21:04:48 +00:00
Benjamin Kramer
3355314332 Remove PIC16 remnants.
llvm-svn: 120223
2010-11-27 18:20:30 +00:00
Daniel Dunbar
56381d8cc7 raw_ostream::write_escaped: Add a UseHexEscapes argument.
llvm-svn: 120200
2010-11-27 07:59:50 +00:00
Michael J. Spencer
b2cfb3b443 Fix Whitespace.
llvm-svn: 120166
2010-11-26 04:16:08 +00:00
Jakob Stoklund Olesen
ac19a35444 Move tree navigation to a new Path class that doesn't have to be a template.
The path also holds a reference to the root node, and that allows important
iterator accessors like start() and stop() to have no conditional code. (When
the compiler is clever enough to remove it.)

llvm-svn: 120165
2010-11-26 01:39:40 +00:00
Chris Lattner
80a065b474 add a MemoryBuffer::getOpenFile method, which turns an open
file descriptor into a MemoryBuffer (and closes the FD).

llvm-svn: 120065
2010-11-23 22:20:27 +00:00
Chris Lattner
a830fc6a45 Revert functionality doug added in r98575 that was never
documented and only used by some clang stuff I just removed.

llvm-svn: 120002
2010-11-23 06:09:51 +00:00
Rafael Espindola
68135a728b Fix a use after free. Patch by Frits van Bommel.
llvm-svn: 119842
2010-11-19 21:14:29 +00:00
Jakob Stoklund Olesen
52d6dd3079 Add ADT/IntervalMap.
This is a sorted interval map data structure for small keys and values with
automatic coalescing and bidirectional iteration over coalesced intervals.

Except for coalescing intervals, it provides similar functionality to std::map.
It is however much more compact for small keys and values, and hopefully faster
too.

The container object itself can hold the first few intervals without any
allocations, then it switches to a cache conscious B+-tree representation. A
recycling allocator can be shared between many containers, even between
containers holding different types.

The IntervalMap is initially intended to be used with SlotIndex intervals for:

- Backing store for LiveIntervalUnion that is smaller and faster than std::set.

- Backing store for LiveInterval with less overhead than std::vector for typical
  intervals and O(N log N) merging of large intervals. 99% of virtual registers
  need 4 entries or less and would benefit from the small object optimization.

- Backing store for LiveDebugVariable which doesn't exist yet, but will track
  debug variables during register allocation.

This is a work in progress. Missing items are:

- Performance metrics.
- erase().
- insert() shrinkage.
- clear().
- More performance metrics.
- Simplification and detemplatization.

llvm-svn: 119787
2010-11-19 04:47:19 +00:00
Jakob Stoklund Olesen
254cd4bc4d Revert "Add ADT/IntervalMap.", GCC doesn't like it.
This reverts r119772.

llvm-svn: 119773
2010-11-19 01:21:03 +00:00
Jakob Stoklund Olesen
7d82c5c710 Add ADT/IntervalMap.
This is a sorted interval map data structure for small keys and values with
automatic coalescing and bidirectional iteration over coalesced intervals.

Except for coalescing intervals, it provides similar functionality to std::map.
It is however much more compact for small keys and values, and hopefully faster
too.

The container object itself can hold the first few intervals without any
allocations, then it switches to a cache conscious B+-tree representation. A
recycling allocator can be shared between many containers, even between
containers holding different types.

The IntervalMap is initially intended to be used with SlotIndex intervals for:

- Backing store for LiveIntervalUnion that is smaller and faster than std::set.

- Backing store for LiveInterval with less overhead than std::vector for typical
  intervals and O(N log N) merging of large intervals. 99% of virtual registers
  need 4 entries or less and would benefit from the small object optimization.

- Backing store for LiveDebugVariable which doesn't exist yet, but will track
  debug variables during register allocation.

This is a work in progress. Missing items are:

- Performance metrics.
- erase().
- insert() shrinkage.
- clear().
- More performance metrics.
- Simplification and detemplatization.

llvm-svn: 119772
2010-11-19 01:14:40 +00:00
Dale Johannesen
7bfcfd0bfa Aligned and unaligned copies of the same string
were not hashing to the same value.  Analysis
and patch by Frits van Bommel!

llvm-svn: 119770
2010-11-19 00:48:58 +00:00
Dan Gohman
3f08bf5bea Bounds-check APInt's operator[].
llvm-svn: 119708
2010-11-18 17:14:56 +00:00
Chris Lattner
99b8654169 now that AsmPrinter::EmitInlineAsm is factored right, we can eliminate the
cookie argument to the SourceMgr diagnostic stuff.  This cleanly separates
LLVMContext's inlineasm handler from the sourcemgr error handling 
definition, increasing type safety and cleaning things up.

llvm-svn: 119486
2010-11-17 08:13:01 +00:00
Daniel Dunbar
1f695efa5e report_fatal_error: Simplify a possible ambiguity.
llvm-svn: 118972
2010-11-13 02:48:51 +00:00
Ted Kremenek
3bb32def7e Fix memory leak in StringRef::edit_distance(). 'Allocated' could be leaked on an early return.
llvm-svn: 118370
2010-11-07 06:09:02 +00:00
Daniel Dunbar
8f3d8495f5 CrashRecoveryContext: Add RunSafelyOnThread helper function.
llvm-svn: 118272
2010-11-05 07:19:09 +00:00
Mikhail Glushenkov
991857f132 Rename FindExecutable to PrependMainExecutablePath.
Makes it more clear that it is just a path manipulation function.

llvm-svn: 118174
2010-11-03 16:14:16 +00:00
Dan Gohman
69a6379472 Print an error as one big string instead of breaking it up.
llvm-svn: 118130
2010-11-03 00:24:33 +00:00
Mikhail Glushenkov
97788c1061 Revert r118057, this is better fixed in appendSuffix itself.
llvm-svn: 118088
2010-11-02 22:18:28 +00:00
Dan Gohman
172e1824d0 Don't append a dot on platforms which don't use exe suffixes.
llvm-svn: 118057
2010-11-02 20:49:48 +00:00
Mikhail Glushenkov
4077e2da6f FindExecutable: remove the executability check.
This makes the behaviour of FindExecutable more consistent across platforms, but
I'm not very happy with the name...

llvm-svn: 118049
2010-11-02 20:32:46 +00:00
Dan Gohman
6a889e86df Fix these error messages to be less confusing. These error
messages primarily indicate errors running the viewer, not
errors with the graph file itself.

llvm-svn: 117665
2010-10-29 17:03:40 +00:00
Mikhail Glushenkov
7ee0f678cb Remove an unnecessary check and an unnecessary temporary.
llvm-svn: 117583
2010-10-28 19:33:04 +00:00
Douglas Gregor
a598c0fbce Extend StringRef's edit-distance algorithm to permit an upper bound on the allowed edit distance
llvm-svn: 116867
2010-10-19 22:13:48 +00:00
NAKAMURA Takumi
8c67d3f400 lib/Support/raw_ostream.cpp: Fix Cygwin's build.
setmode is provided by io.h on Cygwin.

llvm-svn: 116784
2010-10-19 01:21:55 +00:00
Daniel Dunbar
f5c3546f2b CrashRecoveryContext: Add missing return, so that the signal fires after we our
routine is off the stack. Otherwise we show up rather confusingly in the stack
trace.

llvm-svn: 116755
2010-10-18 21:55:18 +00:00
Oscar Fuentes
a6ffccab95 Build with RTTI and exceptions disabled. Only in GCC for now.
llvm-svn: 116682
2010-10-17 02:26:16 +00:00
Francois Pichet
ad0548d742 Always use binary mode for output stream. This is important to prevent unwanted end of line conversion on Windows. Should not affect Unix where O_BINARY is not defined. This fix /clang/test/lexer/preamble.c XFAIL on WIN32.
llvm-svn: 116509
2010-10-14 20:30:58 +00:00
Chris Lattner
27d8b68afa fix a bug I introduced, no idea how this didn't repro right.
llvm-svn: 116462
2010-10-14 00:30:00 +00:00
Chris Lattner
451a0accb5 add uadd_ov/usub_ov to apint, consolidate constant folding
logic to use the new APInt methods.  Among other things this
implements rdar://8501501 - llvm.smul.with.overflow.i32 should constant fold

which comes from "clang -ftrapv", originally brought to my attention from PR8221.

llvm-svn: 116457
2010-10-14 00:05:07 +00:00
Chris Lattner
093d5fe0a9 constify these methods.
llvm-svn: 116455
2010-10-13 23:54:10 +00:00
Chris Lattner
70a78ab2c5 add a few operations for signed operations that also
return an overflow flag.

llvm-svn: 116452
2010-10-13 23:46:33 +00:00
John Thompson
87f1278fd9 Unbreak cmake build.
llvm-svn: 116003
2010-10-07 23:12:15 +00:00
Dan Gohman
6645ce3f75 Move tool_output_file into its own file.
llvm-svn: 115973
2010-10-07 20:32:40 +00:00
Dan Gohman
e4c61a1443 After printing "Running 'Graphviz' program... " and running the
Graphviz program, print something with a newline, to avoid leaving
the line unfinished.

llvm-svn: 115620
2010-10-05 15:30:27 +00:00
Benjamin Kramer
3f7e313552 Grow BumpPtrAllocator's slab size dynamically if we allocated many slabs. This
reduces the amount of malloc calls and may reduce memory overhead.

Some numbers:
ASTContext stats, clang -cc1 -disable-free -fsyntax-only Cocoa_h.m
without dynamic growth                          |  with dynamic growth
Number of memory regions: 3158                  |  Number of memory regions: 432
Bytes used: 12333185                            |  Bytes used: 12333185
Bytes allocated: 12935168                       |  Bytes allocated: 12800000
Bytes wasted: 601983 (includes alignment, etc)  |  Bytes wasted: 466815 (includes alignment, etc)

ASTContext stats, clang -cc1 -disable-free -fsyntax-only on clang's ASTReader.cpp
without dynamic growth                          |  with dynamic growth
Number of memory regions: 10987                 |  Number of memory regions: 551
Bytes used: 42910356                            |  Bytes used: 42910356
Bytes allocated: 45002752                       |  Bytes allocated: 44711936
Bytes wasted: 2092396 (includes alignment, etc) |  Bytes wasted: 1801580 (includes alignment, etc)

llvm-svn: 115151
2010-09-30 16:18:28 +00:00
Oscar Fuentes
eb27a44982 Removed a bunch of unnecessary target_link_libraries.
llvm-svn: 114999
2010-09-28 22:39:14 +00:00
Nick Lewycky
69d1069a4b Make ConstantRange::makeICmpRegion handle all the edge cases properly. This
also fixes PR8250.

llvm-svn: 114972
2010-09-28 18:18:36 +00:00
Benjamin Kramer
cd6c025b08 Push twines deeper into SourceMgr's error handling methods.
llvm-svn: 114847
2010-09-27 17:42:11 +00:00
Dan Gohman
08f59bde05 Delete an unused declaration.
llvm-svn: 114839
2010-09-27 16:54:49 +00:00
Dan Gohman
773c8a1c76 Add support for viewing graphviz graphs with xdot.py.
llvm-svn: 114832
2010-09-27 16:28:34 +00:00
Duncan Sands
c128b42eb8 Add better support for environment portion of triple. Original patch by
Cameron Esfahani, tweaked to use array_lengthof.

llvm-svn: 114073
2010-09-16 08:25:48 +00:00
Duncan Sands
82768f4f13 Some versions of gcc still warn about "ignoring return value ... declared
with attribute warn_unused_result" here - suppress the warning harder.

llvm-svn: 114072
2010-09-16 08:20:49 +00:00
Nick Lewycky
cad1395824 Create PTX backend. Patch by Che-Liang Chiou!
llvm-svn: 113235
2010-09-07 18:14:24 +00:00
Nick Lewycky
9698dae1df Add completely hokey binary-and and binary-or operations to ConstantRange and
teach LazyValueInfo to use them.

llvm-svn: 113196
2010-09-07 05:39:02 +00:00
Nick Lewycky
ca54f909d8 Add a new isSignWrappedSet() method to ConstantRange.
Fix zeroExtend and signExtend to support empty sets, and to return the smallest
possible result set which contains the extension of each element in their
inputs. For example zext i8 [100, 10) to i16 is now [0, 256), not i16 [100, 10)
which contains 63446 members.

llvm-svn: 113187
2010-09-06 23:52:49 +00:00