summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* Instead friending status, provide windows and posix constructors to file_status.Rafael Espindola2013-07-162-25/+18
| | | | | | | This opens the way of having static helpers in the .inc files that can construct a file_status. llvm-svn: 186376
* Remove an extra is_directory call.Rafael Espindola2013-07-151-11/+0
| | | | | | I checked that opening a directory on windows does fail, so this saves a "stat". llvm-svn: 186345
* Add include to hopefully fix windows build.Craig Topper2013-07-151-0/+1
| | | | llvm-svn: 186310
* Revert part of 186302 to fix buildbots.Craig Topper2013-07-151-1/+2
| | | | llvm-svn: 186303
* Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).Craig Topper2013-07-152-7/+4
| | | | llvm-svn: 186301
* Add DW_AT_GNU_odr_signature to the set of dwarf attributes.Eric Christopher2013-07-141-0/+1
| | | | llvm-svn: 186296
* Windows/TimeValue.inc: Mute prefixed '0' on %d to emulate %e.NAKAMURA Takumi2013-07-121-0/+5
| | | | | | It fixes compatibility in llvm/test/Object/archive-toc.test. llvm-svn: 186142
* Add back code for supporting old mingw versions. Should bring the bots back.Rafael Espindola2013-07-111-3/+13
| | | | llvm-svn: 186096
* Don't use a potentially expensive shift if all we want is one set bit.Benjamin Kramer2013-07-111-1/+1
| | | | | | No functionality change. llvm-svn: 186095
* Looks like some versions of mingw don't have errno_t. Use int.Rafael Espindola2013-07-111-1/+1
| | | | llvm-svn: 186092
* Use move semantics if possible to construct ConstantRanges.Benjamin Kramer2013-07-111-5/+6
| | | | | | | Arithmetic on ConstantRanges creates a lot of large temporary APInts that benefit from move semantics. llvm-svn: 186091
* Fix a FIXME about the format and add a test.Rafael Espindola2013-07-112-26/+16
| | | | | | | While at it, use strftime on Unix too and use the thread safe versions of localtime. llvm-svn: 186090
* MemoryBuffer::getFile handles zero sized files, no need to duplicate the test.Rafael Espindola2013-07-101-21/+2
| | | | llvm-svn: 186018
* Use status to implement file_size.Rafael Espindola2013-07-102-35/+1
| | | | | | | | | | The status function is already using a syscall that returns the file size. Remember it and implement file_size as a simple wrapper. No functionally change, but clients that already use status now can avoid calling file_size. llvm-svn: 186016
* Revert r185852.Manman Ren2013-07-081-5/+0
| | | | llvm-svn: 185861
* Find xdot or xdot.py.Matt Arsenault2013-07-081-3/+3
| | | | | | Ubuntu installs this as xdot, so finding xdot.py would fail. llvm-svn: 185860
* StringRef: add DenseMapInfo for StringRef.Manman Ren2013-07-081-0/+5
| | | | | | | | Remove the implementation in include/llvm/Support/YAMLTraits.h. Added a DenseMap type DITypeHashMap in DebugInfo.h: DenseMap<std::pair<StringRef, unsigned>, MDNode*> llvm-svn: 185852
* We now always create files with the correct permissions. Simplify the interface.Rafael Espindola2013-07-082-65/+1
| | | | llvm-svn: 185834
* Create files with the correct permission instead of changing it afterwards.Rafael Espindola2013-07-081-22/+7
| | | | | | Not intended functionality change. llvm-svn: 185830
* Remove unique_file now that it is unused.Rafael Espindola2013-07-051-17/+0
| | | | llvm-svn: 185728
* Add a createUniqueFile function and switch llvm's users of unique_file.Rafael Espindola2013-07-053-6/+16
| | | | | | | | | | | | | | This function is complementary to createTemporaryFile. It handles the case were the unique file is *not* temporary: we will rename it in the end. Since we will rename it, the file has to be in the same filesystem as the final destination and we don't prepend the system temporary directory. This has a small semantic difference from unique_file: the default mode is 0666. This matches the behavior of most unix tools. For example, with this change lld now produces files with the same permissions as ld. I will add a test of this change when I port clang over to createUniqueFile (next commit). llvm-svn: 185726
* Use sys::fs::createTemporaryFile.Rafael Espindola2013-07-051-2/+1
| | | | llvm-svn: 185719
* Add a higher level createTemporaryFile function.Rafael Espindola2013-07-051-0/+34
| | | | | | | | This function is inspired by clang's Driver::GetTemporaryPath. It hides the pattern used for uniquing and requires simple file names that are always placed in the system temporary directory. llvm-svn: 185716
* Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-041-1/+1
| | | | | | specifying the vector size. llvm-svn: 185606
* Reapply r185601 with a fix for the cmake build.Eric Christopher2013-07-041-0/+10
| | | | llvm-svn: 185605
* Temporarily revert 185601 as it caused cmake build regressions.Eric Christopher2013-07-041-10/+0
| | | | llvm-svn: 185603
* Add support for futimens for platforms that don't support futimes.Eric Christopher2013-07-041-0/+10
| | | | | | Patch by pashev.igor. llvm-svn: 185601
* [APFloat] Swap an early out check so we do not dereference str.end().Michael Gottesman2013-07-021-1/+1
| | | | | | | Originally if D.firstSigDigit == str.end(), we will have already dereferenced D.firstSigDigit in the first predicate. llvm-svn: 185437
* [APFloat] Ensure that we can properly parse strings that do not have null ↵Michael Gottesman2013-07-011-1/+8
| | | | | | | | terminators. rdar://14323230 llvm-svn: 185397
* Fix a bad overflow check pointed out by Ben.Jakob Stoklund Olesen2013-06-281-4/+2
| | | | llvm-svn: 185226
* Eliminate an assortment of undefined behavior.Jakob Stoklund Olesen2013-06-281-1/+5
| | | | | | Hopefully, this fixes the PPC64 buildbots. llvm-svn: 185218
* Stylistic cleanups, no functional change.Jakob Stoklund Olesen2013-06-281-10/+7
| | | | | | | | - Use static functions instead of anonymous namespace. - Appease the Doxygen lobby. - Use 0-based induction variable. llvm-svn: 185185
* Add a division operator to BlockFrequency.Jakob Stoklund Olesen2013-06-281-23/+35
| | | | | | | | | | | Allow a BlockFrequency to be divided by a non-zero BranchProbability with saturating arithmetic. This will be used to compute the frequency of a loop header given the probability of leaving the loop. Our long division algorithm already saturates on overflow, so that was a freebie. llvm-svn: 185184
* Improve comment.Rafael Espindola2013-06-281-4/+3
| | | | llvm-svn: 185141
* Suppress GCC "control reaches end of non-void function" warning.Patrik Hagglund2013-06-281-0/+1
| | | | llvm-svn: 185136
* Improvements to unique_file and createUniqueDirectory.Rafael Espindola2013-06-283-241/+235
| | | | | | | | | | | | | | | | | | | * Don't try to create parent directories in unique_file. It had two problem: * It violates the contract that it is atomic. If the directory creation success and the file creation fails, we would return an error but the file system was modified. * When creating a temporary file clang would have to first check if the parent directory existed or not to avoid creating one when it was not supposed to. * More efficient implementations of createUniqueDirectory and the unique_file that produces only the file name. Now all 3 just call into a static function passing what they want (name, file or directory). Clang also has to be updated, so tests might fail if a bot picks up this commit and not the corresponding clang one. llvm-svn: 185126
* Don't ask for a mode when we are not keeping the file.Rafael Espindola2013-06-281-2/+2
| | | | llvm-svn: 185123
* Revert "Revert "[APFloat] Removed APFloat constructor which initialized to ↵Michael Gottesman2013-06-271-15/+5
| | | | | | | | | | | | | | | | | | | | either zero/NaN but allowed you to arbitrarily set the category of the float."" This reverts commit r185099. Looks like both the ppc-64 and mips bots are still failing after I reverted this change. Since: 1. The mips bot always performs a clean build, 2. The ppc64-bot failed again after a clean build (I asked the ppc-64 maintainers to clean the bot which they did... Thanks Will!), I think it is safe to assume that this change was not the cause of the failures that said builders were seeing. Thus I am recomitting. llvm-svn: 185111
* Revert "[APFloat] Removed APFloat constructor which initialized to either ↵Michael Gottesman2013-06-271-5/+15
| | | | | | | | | | | | zero/NaN but allowed you to arbitrarily set the category of the float." This reverts commit r185095. This is causing a FileCheck failure on the 3dnow intrinsics on at least the mips/ppc bots but not on the x86 bots. Reverting while I figure out what is going on. llvm-svn: 185099
* [APFloat] Removed APFloat constructor which initialized to either zero/NaN ↵Michael Gottesman2013-06-271-15/+5
| | | | | | | | | | | | | | but allowed you to arbitrarily set the category of the float. The category which an APFloat belongs to should be dependent on the actual value that the APFloat has, not be arbitrarily passed in by the user. This will prevent inconsistency bugs where the category and the actual value in APFloat differ. I also fixed up all of the references to this constructor (which were only in LLVM). llvm-svn: 185095
* Add a convenience createUniqueDirectory function.Rafael Espindola2013-06-271-0/+11
| | | | | | | | | | | There are a few valid situation where we care about the structure inside a directory, but not about the directory itself. A simple example is for unit testing directory traversal. PathV1 had a function like this, add one to V2 and port existing users of the created temp file and delete it hack to using it. llvm-svn: 185059
* [APFloat] Convert all references to fcNormal to references to isFiniteNonZero().Michael Gottesman2013-06-261-30/+30
| | | | | | | | | | | | Currently inside APFloat fcNormal still implies the old definition of Normal (i.e. isFiniteNonZero) instead of the proper IEEE-754R definition that the external method isNormal() uses. This patch prepares for the internal switch inside APFloat by converting all references that check if a category is fcNormal directly with an indirect call via isFiniteNonZero(). llvm-svn: 185036
* Rename PathV2 to just Path now that it is the only one.Rafael Espindola2013-06-264-11/+11
| | | | llvm-svn: 185015
* Use enums instead of raw octal values.Rafael Espindola2013-06-261-1/+0
| | | | | | Patch by 罗勇刚(Yonggang Luo). llvm-svn: 184971
* PathV1 is deprecated since the 18th of Dec 2010. Remove it.Rafael Espindola2013-06-264-1164/+0
| | | | llvm-svn: 184960
* Remove calls to Path in #ifdefs that don't seem to be used in any of the ↵Rafael Espindola2013-06-261-3/+3
| | | | | | bots :-( llvm-svn: 184920
* Fix the build when __APPLE__ is defined.Rafael Espindola2013-06-261-1/+5
| | | | llvm-svn: 184917
* Remove sys::GetMainExecutable.Rafael Espindola2013-06-262-116/+0
| | | | llvm-svn: 184916
* Port GetMainExecutable over to PathV2.Rafael Espindola2013-06-262-0/+113
| | | | | | I will remove the V1 version as soon as I change clang in the next commit. llvm-svn: 184914
* Remove PathWithStatus.Rafael Espindola2013-06-262-49/+0
| | | | llvm-svn: 184910
OpenPOWER on IntegriCloud