Commit Graph

1496 Commits

Author SHA1 Message Date
Michael J. Spencer
9b391c513e Support/FileSystem: Add create_symlink implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 07:41:25 +00:00
Michael J. Spencer
d7b305f13e Support/FileSystem: Add create_hard_link implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120792 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 05:58:41 +00:00
Michael J. Spencer
0dda5437f8 Support/ADT/Twine: Make toNullTerminatedStringRef not rely on UB :(.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 05:42:25 +00:00
Michael J. Spencer
b83769f36a Support/FileSystem: Add create_director{y,ies} implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 05:42:11 +00:00
Michael J. Spencer
2dbdeee87a Support/Windows/FileSystem: Remove unneeded toNullTerminatedStringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 01:21:38 +00:00
Michael J. Spencer
3cb84ef65d Support/FileSystem: Add unique_file and exists implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 01:21:28 +00:00
Michael J. Spencer
871498e2ce Support/FileSystem: Fix copy_file implementation to use toNullTerminatedStringRef
instead of toStringRef. The file system APIs need c strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120601 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 20:37:42 +00:00
Michael J. Spencer
7dc7ac3cb2 Support/ADT/Twine: Add toNullTerminatedStringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120600 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 20:37:30 +00:00
Michael J. Spencer
bee0c38f59 Support/FileSystem: Add copy_file implementation. Not tests yet because the
file creation APIs aren't implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120593 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 19:32:01 +00:00
Jay Foad
7a874ddda0 PR5207: Rename overloaded APInt methods set(), clear(), flip() to
setAllBits(), setBit(unsigned), etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 08:53:58 +00:00
Michael J. Spencer
ce2b68fb54 Support/PathV2: Add is_{absolute,relative} implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 06:21:53 +00:00
Michael J. Spencer
ae18008584 Support/PathV2: Add has_{root_path,root_name,root_directory,parent_path,filename,stem,extension} implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120559 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 06:03:50 +00:00
Michael J. Spencer
5265f22f45 Support/PathV2: Add extension implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 03:37:41 +00:00
Michael J. Spencer
34ab1f6087 Support/PathV2: Add stem implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 03:18:33 +00:00
Michael J. Spencer
a979355994 Support/PathV2: Add filename implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 03:18:17 +00:00
Michael J. Spencer
722d5adac1 Support/PathV2: Add native implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120539 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 02:48:27 +00:00
Dan Gohman
552a3c29dc Delete Path::appendSuffix's return value; it wasn't used anywhere, which
is fine since isn't really necessary to check isValid there anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 02:46:41 +00:00
Michael J. Spencer
52ed867801 Support/PathV2: Add replace_extension implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120514 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 00:52:55 +00:00
Michael J. Spencer
dbfb56bebd Support/PathV2: Add remove_filename implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 00:52:28 +00:00
Michael J. Spencer
a42cf73c77 Support/PathV2: Implement reverse iteration and parent_path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 23:28:07 +00:00
Michael J. Spencer
63c133b67d Support/ADT/StringRef: Add find_last_of.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120495 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 23:27:35 +00:00
Jay Foad
a99793c5ea PR5207: Make APInt::set(), APInt::clear() and APInt::flip() return void.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 09:02:01 +00:00
Michael J. Spencer
dffde99644 Support: Add PathV2 implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120329 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 22:28:51 +00:00
Charles Davis
53ca1f3190 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'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120314 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 19:44:50 +00:00
Michael J. Spencer
7a9ff3d36c Missed a spot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120301 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:29:55 +00:00
Michael J. Spencer
1f6efa3996 Merge System into Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:16:10 +00:00
Jay Foad
e4d19c9eb2 PR5207: change APInt::doubleToBits() and APInt::floatToBits() to be
static methods that return a new APInt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120261 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 21:04:48 +00:00
Benjamin Kramer
b837f587ed Remove PIC16 remnants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-27 18:20:30 +00:00
Daniel Dunbar
10a049e6cf raw_ostream::write_escaped: Add a UseHexEscapes argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120200 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-27 07:59:50 +00:00
Michael J. Spencer
326990f1eb Fix Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120166 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26 04:16:08 +00:00
Jakob Stoklund Olesen
706da9d8ca 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.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26 01:39:40 +00:00
Chris Lattner
7cf705461c add a MemoryBuffer::getOpenFile method, which turns an open
file descriptor into a MemoryBuffer (and closes the FD).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120065 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 22:20:27 +00:00
Chris Lattner
9f9bd8e4af Revert functionality doug added in r98575 that was never
documented and only used by some clang stuff I just removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120002 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 06:09:51 +00:00
Rafael Espindola
a962b40f0b Fix a use after free. Patch by Frits van Bommel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 21:14:29 +00:00
Jakob Stoklund Olesen
8dc926755f 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 04:47:19 +00:00
Jakob Stoklund Olesen
737d2816c4 Revert "Add ADT/IntervalMap.", GCC doesn't like it.
This reverts r119772.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119773 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 01:21:03 +00:00
Jakob Stoklund Olesen
8408edffcb 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 01:14:40 +00:00
Dale Johannesen
c81c7fe643 Aligned and unaligned copies of the same string
were not hashing to the same value.  Analysis
and patch by Frits van Bommel!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 00:48:58 +00:00
Dan Gohman
078d967e0a Bounds-check APInt's operator[].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119708 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 17:14:56 +00:00
Chris Lattner
4afa12890f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119486 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 08:13:01 +00:00
Daniel Dunbar
afd693cff3 report_fatal_error: Simplify a possible ambiguity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 02:48:51 +00:00
Ted Kremenek
13302ec089 Fix memory leak in StringRef::edit_distance(). 'Allocated' could be leaked on an early return.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118370 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-07 06:09:02 +00:00
Daniel Dunbar
f8254d6473 CrashRecoveryContext: Add RunSafelyOnThread helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118272 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-05 07:19:09 +00:00
Mikhail Glushenkov
d66f2b74f2 Rename FindExecutable to PrependMainExecutablePath.
Makes it more clear that it is just a path manipulation function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118174 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 16:14:16 +00:00
Dan Gohman
303f350f7d Print an error as one big string instead of breaking it up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 00:24:33 +00:00
Mikhail Glushenkov
ed724fd43a Revert r118057, this is better fixed in appendSuffix itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118088 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 22:18:28 +00:00
Dan Gohman
d4589a3f58 Don't append a dot on platforms which don't use exe suffixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 20:49:48 +00:00
Mikhail Glushenkov
345b344e64 FindExecutable: remove the executability check.
This makes the behaviour of FindExecutable more consistent across platforms, but
I'm not very happy with the name...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118049 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 20:32:46 +00:00
Dan Gohman
c463316046 Fix these error messages to be less confusing. These error
messages primarily indicate errors running the viewer, not
errors with the graph file itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 17:03:40 +00:00
Mikhail Glushenkov
8a5ff478db Remove an unnecessary check and an unnecessary temporary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 19:33:04 +00:00
Douglas Gregor
5ee568ac27 Extend StringRef's edit-distance algorithm to permit an upper bound on the allowed edit distance
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 22:13:48 +00:00
NAKAMURA Takumi
1b5de0e7ee lib/Support/raw_ostream.cpp: Fix Cygwin's build.
setmode is provided by io.h on Cygwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116784 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 01:21:55 +00:00
Daniel Dunbar
d49e2aa5b8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116755 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 21:55:18 +00:00
Oscar Fuentes
f0c55a9b97 Build with RTTI and exceptions disabled. Only in GCC for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116682 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-17 02:26:16 +00:00
Francois Pichet
a872a0f5f8 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116509 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 20:30:58 +00:00
Chris Lattner
a5bbde8efd fix a bug I introduced, no idea how this didn't repro right.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116462 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 00:30:00 +00:00
Chris Lattner
eafc5cb80d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 00:05:07 +00:00
Chris Lattner
0a0a585e6b constify these methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 23:54:10 +00:00
Chris Lattner
f2ddc64c87 add a few operations for signed operations that also
return an overflow flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116452 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 23:46:33 +00:00
John Thompson
358cf1631a Unbreak cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 23:12:15 +00:00
Dan Gohman
e4f1a9b8a2 Move tool_output_file into its own file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 20:32:40 +00:00
Dan Gohman
644801a199 After printing "Running 'Graphviz' program... " and running the
Graphviz program, print something with a newline, to avoid leaving
the line unfinished.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115620 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 15:30:27 +00:00
Benjamin Kramer
82d96cccbc 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115151 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:18:28 +00:00
Oscar Fuentes
3609eb0de2 Removed a bunch of unnecessary target_link_libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 22:39:14 +00:00
Nick Lewycky
f2d7b7c879 Make ConstantRange::makeICmpRegion handle all the edge cases properly. This
also fixes PR8250.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 18:18:36 +00:00
Benjamin Kramer
d1e1703c39 Push twines deeper into SourceMgr's error handling methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 17:42:11 +00:00
Dan Gohman
477268cd24 Delete an unused declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 16:54:49 +00:00
Dan Gohman
48fd5a79e0 Add support for viewing graphviz graphs with xdot.py.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 16:28:34 +00:00
Duncan Sands
5754a45256 Add better support for environment portion of triple. Original patch by
Cameron Esfahani, tweaked to use array_lengthof.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 08:25:48 +00:00
Duncan Sands
dd2fdd81bc Some versions of gcc still warn about "ignoring return value ... declared
with attribute warn_unused_result" here - suppress the warning harder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 08:20:49 +00:00
Nick Lewycky
f7a3c50183 Create PTX backend. Patch by Che-Liang Chiou!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 18:14:24 +00:00
Nick Lewycky
198381e542 Add completely hokey binary-and and binary-or operations to ConstantRange and
teach LazyValueInfo to use them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113196 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 05:39:02 +00:00
Nick Lewycky
32cda119ef 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113187 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 23:52:49 +00:00
Dan Gohman
776339ee27 Use the FindProgramByName fallback only with known absolute paths.
I wasn't able to convince myself that all GetMainExecutable
implementations always return absolute paths; this prevents
unexpected behavior in case they ever don't.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:32:38 +00:00
John McCall
2a9a2dba4c After some discussion with djg, teach SmallVector to grow from a zero
capacity and remove the workaround in SmallVector<T,0>.  There are some
theoretical benefits to a N->2N+1 growth policy anyway.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:55:03 +00:00
NAKAMURA Takumi
1b68af4183 llvm::FindExecutable(): Retrieve the name with suffix.exe, if available.
bugpoint uses it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 03:46:04 +00:00
Dan Gohman
d4c454317a Make tool_output_file's raw_ostream instance a member variable instead
of a base class.

This makes it possible to unregister the file from FilesToRemove when
the file is done. Also, this eliminates the need for
formatted_tool_output_file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112706 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 14:20:41 +00:00
Duncan Sands
12881e79b6 Remove a hack that tries to understand incorrect triples from the
Triple class constructor.  Only valid triples should now be used
inside LLVM - front-ends are now responsable for rejecting or
correcting invalid target triples.  The Triple::normalize method
can be used to straighten out funky triples provided by users.
Give this a whirl through the buildbots to see if I caught all
places where triples enter LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 10:57:54 +00:00
Benjamin Kramer
837bccd052 StringRef::compare_numeric also differed from StringRef::compare for characters > 127.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 15:25:35 +00:00
Benjamin Kramer
0043e35b82 Do unsigned char comparisons in StringRef::compare_lower to be more consistent with compare in corner cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112185 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 14:21:08 +00:00
Dan Gohman
365c53e328 Use Bits.data() instead of &Bits[0].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111993 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 23:16:53 +00:00
Benjamin Kramer
250eb005d9 Avoid O(n*m) complexity in StringRef::find_first(_not)_of(StringRef).
- Cache used characters in a bitset to reduce memory overhead to just 32 bytes.
- On my core2 this code is faster except when the checked string was very short
  (smaller than the list of delimiters).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:16:08 +00:00
Benjamin Kramer
192a400003 Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111669 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 18:56:46 +00:00
Dan Gohman
8d18006cf2 Delete SlowOperationInformer, which is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 18:07:37 +00:00
Dan Gohman
5d56d9df92 Make outs() close its file when its stream is destructed, so that
pending output errors are detected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:44:56 +00:00
Dan Gohman
a1f89deb56 Delete raw_stdout_ostream and raw_stderr_ostream, which are unused
outside of outs() and errs() themselves, and they don't really
need custom classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:39:41 +00:00
Dan Gohman
8df0e01046 Move raw_ostream's Error flag into raw_fd_ostream, as that's the only
class which is using it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:34:20 +00:00
Dan Gohman
af0636f4d6 Introduce a new tool_output_file class, which extends raw_ostream with
functionality that most command-line tools need: ensuring that the
output file gets deleted if the tool is interrupted or encounters an
error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 00:48:10 +00:00
Dale Johannesen
b1508d1889 Do not assert when reading an exponent out of range.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 17:58:35 +00:00
Dan Gohman
2499990699 Make raw_fd_ostream consider itself the owner of STDOUT_FILENO when
constructed with an output filename of "-". In particular, allow the
file descriptor to be closed, and close the file descriptor in the
destructor if it hasn't been explicitly closed already, to ensure
that any write errors are detected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 22:26:19 +00:00
Dan Gohman
d77e5a8176 Tidy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111432 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 22:04:43 +00:00
Dan Gohman
d2da32711d Revert r111321. This doesn't fix a problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111339 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 01:34:52 +00:00
Chris Lattner
5083912dd7 stomp some more undefined behavior, PR7775.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 00:33:47 +00:00
Chris Lattner
7942e3c412 include config.h to get config params, hopefully unbreaking mingw builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111325 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 23:22:10 +00:00
Chris Lattner
93d81b697c Fix the rest of rdar://8318441 which happens when a raw_fd_ostream
(e.g. errs()) fails in close() due to (e.g.) a broken pipe.  As
previously written, the had_error() flag would get set and then
the raw_ostream dtor would report a fatal error.  There is nothing
the client can do about this and we have no way to report the error,
so just eat it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111321 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 23:11:56 +00:00
Chris Lattner
73ebaff79f report_fatal_error can't use errs(), because errs() can call
into report_fatal_error.  Just blast the string to stderr with write(2)
and hope for the best!  Part of rdar://8318441


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111320 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 23:03:53 +00:00
Daniel Dunbar
ebe7eb884e CrashRecovery: Clear the current context on the first crash, to avoid re-entering it if the cleanup code crashes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 22:32:39 +00:00
Daniel Dunbar
a8fa798246 CrashRecovery: Add CrashRecoveryContext::GetCurrent(), so clients can find the active context from anywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111308 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 22:32:37 +00:00
Daniel Dunbar
c0c815e887 CrashRecovery: Make CrashRecoveryContext static methods thread safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 22:32:34 +00:00
Jim Grosbach
37e59c059c remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 17:37:22 +00:00