summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* CommandLine: Replace cold std::sort with array_pod_sort.Benjamin Kramer2015-03-141-11/+12
| | | | | | | | | Also replace an old use of qsort with it. Compiles down to the same thing but gives us some type safety. Safes a couple of kb on CommandLine.o. NFC. llvm-svn: 232236
* Wrap in __MINGW32__ to avoid warnings from msvc.Benjamin Kramer2015-03-111-1/+3
| | | | llvm-svn: 231933
* Add missing namespace specifier for MSVC.Benjamin Kramer2015-03-111-1/+1
| | | | llvm-svn: 231930
* RtlCaptureContext is absent from the mingw32 headers, provide a prototype.Benjamin Kramer2015-03-111-1/+4
| | | | llvm-svn: 231929
* Teach raw_ostream to accept SmallString.Yaron Keren2015-03-101-1/+1
| | | | | | | | | | | | | | Saves adding .str() call to any raw_ostream << SmallString usage and a small step towards making .str() consistent in the ADTs by removing one of the SmallString::str() use cases, discussion at http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141013/240026.html I'll update the Phabricator patch http://reviews.llvm.org/D6372 for review of the Twine SmallString support, it's more complex than this one. llvm-svn: 231763
* Don't treat .foo as two path components in path::iteratorsBen Langmuir2015-03-101-7/+0
| | | | | | | We were treating '/.foo' as ['/', '.', 'foo'] instead of ['/', '.foo'], which lead to insanity. Same for '..'. llvm-svn: 231727
* Add support for Nuxi CloudABI.Ed Schouten2015-03-091-0/+2
| | | | | | | | | | | | | | CloudABI is a POSIX-like runtime environment built around the concept of capability-based security. More details: https://github.com/NuxiNL/cloudlibc CloudABI uses its own ELFOSABI number. This number has been allocated by the maintainers of ELF a couple of days ago. Reviewed by: echristo llvm-svn: 231681
* Drop the hacks used for partial C99 math libraries.Benjamin Kramer2015-03-094-89/+0
| | | | | | All supported platforms have half-way decent C99 support. llvm-svn: 231679
* Simplify expressions involving boolean constants with clang-tidyDavid Blaikie2015-03-092-4/+4
| | | | | | | | Patch by Richard (legalize at xmission dot com). Differential Revision: http://reviews.llvm.org/D8154 llvm-svn: 231617
* Support: Improve performance of FileOutputBuffer on WindowsRui Ueyama2015-03-061-0/+7
| | | | | | | | | | We extend an underlying file before mmap'ing it, but it's not needed on Windows. Extending file is slow on Windows, so we should avoid doing that. The difference gets larger as the size of an output file gets larger. It shove off 2 seconds out of 25 seconds when linking chrome.dll with LLD, for example. llvm-svn: 231452
* Replace PrintStackTrace(FILE*) with PrintStackTrace(raw_ostream&)Zachary Turner2015-03-052-36/+43
| | | | | | | | | | This will be followed by a change on the clang side to update the only user of this function with the new version. Differential Revision: http://reviews.llvm.org/D8074 Reviewed By: Reid Kleckner llvm-svn: 231392
* Silence -Wmissing-braces warning from clang-clReid Kleckner2015-03-051-1/+1
| | | | | | | | The first element of STACKFRAME64 is a struct and Clang wants us to put braces around it's initialization. Instead, drop the zero. The result should be the same. llvm-svn: 231387
* [Windows] Implement PrintStackTrace(FILE*)Zachary Turner2015-03-051-81/+104
| | | | | | | | | | | | | | | | | | | llvm::sys::PrintBacktrace(FILE*) is supposed to print a backtrace of the current thread given the current PC. This function was unimplemented on Windows, and instead the only time we could print a backtrace was as the result of an exception through LLVMUnhandledExceptionFilter. This patch implements backtracing of self by using RtlCaptureContext to get a CONTEXT for the current thread, and moving the printing and StackWalk64 code to a common method that printing own stack trace and printing stack trace of an exception can use. Differential Revision: http://reviews.llvm.org/D8068 Reviewed by: Reid Kleckner llvm-svn: 231382
* [Support] Increase timeout for the LockFileManager back to 5 mins.Argyrios Kyrtzidis2015-03-041-2/+3
| | | | | | Waiting for just 1 min may not be enough for some contexts. llvm-svn: 231309
* Make Triple::getOSVersion make sense for Android.Dan Albert2015-03-031-0/+8
| | | | | | | | | | | | Reviewers: srhines Reviewed By: srhines Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7928 llvm-svn: 231090
* Use read{16,32,64}{le,be}() instead of ↵Rui Ueyama2015-03-021-3/+3
| | | | | | *reinterpret_cast<u{little,big}{16,32,64}_t>(). llvm-svn: 231016
* Detect malformed YAML sequence in yaml::Input::beginSequence()Justin Bogner2015-03-021-7/+10
| | | | | | | | | | | | | | | | | | | | | When reading a yaml::SequenceTraits object, YAMLIO does not report an error if the yaml item is not a sequence. Instead, YAMLIO reads an empty sequence. For example: --- seq: foo: 1 bar: 2 ... If `seq` is a SequenceTraits object, then reading the above yaml will yield `seq` as an empty sequence. Fix this to report an error for the above mapping ("not a sequence") Patch by William Fisher. Thanks! llvm-svn: 230976
* [raw_ostream] When printing color on Windows, use correct bg color.Zachary Turner2015-02-281-0/+13
| | | | | | | | | | | | | | | | | | | When using SetConsoleTextAttribute() to set the foreground or background color, if you don't explicitly set both colors, then a default value of black will be chosen for whichever you don't specify a value for. This is annoying when you have a non default console background color, for example, and you try to set the foreground color. This patch gets the existing fg/bg color and when you set one attribute, sets the opposite attribute to its existing color prior to comitting the update. Reviewed by: Aaron Ballman Differential Revision: http://reviews.llvm.org/D7967 llvm-svn: 230859
* Silence some Win64 clang-cl warnings about unused stuff due to ifdefsReid Kleckner2015-02-261-1/+2
| | | | llvm-svn: 230685
* Use wider type for overflow check on LLP64 platforms like Win64, found by ↵Reid Kleckner2015-02-261-2/+2
| | | | | | clang-cl -Wtautological llvm-svn: 230684
* Object: Handle Mach-O kext bundle filesJustin Bogner2015-02-251-0/+1
| | | | | | This particular subtype of Mach-O was missing. Add it. llvm-svn: 230567
* Sync the __builtin_expects for our 3 quadratically probed hash table ↵Benjamin Kramer2015-02-232-11/+13
| | | | | | | | | | | | | | | | | | implementations. This assumes that a) finding the bucket containing the value is LIKELY b) finding an empty bucket is LIKELY c) growing the table is UNLIKELY I also switched the a) and b) cases for SmallPtrSet as we seem to use the set mostly more for insertion than for checking existence. In a simple benchmark consisting of 2^21 insertions of 2^20 unique pointers into a DenseMap or SmallPtrSet a few percent speedup on average, but nothing statistically significant. llvm-svn: 230232
* Small cleanup. Don't use else when not needed.Davide Italiano2015-02-211-4/+2
| | | | | | Pointed out by David Majnemer. llvm-svn: 230122
* Checking if TARGET_OS_IPHONE is defined isn't good enough for 10.7 and earlier.Chris Bieneman2015-02-191-2/+10
| | | | | | | | Older versions of the TargetConditionals header always defined TARGET_OS_IPHONE to something (0 or 1), so we need to test not only for the existence but also if it is 1. This resolves PR22631. llvm-svn: 229904
* Assume the original file is created before release in LockFileManagerBen Langmuir2015-02-191-39/+9
| | | | | | | | | | This is true in clang, and let's us remove the problematic code that waits around for the original file and then times out if it doesn't get created in short order. This caused any 'dead' lock file or legitimate time out to cause a cascade of timeouts in any processes waiting on the same lock (even if they only just showed up). llvm-svn: 229881
* Demote vectors to arrays. No functionality change.Benjamin Kramer2015-02-191-3/+1
| | | | llvm-svn: 229861
* [Support/Timer] Make GetMallocUsage() aware of jemalloc.Davide Italiano2015-02-191-0/+10
| | | | | | | Differential Revision: D7657 Reviewed by: shankarke, majnemer llvm-svn: 229824
* Provide the same ABI regardless of NDEBUGDmitri Gribenko2015-02-192-30/+38
| | | | | | | | | | | | | | | | | | | | | For projects depending on LLVM, I find it very useful to combine a release-no-asserts build of LLVM with a debug+asserts build of the dependent project. The motivation is that when developing a dependent project, you are debugging that project itself, not LLVM. In my usecase, a significant part of the runtime is spent in LLVM optimization passes, so I would like to build LLVM without assertions to get the best performance from this combination. Currently, `lib/Support/Debug.cpp` changes the set of symbols it provides depending on NDEBUG, while `include/llvm/Support/Debug.h` requires extra symbols when NDEBUG is not defined. Thus, it is not possible to enable assertions in an external project that uses facilities of `Debug.h`. This patch changes `Debug.cpp` and `Valgrind.cpp` to always define the symbols that other code may depend on when #including LLVM headers without NDEBUG. http://reviews.llvm.org/D7662 llvm-svn: 229819
* Prefer SmallVector::append/insert over push_back loops.Benjamin Kramer2015-02-171-3/+1
| | | | | | Same functionality, but hoists the vector growth out of the loop. llvm-svn: 229500
* We require MSVC 1800 as our minimum, so these checks can safely go away; NFC.Aaron Ballman2015-02-161-12/+7
| | | | llvm-svn: 229415
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-152-4/+4
| | | | | | requiring the macro. NFC; LLVM edition. llvm-svn: 229340
* Format: Modernize using variadic templates.Benjamin Kramer2015-02-151-1/+1
| | | | | | | | | | | Introduces a subset of C++14 integer sequences in STLExtras. This is just enough to support unpacking a std::tuple into the arguments of snprintf, we can add more of it when it's actually needed. Also removes an ancient macro hack that leaks a macro into the global namespace. Clean up users that made use of the convenient hack. llvm-svn: 229337
* Removing LLVM_EXPLICIT, as MSVC 2012 was the last reason for requiring the ↵Aaron Ballman2015-02-151-1/+1
| | | | | | macro. NFC; LLVM edition. llvm-svn: 229335
* Fixing broken bots.Chris Bieneman2015-02-131-1/+1
| | | | llvm-svn: 229176
* NFC. Moving the RegisteredOptionCategories global into the CommandLineParser ↵Chris Bieneman2015-02-131-15/+18
| | | | | | class. llvm-svn: 229172
* NFC. clang-format wants to change this from two lines to one.Chris Bieneman2015-02-131-2/+1
| | | | llvm-svn: 229171
* NFC. More code cleanup making LookupOption a member of the CommandLineParser.Chris Bieneman2015-02-131-4/+6
| | | | llvm-svn: 229170
* Triple: Make setEnvironment not override the object formatReid Kleckner2015-02-131-1/+5
| | | | | | | | | | | | | | | Discovered by Halide users who had C++ code like this: Triple.setArch(Triple::x86); Triple.setOS(Triple::Windows); Triple.setObjectFormat(Triple::ELF); Triple.setEnvironment(Triple::MSVC); This would produce the stringified triple of x86-windows-msvc, instead of the x86-windows-msvc-elf string needed to run MCJIT. With this change, they retain the -elf suffix. llvm-svn: 229160
* Support: Add dwarf::getOperationEncoding()Duncan P. N. Exon Smith2015-02-131-0/+7
| | | | llvm-svn: 229001
* Support: Rewrite LocationAtom and OperationEncodingString(), NFCDuncan P. N. Exon Smith2015-02-131-162/+5
| | | | | | Use `Dwarf.def` more. llvm-svn: 229000
* MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line ↵Benjamin Kramer2015-02-121-5/+5
| | | | | | | | with countTrailingZeros Update all callers. llvm-svn: 228930
* Triple: refactor redundant code.Tim Northover2015-02-121-19/+5
| | | | | | | | | | Should be no functional change, since most of the logic removed was completely pointless (after some previous refactoring) and the rest duplicated elsewhere. Patch by Kamil Rytarowski. llvm-svn: 228926
* Revert "Change Path::filename_pos() to skip the drive letter."Zachary Turner2015-02-121-5/+2
| | | | | | | | This reverts commit 228874. For some reason users reported seeing Clang taking up 25+GB of memory and bringing down machines with this change. Reverting until we figure it out. llvm-svn: 228890
* Change Path::filename_pos() to skip the drive letter.Zachary Turner2015-02-111-2/+5
| | | | | | | | | For Windows, filename_pos() tries to find the filename by searching for separators after the last :. Instead, it should really check for the only location that a : is valid, which is in the second character, and search for separators after that. llvm-svn: 228874
* Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects.Zachary Turner2015-02-111-0/+1
| | | | | | | | | | This allows IDEs to recognize the entire set of header files for each of the core LLVM projects. Differential Revision: http://reviews.llvm.org/D7526 Reviewed By: Chris Bieneman llvm-svn: 228798
* [ARM] Add armv6s[-]m as an alias to armv6[-]mBradley Smith2015-02-101-2/+3
| | | | llvm-svn: 228696
* Teach llvm_add_library() to find include dirs.Zachary Turner2015-02-101-24/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since header files are not compilation units, CMake does not require you to specify them in the CMakeLists.txt file. As a result, unless a header file is explicitly added, CMake won't know about it, and when generating IDE-based projects, CMake won't put the header files into the IDE project. LLVM currently tries to deal with this in two ways: 1) It looks for all .h files that are in the project directory, and adds those. 2) llvm_add_library() understands the ADDITIONAL_HEADERS argument, which allows one to list an arbitrary list of headers. This patch takes things one step further. It adds the ability for llvm_add_library() to take an ADDITIONAL_HEADER_DIRS argument, which will specify a list of folders which CMake will glob for header files. Furthermore, it will glob not only for .h files, but also for .inc files. Included in this CL is an update to one of the existing users of ADDITIONAL_HEADERS to use this new argument instead, to serve as an illustration of how this cleans up the CMake. The big advantage of this new approach is that until now, there was no way for the IDE projects to locate the header files that are in the include tree. In other words, if you are in, for example, lib/DebugInfo/DWARF, the corresponding includes for this project will be located under include/llvm/DebugInfo/DWARF. Now, in the CMakeLists.txt for lib/DebugInfo/DWARF, you can simply write: ADDITIONAL_HEADER_DIRS ../../include/llvm/DebugInfo/DWARF as an argument to llvm_add_library(), and all header files will get added to the IDE project. Differential Revision: http://reviews.llvm.org/D7460 Reviewed By: Chris Bieneman llvm-svn: 228670
* Reduce the LockFileManager timeout, and provide unsafeRemoveLockFileBen Langmuir2015-02-091-2/+6
| | | | | | | | | | 5 minutes is an eternity, so try to strike a better balance between waiting long enough for any reasonable module build and not so long that users kill the process because they think it's hanging. Also give the client a way to delete the lock file after a timeout. llvm-svn: 228603
* Make UTF8->UTF16 conversion null terminate output on empty input.Zachary Turner2015-02-081-1/+4
| | | | llvm-svn: 228527
* Avoid integer overflows around realloc calls resulting in potentialJoerg Sonnenberger2015-02-071-0/+21
| | | | | | | heap. Problem identified by Guido Vranken. Changes differ from original OpenBSD sources by not depending on non-portable reallocarray. llvm-svn: 228507
OpenPOWER on IntegriCloud