Commit Graph

1433 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen e7ed7b6cfd 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 376d38753d Support/FileSystem: Add equivalent implementation.
llvm-svn: 120827
2010-12-03 18:49:13 +00:00
Michael J. Spencer ca242f2c36 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 521c321d7c And I really hate line endings.
llvm-svn: 120821
2010-12-03 18:04:11 +00:00
Michael J. Spencer 6025247132 Support/Windows/FileSystem: Fix MinGW build.
llvm-svn: 120820
2010-12-03 18:03:28 +00:00
Michael J. Spencer c20a0325f3 Support/FileSystem: Add resize_file implementation.
llvm-svn: 120819
2010-12-03 17:54:07 +00:00
Michael J. Spencer 409f556a2f Support/FileSystem: Add rename implementation.
llvm-svn: 120818
2010-12-03 17:53:55 +00:00
Michael J. Spencer 6e74e11c85 Support/FileSystem: Add remove implementation.
llvm-svn: 120817
2010-12-03 17:53:43 +00:00
Michael J. Spencer 772caff532 Fix line endings.
llvm-svn: 120816
2010-12-03 17:53:23 +00:00
Eric Christopher ca4667319a 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 7ee6d5d6a1 Support/FileSystem: Add create_symlink implementation.
llvm-svn: 120800
2010-12-03 07:41:25 +00:00
Michael J. Spencer e0c4560b50 Support/FileSystem: Add create_hard_link implementation.
llvm-svn: 120792
2010-12-03 05:58:41 +00:00
Michael J. Spencer 73e60d029c Support/ADT/Twine: Make toNullTerminatedStringRef not rely on UB :(.
llvm-svn: 120791
2010-12-03 05:42:25 +00:00
Michael J. Spencer 31e310cda0 Support/FileSystem: Add create_director{y,ies} implementations.
llvm-svn: 120790
2010-12-03 05:42:11 +00:00
Michael J. Spencer a41772aa0f Support/Windows/FileSystem: Remove unneeded toNullTerminatedStringRef.
llvm-svn: 120777
2010-12-03 01:21:38 +00:00
Michael J. Spencer 4571040ea1 Support/FileSystem: Add unique_file and exists implementations.
llvm-svn: 120776
2010-12-03 01:21:28 +00:00
Michael J. Spencer 795adf5061 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 f2cc8287ed Support/ADT/Twine: Add toNullTerminatedStringRef.
llvm-svn: 120600
2010-12-01 20:37:30 +00:00
Michael J. Spencer 9fc1d9dcc3 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 25a5e4ca1f 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 a72df5fae8 Support/PathV2: Add is_{absolute,relative} implementation.
llvm-svn: 120560
2010-12-01 06:21:53 +00:00
Michael J. Spencer 112a769379 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 87106c59ed Support/PathV2: Add extension implementation.
llvm-svn: 120550
2010-12-01 03:37:41 +00:00
Michael J. Spencer 956955ed8b Support/PathV2: Add stem implementation.
llvm-svn: 120547
2010-12-01 03:18:33 +00:00
Michael J. Spencer 142692006b Support/PathV2: Add filename implementation.
llvm-svn: 120546
2010-12-01 03:18:17 +00:00
Michael J. Spencer 8002500ee1 Support/PathV2: Add native implementation.
llvm-svn: 120539
2010-12-01 02:48:27 +00:00
Dan Gohman e41b1463f9 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 fb3a95d8e2 Support/PathV2: Add replace_extension implementation.
llvm-svn: 120514
2010-12-01 00:52:55 +00:00
Michael J. Spencer 9c594095a6 Support/PathV2: Add remove_filename implementation.
llvm-svn: 120513
2010-12-01 00:52:28 +00:00
Michael J. Spencer 545cbdf063 Support/PathV2: Implement reverse iteration and parent_path.
llvm-svn: 120496
2010-11-30 23:28:07 +00:00
Michael J. Spencer e1d3603dc6 Support/ADT/StringRef: Add find_last_of.
llvm-svn: 120495
2010-11-30 23:27:35 +00:00
Jay Foad 15084f085d 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 ebad2f9d36 Support: Add PathV2 implementation.
llvm-svn: 120329
2010-11-29 22:28:51 +00:00
Charles Davis 54c9eb6fff 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 4d2e1501ad Missed a spot.
llvm-svn: 120301
2010-11-29 18:29:55 +00:00
Michael J. Spencer 447762da85 Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Jay Foad 3447fb01c0 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 f2d08136bf Remove PIC16 remnants.
llvm-svn: 120223
2010-11-27 18:20:30 +00:00
Daniel Dunbar 65dc891942 raw_ostream::write_escaped: Add a UseHexEscapes argument.
llvm-svn: 120200
2010-11-27 07:59:50 +00:00
Michael J. Spencer f13f442b1a Fix Whitespace.
llvm-svn: 120166
2010-11-26 04:16:08 +00:00
Jakob Stoklund Olesen a12095d26d 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 6bf4e6d8b2 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 2dd97d2d60 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 cf14a382ec Fix a use after free. Patch by Frits van Bommel.
llvm-svn: 119842
2010-11-19 21:14:29 +00:00
Jakob Stoklund Olesen 345945e355 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 09770251f6 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 6d89171dcc 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 461e704a2c 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 5ed61fe6a1 Bounds-check APInt's operator[].
llvm-svn: 119708
2010-11-18 17:14:56 +00:00
Chris Lattner b0e36085c4 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