aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* Fix PR4040: APInt's string constructor is too strictChris Lattner2009-04-251-7/+9
| | | | | | | patch by Jeff Yasskin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70058 91177308-0d34-0410-b5e6-96231b3b80d8
* Make all raw_ostreams support the tell() function.Douglas Gregor2009-04-201-0/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69583 91177308-0d34-0410-b5e6-96231b3b80d8
* teach EscapeString and UnescapeString to handle ".Chris Lattner2009-04-151-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69211 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove AllowInverse: it leaks memory and is not the rightChris Lattner2009-04-081-21/+0
| | | | | | | abstraction for CommandLine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68588 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix build on Linux.Mikhail Glushenkov2009-04-021-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68269 91177308-0d34-0410-b5e6-96231b3b80d8
* Add llvm::Triple class for abstracting access to target triples.Daniel Dunbar2009-04-011-0/+183
| | | | | | | | | | | - The code is silly, I'm just amusing myself. Rewrite to be efficient if you like. :) Also, if you wish to debate the proper names of the triple components I'm all ears. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68252 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CHAR_BIT instead of hard-coding 8 in several places where itDan Gohman2009-04-011-3/+3
| | | | | | | | is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68227 91177308-0d34-0410-b5e6-96231b3b80d8
* * Fixed spelling of `invertible'Misha Brukman2009-04-011-2/+2
| | | | | | | * Simplified if statement git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68163 91177308-0d34-0410-b5e6-96231b3b80d8
* move a large method out of line.Chris Lattner2009-03-281-0/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67892 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix internal representation of fp80 to be theDale Johannesen2009-03-231-8/+6
| | | | | | | | | | | | same as a normal i80 {low64, high16} rather than its own {high64, low16}. A depressing number of places know about this; I think I got them all. Bitcode readers and writers convert back to the old form to avoid breaking compatibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67562 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that errs() is properly non-buffered, there's no need toDan Gohman2009-03-231-1/+0
| | | | | | | explicitly flush it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67526 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment typo.Duncan Sands2009-03-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67302 91177308-0d34-0410-b5e6-96231b3b80d8
* Add BUILTIN_EXPECT Support/Compiler macro.Daniel Dunbar2009-03-171-1/+2
| | | | | | | | | | - Use for exceptional buffer conditions in raw_ostream:write to shave off a cycle or two. - Please rename if you have a better one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67103 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream: Put all exceptional conditions in raw_ostream::writeDaniel Dunbar2009-03-171-18/+30
| | | | | | | | | under a single branch. Also, add a FIXME for formatted output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67069 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream: Rework implementation of unbuffered streams so outputtingDaniel Dunbar2009-03-171-4/+12
| | | | | | | | | | a single character requires only one branch to follow slow path. - Never use a buffer when writing on an unbuffered stream. - Move default buffer size to header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67066 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream: Replace flush_impl with write_impl, which takes data toDaniel Dunbar2009-03-161-32/+15
| | | | | | | | | | write as arguments. - Add raw_ostream::GetNumBytesInBuffer. - Privatize buffer pointers. - Get rid of slow and unnecessary code for writing out large strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67060 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream: Lift out flush_nonempty.Daniel Dunbar2009-03-161-20/+21
| | | | | | | | | | | | | | | | | | - Flush a known non-empty buffers; enforces the interface to flush_impl and kills off HandleFlush (which I saw no reason to be an inline method, Chris?). - Clarify invariant that flush_impl is only called with OutBufCur > OutBufStart. - This also cleary collects all places where we have to deal with the buffer possibly not existing. - A few more comments and fixing the unbuffered behavior remain in this commit sequence. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67057 91177308-0d34-0410-b5e6-96231b3b80d8
* Make raw_ostream::operator<<(const void *) fast; it doesn't matter butDaniel Dunbar2009-03-161-2/+19
| | | | | | | it is easy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67054 91177308-0d34-0410-b5e6-96231b3b80d8
* Add slow path for single character write, and use exclusively forDaniel Dunbar2009-03-161-8/+8
| | | | | | | single characters writes outside of the fast path in raw_ostream.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67053 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a hashing bug in APInt. A certain pathological testcase (tooStuart Hastings2009-03-131-7/+85
| | | | | | | | | | | | | large for the testsuite) took over six minutes to compile on my Mac. The patched LLVM-GCC compiles that testcase in three seconds (GCC takes less than one second). This hash function is more complex (about 35 instructions on x86) than what Chris wanted, but I expect it will be well-behaved with arbitrary inputs. Thank you to everyone who responded to my previous request for advice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66962 91177308-0d34-0410-b5e6-96231b3b80d8
* just initialize the first element, we don't need to set the rest to zeros.Chris Lattner2009-03-131-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66850 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate a 9640 byte static mutable initialized data item by moving itChris Lattner2009-03-131-2/+2
| | | | | | | to the stack. This shrinks all llvm tools by 9k, and improves reentrancy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66847 91177308-0d34-0410-b5e6-96231b3b80d8
* static functions don't need an anonymous namespace.Chris Lattner2009-03-121-373/+371
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66845 91177308-0d34-0410-b5e6-96231b3b80d8
* PR3478: raw_ostream should not buffer stderrDaniel Dunbar2009-03-101-1/+5
| | | | | | | | - Add unbuffered flag to raw_ostream, forwarded by raw_fd_ostream and used by raw_stderr_ostream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66545 91177308-0d34-0410-b5e6-96231b3b80d8
* Use c_str() to force the string to be nul-terminated.Dan Gohman2009-03-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66279 91177308-0d34-0410-b5e6-96231b3b80d8
* on apple systems, integrate nicely with crash reporter.Chris Lattner2009-03-061-4/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66264 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing file.Duncan Sands2009-03-051-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66160 91177308-0d34-0410-b5e6-96231b3b80d8
* Daniel wanted the stack printed upside down. Perhaps heChris Lattner2009-03-051-6/+14
| | | | | | | | | | | | | | | feels a kinship to machine stacks that grow down. Now we get stuff like this: Stack dump: 0. Program arguments: clang clang_crash_Iw2Osj.mi 1. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/xmmintrin.h:624:1: parsing function body '_mm_cvtpi16_ps' 2. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/xmmintrin.h:624:1: in compound statement ('{}') Abort git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66145 91177308-0d34-0410-b5e6-96231b3b80d8
* indicate what the program args line is.Chris Lattner2009-03-051-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66144 91177308-0d34-0410-b5e6-96231b3b80d8
* add some helper classes for building light-weight symbolic stack tracesChris Lattner2009-03-041-0/+69
| | | | | | | that get printed when a program crashes. This is the first step of many. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66076 91177308-0d34-0410-b5e6-96231b3b80d8
* The debugger sometimes lookup dynamically in the runtime to find ivar info ↵Devang Patel2009-02-171-0/+2
| | | | | | | | | of any Objective-C classes. It would be very helpful to debugger if the compiler encodes runtime version number in DWARF. Add support for two additional DWARF attributes to encode Objective-C runtime version number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64834 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak the build on win32.Cédric Venet2009-02-141-1/+1
| | | | | | | | | | | Cleanup some warning. Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync. Only tested with VS2008. hope it does not break anything. feel free to revert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64554 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch from new[] + delete[] to malloc + free since llvm does not catch C++ ↵Evan Cheng2009-02-131-3/+3
| | | | | | exceptions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64448 91177308-0d34-0410-b5e6-96231b3b80d8
* If new[] fails, return 0 rather then trying to dereference a null pointer.Evan Cheng2009-02-131-3/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64444 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an API for strings with possible NULLs in the middle. Refactor the otherNick Lewycky2009-02-071-37/+8
| | | | | | | two AddString methods to use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64005 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve -fno-opt style option processing to not require an extraMike Stump2009-02-021-19/+2
| | | | | | | | option to make the -fno- form on the option. We also document the new form in the CommandLine documentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63559 91177308-0d34-0410-b5e6-96231b3b80d8
* Add opposite_of and inverse_opt to support -fno- style options. ThisMike Stump2009-01-301-1/+21
| | | | | | | is necessary for eventual gcc commmand line compatibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63384 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarify comment.Mikhail Glushenkov2009-01-281-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63171 91177308-0d34-0410-b5e6-96231b3b80d8
* APInt's countLeadingOnes() was broken for negative i128 values,edwin2009-01-271-1/+7
| | | | | | | | | | causing assertion failures in getSExtValue(). Fix it by making highWordBits actually contain what its name says, and add some more unit-tests for APInt. This fixes PR3419. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63107 91177308-0d34-0410-b5e6-96231b3b80d8
* Add method raw_fd_ostream::seek() for random access within a file.Ted Kremenek2009-01-261-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63044 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce two DWARF attribute extentions DW_AT_APPLE_optimized, ↵Devang Patel2009-01-231-0/+2
| | | | | | | | | | | | | DW_AT_APPLE_flags. DW_AT_APPLE_optimized flag is set when a compile_unit is optimized. The debugger takes advantage of this information some way. DW_AT_APPLE_flags encodes command line options when certain env. variable is set. This is used by build engineers to track various gcc command lines used by by a project, irrespective of whether the project used makefile, Xcode or something else. llvm-gcc patch is next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62888 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use host floating point types when emittingDale Johannesen2009-01-212-7/+2
| | | | | | | | | | | ASCII IR; loading and storing these can change the bits of NaNs on some hosts. Remove or add warnings at a few other places using host floating point; this is a bad thing to do in general. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62712 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove uses of uint32_t in favor of 'unsigned' for better Chris Lattner2009-01-211-193/+193
| | | | | | | compatibility with cygwin. Patch by Jay Foad! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62695 91177308-0d34-0410-b5e6-96231b3b80d8
* Mimic gcc behaviour with regard to response files.Mikhail Glushenkov2009-01-211-16/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62688 91177308-0d34-0410-b5e6-96231b3b80d8
* Make special cases (0 inf nan) work for frem.Dale Johannesen2009-01-211-23/+63
| | | | | | | | | | Besides APFloat, this involved removing code from two places that thought they knew the result of frem(0., x) but were wrong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62645 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an IEEE remainder function, which is notDale Johannesen2009-01-201-1/+39
| | | | | | | | | | fully implemented yet and not used. This is mainly to clarify that APFloat::mod implements C fmod, not remainder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62593 91177308-0d34-0410-b5e6-96231b3b80d8
* improve compatibility with various versions of graphviz, patch byChris Lattner2009-01-201-1/+1
| | | | | | | Patrick Boettcher! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62592 91177308-0d34-0410-b5e6-96231b3b80d8
* compile-time fmod was done incorrectly. PR 3316.Dale Johannesen2009-01-191-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62528 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo, sentence fragment.Nick Lewycky2009-01-191-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62512 91177308-0d34-0410-b5e6-96231b3b80d8
* Support for multi-valued options in CommandLineMikhail Glushenkov2009-01-161-4/+40
| | | | | | | Makes possible to specify options that take multiple arguments (a-la -sectalign on Darwin). See documentation for details. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62372 91177308-0d34-0410-b5e6-96231b3b80d8