summaryrefslogtreecommitdiff
path: root/lib/Support
Commit message (Collapse)AuthorAge
...
* Fix bug with APInt::getBitsNeeded with for base 10 numbers 0-9.Erick Tryzelaar2009-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79593 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow '+' to appear in APInt strings, and add more unit tests.Erick Tryzelaar2009-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79592 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for including '+' in APFloat strings, more asserts,Erick Tryzelaar2009-08-20
| | | | | | and many new unit tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79574 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment explaining why llvm_unreachable_internal doesn't callDan Gohman2009-08-20
| | | | | | | the ErrorHandler callback. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79541 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix two APFloat bugs in converting hexadecimal constants.Daniel Dunbar2009-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79540 91177308-0d34-0410-b5e6-96231b3b80d8
* Add triple parsing support for TCE.Eli Friedman2009-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79461 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch to SmallString::str from SmallString::c_str, and removeDaniel Dunbar2009-08-19
| | | | | | | SmallString::c_str. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79456 91177308-0d34-0410-b5e6-96231b3b80d8
* Change raw_svector_ostream to reserve the input buffer if necessary, Ted wasDaniel Dunbar2009-08-19
| | | | | | | | | | | | | | right. - This class turns out to be much more convenient to use if we do this; clients can make sure the buffer is always big enough if they care (since our current idiom tends to be to use a SmallString<256> for the input to this we should generally be avoiding an unnecessary malloc). Also, add a convenience raw_svector_ostream::str method which flushes the buffer and returns a StringRef for the vector contents. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79446 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch Twine::str() to use toVector(), which is now efficient.Daniel Dunbar2009-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79437 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch raw_svector_ostream to use the vector as the ostream buffer.Daniel Dunbar2009-08-19
| | | | | | | | - This avoids unnecessary malloc/free overhead in the common case, and unnecessary copying from the ostream buffer into the output vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79434 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively revert r79375, which may be breaking bootstrap, although in aDaniel Dunbar2009-08-19
| | | | | | | rather obscure way (the other candidate is r79377). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79426 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream: Simplify write(unsigned char) to match write(const char*, ↵Daniel Dunbar2009-08-19
| | | | | | unsigned). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79386 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream: Remove pointless redefinitions of tell().Daniel Dunbar2009-08-19
| | | | | | | - The base class implementation is correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79385 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream: Add the capability for subclasses to manually install an externalDaniel Dunbar2009-08-18
| | | | | | | buffer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79382 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream: Reduce FormattedStream's reliance on raw_ostream's implementation.Daniel Dunbar2009-08-18
| | | | | | | | | | | | | | | - Kill off begin(), end(), and iterator. It isn't clear what these mean. Instead provide getBufferStart(), which can be used with GetNumBytesInBuffer to the same effect. - Update ComputeColumn to take arguments for the buffer to scan, this simplifies the implementation of write_impl substantially. - This should also fix possible problems with the scanning pointer pointing outside of the current raw_ostream buffer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79379 91177308-0d34-0410-b5e6-96231b3b80d8
* Speed up raw_ostream::<<(unsigned long long) for 32-bit systems by doing mostDaniel Dunbar2009-08-18
| | | | | | | div/mods in 32-bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79375 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in raw_ostream::write(char) introduced by the change toDan Gohman2009-08-18
| | | | | | | | | | allow underlying stream classes to decline buffering. After calling SetBuffered(), re-check whether the stream is Unbuffered in order to handle the case where the underlying stream has declined buffering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79362 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r78924, disabling buffering defeats all the fast paths in raw_ostream.Daniel Dunbar2009-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79361 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve Triple to recognize the OS in i386-mingw32.Daniel Dunbar2009-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79359 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an uninitialized value warning in APFloat.Erick Tryzelaar2009-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79353 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Triple to recognize the 'bfin' arch.Daniel Dunbar2009-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79325 91177308-0d34-0410-b5e6-96231b3b80d8
* Recognize xscale as an ARM arch.Daniel Dunbar2009-08-18
| | | | | | | - Patch by Yonggang Luo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79315 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Triple matching for pic16 arch and solaris OS.Daniel Dunbar2009-08-18
| | | | | | | - Patch by Yonggang Luo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79314 91177308-0d34-0410-b5e6-96231b3b80d8
* the MinPad argument to PadToColumn only really makes sense to be 1,Chris Lattner2009-08-17
| | | | | | | just remove the argument and replace it with 1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79246 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify APFloat to take a StringRef instead of a c string.Erick Tryzelaar2009-08-16
| | | | | | | This also adds unit tests to APFloat that mainly tests the string handling of APFloat, but not much else of it's api. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79210 91177308-0d34-0410-b5e6-96231b3b80d8
* Mingw also doesn't have st_blksize.Dan Gohman2009-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79142 91177308-0d34-0410-b5e6-96231b3b80d8
* Always check to see if raw_fd_ostream's file descriptor is attached toDan Gohman2009-08-15
| | | | | | | a terminal, not just when it's STDOUT_FILENO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79066 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for column computation on unbuffered streams.Dan Gohman2009-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79065 91177308-0d34-0410-b5e6-96231b3b80d8
* Move FormattedStream's write_impl out of line.Dan Gohman2009-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79064 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unnecessary #include.Dan Gohman2009-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79063 91177308-0d34-0410-b5e6-96231b3b80d8
* fix "pc" to be lower case in a target triple, patch by Yonggang LuoChris Lattner2009-08-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79016 91177308-0d34-0410-b5e6-96231b3b80d8
* When standard output is a terminal, set outs() to be unbuffered, toDan Gohman2009-08-13
| | | | | | | | | mimic the behavior of stdtout, which is line-buffered when the output is a terminal. This fixes some issues with bugpoint output appearing being printed out of order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78953 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a compiler warning about comparing signed with unsigned.Dan Gohman2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78933 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an assert to check copy_to_buffer's precondition.Dan Gohman2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78926 91177308-0d34-0410-b5e6-96231b3b80d8
* Set raw_os_ostream, raw_string_ostream, and raw_svector_ostream to beDan Gohman2009-08-13
| | | | | | | | | unbuffered. std::ostream does its own buffering, and std::string and SmallVector both have allocation strategies intended to handle frequent appending. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78924 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to raw_ostream for sizing the buffer according to theDan Gohman2009-08-13
| | | | | | | | needs of the underlying output mechanism. raw_fd_ostream now uses st_blksize from fstat to determine a buffer size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78923 91177308-0d34-0410-b5e6-96231b3b80d8
* Move SetBufferSize and SetUnbuffered out of line.Dan Gohman2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78909 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the buffer handling logic so that write_impl is always called withDan Gohman2009-08-13
| | | | | | | | a full buffer, rather than often being called with a slightly-less-than-full buffer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78907 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef.Daniel Dunbar2009-08-13
| | | | | | | - Patch by Erick Tryzelaar, with some edits (and a bug fix) from me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78885 91177308-0d34-0410-b5e6-96231b3b80d8
* This void is implicit in C++.Dan Gohman2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78848 91177308-0d34-0410-b5e6-96231b3b80d8
* Add attempted idiotproofing comment per review.Dale Johannesen2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78825 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a nondeterministic bug in APInt::roundToDouble;Dale Johannesen2009-08-12
| | | | | | | | | | when !isSingleWord() but getActiveBits() is small, we were using the pointer value instead of the low word of the integer value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78821 91177308-0d34-0410-b5e6-96231b3b80d8
* the x86 version of the name is x86-64, not x86_64. Handle this properlyChris Lattner2009-08-12
| | | | | | | in getArchTypeForLLVMName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78799 91177308-0d34-0410-b5e6-96231b3b80d8
* add support for mingw64 target triples.Chris Lattner2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78797 91177308-0d34-0410-b5e6-96231b3b80d8
* add a couple of helpers to the Triple class for decodingChris Lattner2009-08-12
| | | | | | | | | the darwin version string. This should help consolidate the variety of weird functions we have scattered around the codebase that do stuff like this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78792 91177308-0d34-0410-b5e6-96231b3b80d8
* add a trivial line # cache to SourceMgr to make repeated queries toChris Lattner2009-08-11
| | | | | | | | FindLineNumber much faster when in sequence. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78693 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for a user supplied pointer argument to llvm_install_error_handler.Daniel Dunbar2009-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78553 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix FindExecutable to use sys::Path::GetMainExecutable instead ofDan Gohman2009-08-05
| | | | | | | | | | | | | | just argv[0]. And remove the code for searching the current working directory and for searching PATH; the point of FindExecutable is not to find whatever version of the executable can be found by searching around, but to find an executable that accompanies the current executable. Update the tools to use sys::Program::FindProgramByName when they want PATH searching. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78240 91177308-0d34-0410-b5e6-96231b3b80d8
* cerr isn't buffered so it doesn't need to be flushed.Dan Gohman2009-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78135 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove now unused arguments from TargetRegistry::lookupTarget.Daniel Dunbar2009-08-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77950 91177308-0d34-0410-b5e6-96231b3b80d8