summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* [msan] Annotate zlib functions for MemorySanitizer.Evgeniy Stepanov2014-11-251-0/+6
| | | | | | | | | | | | | Mark destination buffer in zlib::compress and zlib::decompress as fully initialized. When building LLVM with system zlib and MemorySanitizer instrumentation, MSan does not observe memory writes in zlib code and erroneously considers zlib output buffers as uninitialized, resulting in false use-of-uninitialized memory reports. This change helps MSan understand the state of that memory and prevents such reports. llvm-svn: 222763
* More long path name support on Windows, this time in program execution.Paul Robinson2014-11-243-9/+24
| | | | | | | Allows long paths for the executable and redirected stdin/stdout/stderr. Addresses PR21563. llvm-svn: 222671
* Allow multiple -debug-only argsMatthias Braun2014-11-211-6/+17
| | | | | | Debug output is shown if any of the -debug-only arguments match. llvm-svn: 222547
* Remove support for undocumented SpecialCaseList entries.Alexey Samsonov2014-11-201-12/+0
| | | | | | | | | | | | | "global-init", "global-init-src" and "global-init-type" were originally used to blacklist entities in ASan init-order checker. However, they were never documented, and later were replaced by "=init" category. Old blacklist entries should be converted as follows: * global-init:foo -> global:foo=init * global-init-src:bar -> src:bar=init * global-init-type:baz -> type:baz=init llvm-svn: 222401
* [ADT] Fix PR20728 - Incorrect APFloat::fusedMultiplyAdd results for x86_fp80.Lang Hames2014-11-191-12/+24
| | | | | | | | | | | | | | As detailed at http://llvm.org/PR20728, due to an internal overflow in APFloat::multiplySignificand the APFloat::fusedMultiplyAdd method can return incorrect results for x87DoubleExtended (x86_fp80) values. This commonly manifests as incorrect constant folding of libm fmal calls on x86. E.g. fmal(1.0L, 1.0L, 3.0L) == 0.0L (should be 4.0L) This patch fixes PR20728 by adding an extra bit to the significand for intermediate results of APFloat::multiplySignificand, avoiding the overflow. llvm-svn: 222374
* Update SetVector to rely on the underlying set's insert to return a ↵David Blaikie2014-11-192-8/+10
| | | | | | | | | | | | | pair<iterator, bool> This is to be consistent with StringSet and ultimately with the standard library's associative container insert function. This lead to updating SmallSet::insert to return pair<iterator, bool>, and then to update SmallPtrSet::insert to return pair<iterator, bool>, and then to update all the existing users of those functions... llvm-svn: 222334
* Remove StringMap::GetOrCreateValue in favor of StringMap::insertDavid Blaikie2014-11-192-3/+3
| | | | | | | | | | | | | | Having two ways to do this doesn't seem terribly helpful and consistently using the insert version (which we already has) seems like it'll make the code easier to understand to anyone working with standard data structures. (I also updated many references to the Entry's key and value to use first() and second instead of getKey{Data,Length,} and get/setValue - for similar consistency) Also removes the GetOrCreateValue functions so there's less surface area to StringMap to fix/improve/change/accommodate move semantics, etc. llvm-svn: 222319
* Support ELF files of unknown type.Michael J. Spencer2014-11-181-0/+3
| | | | llvm-svn: 222208
* Fix ARM triple parsingRenato Golin2014-11-171-13/+48
| | | | | | | | | The triple parser should only accept existing architecture names when the triple starts with armv, armebv, thumbv or thumbebv. Patch by Gabor Ballabas. llvm-svn: 222129
* silence gcc 4.9.1 warning in /llvm/lib/Support/Windows/Path.inc:564:39:Yaron Keren2014-11-171-1/+1
| | | | | | | warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (ec = widenPath(path, path_utf16)) llvm-svn: 222122
* SearchForAddressOfSymbol(): Disable 3 symbols, copysignf, fminf, and fmaxf, ↵NAKAMURA Takumi2014-11-141-1/+1
| | | | | | on msc17. *These were added in VS 2013* llvm-svn: 221971
* Fix the VS 2012 buildReid Kleckner2014-11-131-5/+7
| | | | | | VS 2012 doesn't have fminf or fmaxf. llvm-svn: 221949
* Fix symbol resolution of floating point libc builtins in MCJITReid Kleckner2014-11-132-9/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for LLI failure on Windows\X86: http://llvm.org/PR5053 LLI.exe crashes on Windows\X86 when single precession floating point intrinsics like the following are used: acos, asin, atan, atan2, ceil, copysign, cos, cosh, exp, floor, fmin, fmax, fmod, log, pow, sin, sinh, sqrt, tan, tanh The above intrinsics are defined as inline-expansions in math.h, and are not exported by msvcr120.dll (Win32 API GetProcAddress returns null). For an FREM instruction, the JIT compiler generates a call to a stub for the fmodf() intrinsic, and adds a relocation to fixup at load time. The loader searches the libraries for the function, but fails because the symbol is not exported. So, the call target remains NULL and the execution crashes. Since the math functions are loaded at JIT/runtime, the JIT can patch CALL instruction directly instead of the searching the libraries' exported symbols. However, this fix caused build failures due to unresolved symbols like _fmodf at link time. Therefore, the current fix defines helper functions in the Runtime link/load library to perform the above operations. The address of these helper functions are used to patch up the CALL instruction at load time. Reviewers: lhames, rnk Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D5387 Patch by Swaroop Sridhar! llvm-svn: 221947
* Avoid usage of char16_t as MSVC "14" doesn't appear to support itReid Kleckner2014-11-131-4/+4
| | | | | | Fixes the MSVC "14" build. llvm-svn: 221932
* Fixing -Wtype-limits warnings with the asserts (the expression would always ↵Aaron Ballman2014-11-131-3/+3
| | | | | | evaluate to true). Also fixing a -Wcast-qual warning, where the cast expression isn't required. llvm-svn: 221888
* Read 64 bits at a time in the bitcode reader.Rafael Espindola2014-11-131-4/+3
| | | | | | | The reading of 64 bit values could still be optimized, but at least this cuts down on the number of virtual calls to fetch more data. llvm-svn: 221865
* Improve long path name support on Windows.Paul Robinson2014-11-131-38/+66
| | | | | | | | | | Windows normally limits the length of an absolute path name to 260 characters; directories can have lower limits. These limits increase to about 32K if you use absolute paths with the special '\\?\' prefix. Teach Support\Windows\Path.inc to use that prefix as needed. TODO: Other parts of Support could also learn to use this prefix. llvm-svn: 221841
* Use the return of readBytes to find out if we are at the end of the stream.Rafael Espindola2014-11-121-12/+0
| | | | | | | This allows the removal of isObjectEnd and opens the way for reading 64 bits at a time. llvm-svn: 221804
* Return the number of read bytes in MemoryObject::readBytes.Rafael Espindola2014-11-121-14/+30
| | | | | | | Returning more information will allow BitstreamReader to be simplified a bit and changed to read 64 bits at a time. llvm-svn: 221794
* Merge StreamableMemoryObject into MemoryObject.Rafael Espindola2014-11-123-10/+8
| | | | | | | | | Every MemoryObject is a StreamableMemoryObject since the removal of StringRefMemoryObject, so just merge the two. I will clean up the MemoryObject interface in the upcoming commits. llvm-svn: 221766
* Remove unused method. NFC.Rafael Espindola2014-11-121-13/+0
| | | | llvm-svn: 221759
* Make readBytes pure virtual. Every real implementation has it.Rafael Espindola2014-11-121-19/+0
| | | | llvm-svn: 221758
* Remove unused method. NFC.Rafael Espindola2014-11-122-2/+1
| | | | llvm-svn: 221757
* Remove the now unused StringRefMemoryObject.h.Rafael Espindola2014-11-122-30/+0
| | | | llvm-svn: 221755
* Fix style.Michael J. Spencer2014-11-071-2/+1
| | | | llvm-svn: 221547
* [CMake] LLVMSupport: Give system_libs PRIVATE scope when LLVMSupport is ↵NAKAMURA Takumi2014-11-071-36/+31
| | | | | | | | built as SHARED. Users of LLVMSupport won't inherit ${system_libs}. unittests/SupporTests is another user of libpthreads. Apply LLVM_SYSTEM_LIBS for him explicitly. llvm-svn: 221531
* Remove unnecessary .c_str() when implicitly converting to TwineMatt Arsenault2014-11-061-2/+2
| | | | llvm-svn: 221422
* llvm-readobj: Add support for dumping the DOS header in PE filesDavid Majnemer2014-11-051-3/+4
| | | | llvm-svn: 221333
* Revert 220932.Jiangning Liu2014-11-055-49/+4
| | | | | | | | | Commit 220932 caused crash when building clang-tblgen on aarch64 debian target, so it's blocking all daily tests. The std::call_once implementation in pthread has bug for aarch64 debian. llvm-svn: 221331
* Remove FindProgramByName. NFC.Rafael Espindola2014-11-043-87/+4
| | | | llvm-svn: 221258
* Fix Visual C++ warning, Program.inc(85): warning C4018: '<' : ↵Yaron Keren2014-11-041-1/+1
| | | | | | signed/unsigned mismatch. llvm-svn: 221252
* sys::findProgramByName(): [Win32] Tweak to pass lowercase .exe to ↵NAKAMURA Takumi2014-11-041-0/+1
| | | | | | | | | SearchPath() to appease clang Driver's tests. It seems SearchPath() doesn't show actual extension on the filesystem. FIXME: Shall we use FindFirstFile() here? llvm-svn: 221246
* #include <winbase.h> is not enough for Visual C++ 2013, it errors:Yaron Keren2014-11-041-1/+1
| | | | | | | | | | | | 1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(46): error C2146: syntax error : missing ';' before identifier 'nLength' 1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(46): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ... including <windows.h> is actually required. llvm-svn: 221244
* Use findProgramByName.Michael J. Spencer2014-11-041-2/+4
| | | | llvm-svn: 221221
* [Support][Program] Add findProgramByName(Name, OptionalPaths)Michael J. Spencer2014-11-042-0/+92
| | | | llvm-svn: 221220
* Add CRLF support to LineIterator.Rafael Espindola2014-11-031-16/+30
| | | | | | | The MRI scripts have to work with CRLF, and in general it is probably a good idea to support this in a core utility like LineIterator. llvm-svn: 221153
* CMake: Add libm to list of system libs printed by llvm-config.Peter Collingbourne2014-11-031-0/+1
| | | | | | | This is required by the interpreter library, and also matches the autoconf behavior. llvm-svn: 221147
* Update the non-pthreads fallback for RWMutex on UnixDavid Blaikie2014-10-311-6/+6
| | | | | | | | | | Tested this by #if 0'ing out the pthreads implementation, which indicated that this fallback was not currently compiling successfully and applying this patch resolves that. Patch by Andy Chien. llvm-svn: 220969
* Speculative fix for Windows build after r220932Hans Wennborg2014-10-301-0/+5
| | | | llvm-svn: 220936
* Removing the static initializer in ManagedStatic.cpp by using llvm_call_once ↵Chris Bieneman2014-10-305-4/+44
| | | | | | | | | | | | | | | | | | | to initialize the ManagedStatic mutex. Summary: This patch adds an llvm_call_once which is a wrapper around std::call_once on platforms where it is available and devoid of bugs. The patch also migrates the ManagedStatic mutex to be allocated using llvm_call_once. These changes are philosophically equivalent to the changes added in r219638, which were reverted due to a hang on Win32 which was the result of a bug in the Windows implementation of std::call_once. Reviewers: aaron.ballman, chapuni, chandlerc, rnk Reviewed By: rnk Subscribers: majnemer, llvm-commits Differential Revision: http://reviews.llvm.org/D5922 llvm-svn: 220932
* Fix bug where sys::Wait could wait on wrong pid.Rafael Espindola2014-10-271-1/+0
| | | | | | | | Setting ChildPid to -1 would cause waitpid to wait for any child process. Patch by Daniel Reynaud! llvm-svn: 220717
* Modernize doxygen comments in Support/Dwarf.hFrederic Riss2014-10-231-45/+0
| | | | | | | | | | In post-commit review of r219442, Rafael pointed out that the comment style of the newly introduced helper didn't follow LLVM's coding standard. Modernize the whole file to the new standards. Differential Revision: http://reviews.llvm.org/D5918 llvm-svn: 220467
* Strength reduce constant-sized vectors into arrays. No functionality change.Benjamin Kramer2014-10-221-8/+6
| | | | llvm-svn: 220412
* PR21202: Memory leak in Windows RWMutexImpl when using SRWLOCKDavid Blaikie2014-10-211-5/+3
| | | | llvm-svn: 220251
* Introduce LLVMParseCommandLineOptions C API function.Peter Collingbourne2014-10-161-0/+6
| | | | llvm-svn: 219975
* Defining a new API for debug options that doesn't rely on static global ↵Chris Bieneman2014-10-153-3/+43
| | | | | | | | | | | | | | | | | | cl::opts. Summary: This is based on the discussions from the LLVMDev thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-August/075886.html Reviewers: chandlerc Reviewed By: chandlerc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5389 llvm-svn: 219854
* Revert "r216914 - Revert: [APFloat] Fixed a bug in method 'fusedMultiplyAdd'"Hal Finkel2014-10-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reapply r216913, a fix for PR20832 by Andrea Di Biagio. The commit was reverted because of buildbot failures, and credit goes to Ulrich Weigand for isolating the underlying issue (which can be confirmed by Valgrind, which does helpfully light up like the fourth of July). Uli explained the problem with the original patch as: It seems the problem is calling multiplySignificand with an addend of category fcZero; that is not expected by this routine. Note that for fcZero, the significand parts are simply uninitialized, but the code in (or rather, called from) multiplySignificand will unconditionally access them -- in effect using uninitialized contents. This version avoids using a category == fcZero addend within multiplySignificand, which avoids this problem (the Valgrind output is also now clean). Original commit message: [APFloat] Fixed a bug in method 'fusedMultiplyAdd'. 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. llvm-svn: 219708
* Revert r219638, (r219640 and r219676), "Removing the static destructor from ↵NAKAMURA Takumi2014-10-141-17/+6
| | | | | | | | ManagedStatic.cpp by controlling the allocation and de-allocation of the mutex." It caused hang-up on msc17 builder, probably deadlock. llvm-svn: 219687
* Removing the static destructor from ManagedStatic.cpp by controlling the ↵Chris Bieneman2014-10-131-6/+17
| | | | | | | | allocation and de-allocation of the mutex. This patch adds a new llvm_call_once function which is used by the ManagedStatic implementation to safely initialize a global to avoid static construction and destruction. llvm-svn: 219638
* InstCombine: Don't miscompile (x lshr C1) udiv C2David Majnemer2014-10-131-5/+15
| | | | | | | | | | | | | We have a transform that changes: (x lshr C1) udiv C2 into: x udiv (C2 << C1) However, it is unsafe to do so if C2 << C1 discards any of C2's bits. This fixes PR21255. llvm-svn: 219634
OpenPOWER on IntegriCloud