summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Unix/Signals.inc: Let findModulesAndOffsets() built conditionally regarding ↵NAKAMURA Takumi2014-10-131-2/+3
| | | | | | to (defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)). [-Wunused-function] llvm-svn: 219596
* [Modules] Add some missing includes to make files compile stand-alone.Benjamin Kramer2014-10-121-0/+3
| | | | llvm-svn: 219592
* Modernize old-style static asserts. NFC.Benjamin Kramer2014-10-122-4/+2
| | | | llvm-svn: 219588
* Guard the definition of the stack tracing function with the same macrosChandler Carruth2014-10-111-0/+2
| | | | | | | that guard its usage. Without this, we can get unused function warnings when backtraces are disabled. llvm-svn: 219558
* Follow-up to r219534 to make symbolization more robust.Alexey Samsonov2014-10-101-2/+7
| | | | | | | | | | 1) Explicitly provide important arguments to llvm-symbolizer, not relying on defaults. 2) Be more defensive about symbolizer output. This might fix weird failures on ninja-x64-msvc-RA-centos6 buildbot. llvm-svn: 219541
* Re-land r219354: Use llvm-symbolizer to symbolize LLVM/Clang crash dumps.Alexey Samsonov2014-10-101-1/+140
| | | | | | | | | | | | In fact, symbolization is now expected to work only on Linux and FreeBSD/NetBSD, where we have dl_iterate_phdr and can learn the main executable name without argv0 (it will be possible on BSD systems after http://reviews.llvm.org/D5693 lands). #ifdef-out the code for all the rest Unix systems. Reviewed in http://reviews.llvm.org/D5610 llvm-svn: 219534
* APInt: Unfold return expressions so RVO can work.Benjamin Kramer2014-10-101-10/+28
| | | | | | Saves a couple of expensive deep copies. NFC. llvm-svn: 219487
* [ADT] Add the scalbn function for APFloat.Chandler Carruth2014-10-101-0/+17
| | | | llvm-svn: 219473
* Add ApplePropertyString dump helper to Dwarf.{h|cpp}.Frederic Riss2014-10-091-0/+33
| | | | | | | | | | Reviewers: dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5688 llvm-svn: 219442
* Revert r219354. It seems to break some buildbots.Alexey Samsonov2014-10-081-139/+1
| | | | llvm-svn: 219355
* Use llvm-symbolizer to symbolize LLVM/Clang crash dumps.Alexey Samsonov2014-10-081-1/+139
| | | | | | | | | | | | | | | | This change modifies fatal signal handler used in LLVM tools. Now it attempts to find llvm-symbolizer binary and communicates with it in order to turn instruction addresses into function/file/line info entries. This should significantly improve stack traces readability in Debug builds. This feature only works on selected platforms (including Darwin and Linux). If the symbolization fails for some reason, signal handler will fallback to the original behavior. Reviewed in http://reviews.llvm.org/D5610 llvm-svn: 219354
* Unix/Process: Don't use pthread_sigmask if we aren't built with threadsDavid Majnemer2014-10-081-1/+12
| | | | | | | | We won't link in pthreads if we weren't built with LLVM_ENABLE_THREADS which means we won't get access to pthread_sigmask. Use sigprocmask instead. llvm-svn: 219288
* [Support] Add MemoryBuffer::getFileSlice()Nick Kledzik2014-10-081-8/+15
| | | | | | | | | | mach-o supports "fat" files which are a header/table-of-contents followed by a concatenation of mach-o files built for different architectures. Currently, MemoryBuffer has no easy way to map a subrange (slice) of a file which lld will need to select a mach-o slice of a fat file. The new function provides an easy way to map a slice of a file into a MemoryBuffer. Test case included. llvm-svn: 219260
* Remove the IsVolatileSize parameter of getOpenFileSlice.Rafael Espindola2014-10-071-2/+3
| | | | | | | getOpenFileSlice gets passed the map size, so it makes no sense to say that the size is volatile. The code will not even compute the size. llvm-svn: 219226
* Be consistent about using "const Twine &" for filenames.Rafael Espindola2014-10-071-22/+27
| | | | | | | | | | | | | | | On this file we had a mix of * Twine * const char * * StringRef The two that make sense are * const Twine & (caller convenience) * consc char * (that is what will eventually be passed to open. Given that sys::fs::openFileForRead takes a "const Twine &", I picked that. llvm-svn: 219224
* Attempt to calm down buildbotsDavid Majnemer2014-10-071-0/+3
| | | | llvm-svn: 219190
* Support: Don't call close again if we get EINTRDavid Majnemer2014-10-073-11/+34
| | | | | | | | | | | | | | | | | | | | | | | | | Most Unix-like operating systems guarantee that the file descriptor is closed after a call to close(2), even if close comes back with EINTR. For these systems, calling close _again_ will either do nothing or close some other file descriptor open(2)'d by another thread. (Linux) However, some operating systems do not have this behavior. They require at least another call to close(2) before guaranteeing that the descriptor is closed. (HP-UX) And some operating systems have an unpredictable blend of the two behaviors! (xnu) Avoid this disaster by blocking all signals before we call close(2). This ensures that a signal will not be delivered to the thread and close(2) will not give us back EINTR. We restore the signal mask once the operation is done. N.B. This isn't a problem on Windows, it doesn't have a notion of EINTR because signals always get delivered to dedicated signal handling threads. llvm-svn: 219189
* Support: Add a utility to remap std{in,out,err} to /dev/null if closedDavid Majnemer2014-10-062-0/+63
| | | | | | | | | | | | | | | It's possible to start a program with one (or all) of the standard file descriptors closed. Subsequent open system calls will give the program a low-numbered file descriptor. This is problematic because we may believe we are writing to standard out instead of a file. Introduce Process::FixupStandardFileDescriptors, a helper function to remap standard file descriptors to /dev/null if they were closed before the program started. llvm-svn: 219170
* Make the MD5 result name consistent between functions, header and source.Yaron Keren2014-10-061-19/+19
| | | | llvm-svn: 219121
OpenPOWER on IntegriCloud