summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* Use armv6k default for FreeBSD/ARMEd Maste2014-09-091-0/+1
| | | | | | Patch by Andrew Turner. llvm-svn: 217454
* Check whether the iterator p == the end iterator before trying to ↵Nick Lewycky2014-09-061-3/+3
| | | | | | dereference it. This is a speculative fix for a failure found on the valgrind buildbot triggered by a clang test. llvm-svn: 217295
* Fix right shift by 64 bits detected on CXX/lex/lex.literal/lex.ext/p4.cppAlexey Samsonov2014-09-061-1/+3
| | | | | | | | test case on UBSan bootstrap bot. This fixes the last failure of "check-clang" in UBSan bootstrap bot. llvm-svn: 217294
* Reapply "[dwarfdump] Add missing DW_LANG_Mips_Assembler case to ↵Frederic Riss2014-09-051-0/+1
| | | | | | | | LanguageString()" This commit was reverted in r217183, but is OK to go in again now that its dependency is commited (as of r217186). llvm-svn: 217231
* Removed white-spaceMatthew Gardiner2014-09-051-2/+0
| | | | llvm-svn: 217230
* Adding kalimba variants as Triple sub-architectures.Matthew Gardiner2014-09-051-1/+6
| | | | | | | | Reviewed in: http://reviews.llvm.org/D5115 llvm-svn: 217229
* [ dwarfdump ] Add symbolic dump of known DWARF attribute values.Frederic Riss2014-09-041-0/+31
| | | | | | | | | | Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5187 llvm-svn: 217186
* Revert "[dwarfdump] Add missing DW_LANG_Mips_Assembler case to LanguageString()"Frederic Riss2014-09-041-1/+0
| | | | | | | | This reverts commit 93c7e6161e1adbd2c7ac81fa081823183035cb64. This commit got approved first, but was dependant on another one going in (The one pretty printing attribute values). I'll reapply when the other one is in. llvm-svn: 217183
* [dwarfdump] Add missing DW_LANG_Mips_Assembler case to LanguageString()Frederic Riss2014-09-041-0/+1
| | | | | | | | | | Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5193 llvm-svn: 217182
* Add writeFileWithSystemEncoding to LibLLVMSuppor.Rafael Espindola2014-09-034-4/+83
| | | | | | | | | | | | | | | | | | | | This patch adds to LLVMSupport the capability of writing files with international characters encoded in the current system encoding. This is relevant for Windows, where we can either use UTF16 or the current code page (the legacy Windows international characters). On UNIX, the file is always saved in UTF8. This will be used in a patch for clang to thoroughly support response files creation when calling other tools, addressing PR15171. On Windows, to correctly support internationalization, we need the ability to write response files both in UTF16 or the current code page, depending on the tool we will call. GCC for mingw, for instance, requires files to be encoded in the current code page. MSVC tools requires files to be encoded in UTF16. Patch by Rafael Auler! llvm-svn: 217068
* Removing static initializer from Debug.cpp by converting to a ManagedStatic.Chris Bieneman2014-09-031-4/+5
| | | | | | | | This is part of our larger effort to remove static initializers from LLVM libraries. Reviewed by: chandlerc llvm-svn: 217053
* Cleaning up remaining static initializers in Signals.incChris Bieneman2014-09-021-24/+31
| | | | llvm-svn: 216996
* unique_ptrify the result of SpecialCaseList::createDavid Blaikie2014-09-021-7/+8
| | | | llvm-svn: 216925
* unique_ptrify FileOutputBuffer::FileOutputBufferDavid Blaikie2014-09-021-10/+7
| | | | llvm-svn: 216921
* Revert: [APFloat] Fixed a bug in method 'fusedMultiplyAdd'.Andrea Di Biagio2014-09-021-1/+1
| | | | | | | This reverts revision 216913; the new test added at revision 216913 caused regression failures on a couple of buildbots. llvm-svn: 216914
* [APFloat] Fixed a bug in method 'fusedMultiplyAdd'.Andrea Di Biagio2014-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When folding a fused multiply-add builtin call, make sure that we propagate the correct result in the case where the addend is zero, and the two other operands are finite non-zero. Example: define double @test() { %1 = call double @llvm.fma.f64(double 7.0, double 8.0, double 0.0) ret double %1 } Before this patch, the instruction simplifier wrongly folded the builtin call in function @test to constant 'double 7.0'. With this patch, method 'fusedMultiplyAdd' correctly evaluates the multiply and propagates the expected result (i.e. 56.0). Added test fold-builtin-fma.ll with the reproducible from PR20832 plus extra test cases to verify the behavior of method 'fusedMultiplyAdd' in the presence of NaN/Inf operands. This fixes PR20832. Differential Revision: http://reviews.llvm.org/D5152 llvm-svn: 216913
* Fix some cases where StringRef was being passed by const reference. Remove ↵Craig Topper2014-08-303-15/+14
| | | | | | const from some other StringRefs since its implicitly const already. llvm-svn: 216820
* Cleaning up static initializers in Signals.incChris Bieneman2014-08-291-5/+4
| | | | | | Reviewed by: Chandlerc llvm-svn: 216704
* Cleaning up static initializers in TimeValue.Chris Bieneman2014-08-292-7/+1
| | | | | | Code reviewed by Chandlerc llvm-svn: 216703
* Return a std::unique_ptr when creating a new MemoryBuffer.Rafael Espindola2014-08-271-34/+27
| | | | llvm-svn: 216583
* yaml::Stream doesn't need to take ownership of the buffer.Rafael Espindola2014-08-271-25/+26
| | | | | | In fact, most users were already using the StringRef version. llvm-svn: 216575
* Revert "Limit the symbol search in DynamicLibrary to the module that was ↵Zachary Turner2014-08-271-9/+2
| | | | | | | | opened." This reverts commit r216563, which breaks lli's dynamic symbol resolution. llvm-svn: 216569
* Limit the symbol search in DynamicLibrary to the module that was opened.Zachary Turner2014-08-271-2/+9
| | | | | | | | Differential Revision: http://reviews.llvm.org/D5030 Reviewed By: Reid Kleckner, Rafael Espindola llvm-svn: 216563
* Add an explicit cast to pacify implicit boolean conversion warnings.Benjamin Kramer2014-08-271-1/+1
| | | | llvm-svn: 216539
* Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or ↵Craig Topper2014-08-272-6/+6
| | | | | | just letting them be implicitly created. llvm-svn: 216525
* Pass a MemoryBufferRef when we can avoid taking ownership.Rafael Espindola2014-08-261-0/+6
| | | | | | | | | | | | | The attached patch simplifies a few interfaces that don't need to take ownership of a buffer. For example, both parseAssembly and parseBitcodeFile will parse the entire buffer before returning. There is no need to take ownership. Using a MemoryBufferRef makes it obvious in the type signature that there is no ownership transfer. llvm-svn: 216488
* Merge TempDir and system_temp_directory.Rafael Espindola2014-08-263-90/+106
| | | | | | | | | We had two functions for finding the temp or cache directory. Each had a different set of smarts about OS specific APIs. With this patch system_temp_directory becomes the only way to do it. llvm-svn: 216460
* Revert "Support/APFloat: unique_ptr-ify temp arrays"Dylan Noblesmith2014-08-261-8/+11
| | | | | | This reverts commit rr216359. llvm-svn: 216429
* Revert "Support/Path: remove raw delete"Dylan Noblesmith2014-08-261-2/+2
| | | | | | This reverts commit r216360. llvm-svn: 216428
* Fix bug in llvm::sys::argumentsFitWithinSystemLimits().Rafael Espindola2014-08-251-2/+2
| | | | | | | | | | | | | This patch fixes a subtle bug in the UNIX implementation of llvm::sys::argumentsFitWithinSystemLimits() regarding the misuse of a static variable. This bug causes our cached number that stores the system command line maximum length to be halved after each call to the function. With a sufficient number of calls to this function, it will eventually report any given command line string to be over system limits. Patch by Rafael Auler. llvm-svn: 216415
* Refactor argument serialization logic when executing process. NFC.Rafael Espindola2014-08-251-13/+17
| | | | | | | | | | | | This patch refactors the argument serialization logic used in the Execute function, used to launch new Windows processes. There is a critical step that joins char** arguments into a single string, building the command line used to launch the new process, and the readability of this code is improved if this part is refactored in its own helper function. Patch by Rafael Auler! llvm-svn: 216411
* Modernize raw_fd_ostream's constructor a bit.Rafael Espindola2014-08-253-24/+15
| | | | | | | | | | Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error. A create static method would be even better, but this patch is already a bit too big. llvm-svn: 216393
* Support/Path: remove raw deleteDylan Noblesmith2014-08-251-2/+2
| | | | llvm-svn: 216360
* Support/APFloat: unique_ptr-ify temp arraysDylan Noblesmith2014-08-251-11/+8
| | | | llvm-svn: 216359
* Support: add llvm::unique_lockDylan Noblesmith2014-08-231-16/+17
| | | | | | | | | | | | | | | Based on the STL class of the same name, it guards a mutex while also allowing it to be unlocked conditionally before destruction. This eliminates the last naked usages of mutexes in LLVM and clang. It also uncovered and fixed a bug in callExternalFunction() when compiled without USE_LIBFFI, where the mutex would never be unlocked if the end of the function was reached. llvm-svn: 216338
* Support: make LLVM Mutexes STL-compatibleDylan Noblesmith2014-08-231-4/+4
| | | | | | Use lock/unlock() convention instead of acquire/release(). llvm-svn: 216336
* Support/Unix: use ScopedLock wherever possibleDylan Noblesmith2014-08-231-24/+22
| | | | | | | Only one function remains a bit too complicated for a simple mutex guard. No functionality change. llvm-svn: 216335
* Fix PR17239 by changing the semantics of the RemainingArgsClass Option kindReid Kleckner2014-08-221-8/+35
| | | | | | | | | | | | | | | | | | | | | | | This patch contains the LLVM side of the fix of PR17239. This bug that happens because the /link (clang-cl.exe argument) is marked as "consume all remaining arguments". However, when inside a response file, /link should only consume all remaining arguments inside the response file where it is located, not the entire command line after expansion. My patch will change the semantics of the RemainingArgsClass kind to always consume only until the end of the response file when the option originally came from a response file. There are only two options in this class: dash dash (--) and /link. Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D4899 Patch by Rafael Auler! llvm-svn: 216280
* Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using ↵David Blaikie2014-08-212-9/+6
| | | | | | std::unique_ptr llvm-svn: 216223
* Remove custom implementations of max/min in StringRef that was originally ↵Craig Topper2014-08-211-9/+9
| | | | | | added to work an old gcc bug. I believe its been fixed by now. llvm-svn: 216156
* Fix undefined behavior (left shift by 64 bits) in ScaledNumber::toString().Alexey Samsonov2014-08-201-0/+3
| | | | | | This bug is reported by UBSan. llvm-svn: 216116
* Fix an off by 1 bug that prevented SmallPtrSet from using all of its 'small' ↵Craig Topper2014-08-201-6/+5
| | | | | | capacity. Then fix the early return in the move constructor that prevented 'small' moves from clearing the NumElements in the moved from object. The directed test missed this because it was always testing large moves due to the off by 1 bug. llvm-svn: 216044
* Don't own the buffer in object::Binary.Rafael Espindola2014-08-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too. Keeping this ownership would make supporting IR inside native objects particularly painful. This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer. This patch introduces a few new types. * MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer. The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how. llvm-svn: 216002
* Convert an ownership comment with std::uinque_ptr.Rafael Espindola2014-08-171-16/+9
| | | | llvm-svn: 215855
* Revert "[Support] Promote cl::StringSaver to a separate utility"Sean Silva2014-08-151-7/+27
| | | | | | | | | This reverts commit r215784 / 3f8a26f6fe16cc76c98ab21db2c600bd7defbbaa. LLD has 3 StringSaver's, one of which takes a lock when saving the string... Need to investigate more closely. llvm-svn: 215790
* [Support] Promote cl::StringSaver to a separate utilitySean Silva2014-08-151-27/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This class is generally useful. In breaking it out, the primary change is that it has been made non-virtual. It seems like being abstract led to there being 3 different (2 in llvm + 1 in clang) concrete implementations which disagreed about the ownership of the saved strings (see the manual call to free() in the unittest StrDupSaver; yes this is different from the CommandLine.cpp StrDupSaver which owns the stored strings; which is different from Clang's StringSetSaver which just holds a reference to a std::set<std::string> which owns the strings). I've identified 2 other places in the codebase that are open-coding this pattern: memcpy(Alloc.Allocate<char>(strlen(S)+1), S, strlen(S)+1) I'll be switching them over. They are * llvm::sys::Process::GetArgumentVector * The StringAllocator member of YAMLIO's Input class This also will allow simplifying Clang's driver.cpp quite a bit. Let me know if there are any other places that could benefit from StringSaver. I'm also thinking of adding a saveStringRef member for getting a stable StringRef. llvm-svn: 215784
* Delete support for AuroraUX.Rafael Espindola2014-08-141-2/+0
| | | | | | | | | auroraux.org is not resolving. I will add this to the release notes as soon as I figure out where to put the 3.6 release notes :-) llvm-svn: 215645
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-2/+2
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* ADT: remove MinGW32 and Cygwin OSType enumSaleem Abdulrasool2014-08-091-9/+13
| | | | | | | | | | | Remove the MinGW32 and Cygwin types from the OSType enumeration. These values are represented via environments of Windows. It is a source of confusion and needlessly clutters the code. The cost of doing this is that we must sink the check for them into the normalization code path along with the spelling. Addresses PR20592. llvm-svn: 215303
* Fix typo.Eric Christopher2014-08-091-1/+1
| | | | llvm-svn: 215266
OpenPOWER on IntegriCloud