aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* Fix these error messages to be less confusing. These errorDan Gohman2010-10-291-9/+5
| | | | | | | | 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
* Remove an unnecessary check and an unnecessary temporary.Mikhail Glushenkov2010-10-281-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117583 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend StringRef's edit-distance algorithm to permit an upper bound on the ↵Douglas Gregor2010-10-191-1/+8
| | | | | | allowed edit distance git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116867 91177308-0d34-0410-b5e6-96231b3b80d8
* lib/Support/raw_ostream.cpp: Fix Cygwin's build.NAKAMURA Takumi2010-10-191-0/+4
| | | | | | 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
* CrashRecoveryContext: Add missing return, so that the signal fires after we ourDaniel Dunbar2010-10-181-0/+3
| | | | | | | 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
* Build with RTTI and exceptions disabled. Only in GCC for now.Oscar Fuentes2010-10-171-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116682 91177308-0d34-0410-b5e6-96231b3b80d8
* Always use binary mode for output stream. This is important to prevent ↵Francois Pichet2010-10-141-0/+13
| | | | | | 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
* fix a bug I introduced, no idea how this didn't repro right.Chris Lattner2010-10-141-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116462 91177308-0d34-0410-b5e6-96231b3b80d8
* add uadd_ov/usub_ov to apint, consolidate constant foldingChris Lattner2010-10-141-0/+12
| | | | | | | | | | 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
* constify these methods.Chris Lattner2010-10-131-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116455 91177308-0d34-0410-b5e6-96231b3b80d8
* add a few operations for signed operations that also Chris Lattner2010-10-131-0/+46
| | | | | | | return an overflow flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116452 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak cmake build.John Thompson2010-10-071-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116003 91177308-0d34-0410-b5e6-96231b3b80d8
* Move tool_output_file into its own file.Dan Gohman2010-10-072-32/+43
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115973 91177308-0d34-0410-b5e6-96231b3b80d8
* After printing "Running 'Graphviz' program... " and running theDan Gohman2010-10-051-6/+10
| | | | | | | | 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
* Grow BumpPtrAllocator's slab size dynamically if we allocated many slabs. ThisBenjamin Kramer2010-09-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | 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
* Removed a bunch of unnecessary target_link_libraries.Oscar Fuentes2010-09-281-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114999 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ConstantRange::makeICmpRegion handle all the edge cases properly. ThisNick Lewycky2010-09-281-10/+28
| | | | | | | also fixes PR8250. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114972 91177308-0d34-0410-b5e6-96231b3b80d8
* Push twines deeper into SourceMgr's error handling methods.Benjamin Kramer2010-09-271-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114847 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete an unused declaration.Dan Gohman2010-09-271-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114839 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for viewing graphviz graphs with xdot.py.Dan Gohman2010-09-271-0/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114832 91177308-0d34-0410-b5e6-96231b3b80d8
* Add better support for environment portion of triple. Original patch byDuncan Sands2010-09-161-6/+32
| | | | | | | Cameron Esfahani, tweaked to use array_lengthof. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114073 91177308-0d34-0410-b5e6-96231b3b80d8
* Some versions of gcc still warn about "ignoring return value ... declaredDuncan Sands2010-09-161-1/+2
| | | | | | | 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
* Create PTX backend. Patch by Che-Liang Chiou!Nick Lewycky2010-09-071-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113235 91177308-0d34-0410-b5e6-96231b3b80d8
* Add completely hokey binary-and and binary-or operations to ConstantRange andNick Lewycky2010-09-071-0/+26
| | | | | | | teach LazyValueInfo to use them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113196 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new isSignWrappedSet() method to ConstantRange.Nick Lewycky2010-09-061-3/+15
| | | | | | | | | | 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
* Use the FindProgramByName fallback only with known absolute paths.Dan Gohman2010-09-021-4/+10
| | | | | | | | | 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
* After some discussion with djg, teach SmallVector to grow from a zeroJohn McCall2010-09-021-1/+1
| | | | | | | | | 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
* llvm::FindExecutable(): Retrieve the name with suffix.exe, if available.NAKAMURA Takumi2010-09-021-0/+4
| | | | | | bugpoint uses it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112803 91177308-0d34-0410-b5e6-96231b3b80d8
* Make tool_output_file's raw_ostream instance a member variable insteadDan Gohman2010-09-012-17/+18
| | | | | | | | | | | 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
* Remove a hack that tries to understand incorrect triples from theDuncan Sands2010-08-301-16/+0
| | | | | | | | | | | | 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
* StringRef::compare_numeric also differed from StringRef::compare for ↵Benjamin Kramer2010-08-261-1/+1
| | | | | | characters > 127. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112189 91177308-0d34-0410-b5e6-96231b3b80d8
* Do unsigned char comparisons in StringRef::compare_lower to be more ↵Benjamin Kramer2010-08-261-4/+4
| | | | | | consistent with compare in corner cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112185 91177308-0d34-0410-b5e6-96231b3b80d8
* Use Bits.data() instead of &Bits[0].Dan Gohman2010-08-241-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111993 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid O(n*m) complexity in StringRef::find_first(_not)_of(StringRef).Benjamin Kramer2010-08-231-4/+13
| | | | | | | | | - 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
* Update CMake build.Benjamin Kramer2010-08-201-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111669 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete SlowOperationInformer, which is no longer used.Dan Gohman2010-08-201-67/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111661 91177308-0d34-0410-b5e6-96231b3b80d8
* Make outs() close its file when its stream is destructed, so thatDan Gohman2010-08-201-2/+4
| | | | | | | pending output errors are detected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111643 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete raw_stdout_ostream and raw_stderr_ostream, which are unusedDan Gohman2010-08-201-12/+4
| | | | | | | | 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
* Move raw_ostream's Error flag into raw_fd_ostream, as that's the onlyDan Gohman2010-08-201-16/+17
| | | | | | | class which is using it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111639 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new tool_output_file class, which extends raw_ostream withDan Gohman2010-08-202-0/+31
| | | | | | | | | 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
* Do not assert when reading an exponent out of range.Dale Johannesen2010-08-191-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111534 91177308-0d34-0410-b5e6-96231b3b80d8
* Make raw_fd_ostream consider itself the owner of STDOUT_FILENO whenDan Gohman2010-08-181-2/+5
| | | | | | | | | | 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
* Tidy.Dan Gohman2010-08-181-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111432 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r111321. This doesn't fix a problem.Dan Gohman2010-08-181-23/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111339 91177308-0d34-0410-b5e6-96231b3b80d8
* stomp some more undefined behavior, PR7775.Chris Lattner2010-08-181-6/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111337 91177308-0d34-0410-b5e6-96231b3b80d8
* include config.h to get config params, hopefully unbreaking mingw builder.Chris Lattner2010-08-171-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111325 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the rest of rdar://8318441 which happens when a raw_fd_ostreamChris Lattner2010-08-171-19/+23
| | | | | | | | | | | | (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
* report_fatal_error can't use errs(), because errs() can call Chris Lattner2010-08-171-8/+26
| | | | | | | | 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
* CrashRecovery: Clear the current context on the first crash, to avoid ↵Daniel Dunbar2010-08-171-0/+4
| | | | | | 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
* CrashRecovery: Add CrashRecoveryContext::GetCurrent(), so clients can find ↵Daniel Dunbar2010-08-171-2/+12
| | | | | | the active context from anywhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111308 91177308-0d34-0410-b5e6-96231b3b80d8