summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* Sometimes report_fatal_error is called when there is not a handler function ↵Aaron Ballman2015-03-261-3/+17
| | | | | | used to fail gracefully. In that case, RunInterruptHandlers is called, which attempts to enter a critical section object. Ensure that the critical section is properly initialized so that this code functions properly, and tools like clang-tidy do not crash in Debug builds. llvm-svn: 233282
* [APInt] Add an isSplat helper and use it in some places.Benjamin Kramer2015-03-251-0/+8
| | | | | | | To complement getSplat. This is more general than the binary decomposition method as it also handles non-pow2 splat sizes. llvm-svn: 233195
* Silencing some MSVC warnings "C4805: '^' : unsafe mix of type 'bool' and ↵Aaron Ballman2015-03-241-1/+1
| | | | | | type 'unsigned int' in operation"; NFC. llvm-svn: 233067
* Refactor: Simplify boolean expressions in llvm SupportDavid Blaikie2015-03-231-1/+1
| | | | | | | | | | | | | Simplify boolean expressions using `true` and `false` with `clang-tidy` Patch by Richard Thomson - I dropped the parens and != 0 test, for consistency with other patches/tests like this, but I'm open to the notion that we should add the explicit non-zero test in all these sort of cases (non-bool assigned to a bool). Differential Revision: http://reviews.llvm.org/D8526 llvm-svn: 233004
* Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used.Benjamin Kramer2015-03-232-0/+2
| | | | llvm-svn: 232998
* Add missing include that MSVC complains about.Benjamin Kramer2015-03-231-2/+4
| | | | | | Also reorder includes a bit, NFC. llvm-svn: 232980
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-2324-40/+14
| | | | | | NFC. llvm-svn: 232976
* Move private classes into anonymous namespacesBenjamin Kramer2015-03-231-0/+2
| | | | | | NFC. llvm-svn: 232944
* Fix typo 'AVX too' instead of 'AVX2'Craig Topper2015-03-231-2/+2
| | | | llvm-svn: 232929
* [X86] Add one stepping of Broadwell to the CPU name autodetection for ↵Craig Topper2015-03-231-0/+6
| | | | | | march=native. llvm-svn: 232927
* FoldingSet: Make FoldingSetImpl's dtor protected and non-virtualBenjamin Kramer2015-03-221-0/+2
| | | | | | | | | It's not intended to be polymorphically deleted. Make FoldingSet and ContextualFoldingSet final to avoid noise from -Wnon-virtual-dtor. No functional change intended. llvm-svn: 232922
* Note that we don't support COFF on PPC.Rafael Espindola2015-03-191-0/+7
| | | | | | Should bring back the windows bots. llvm-svn: 232701
* Teach getDefaultFormat that we only support ELF on some architectures.Rafael Espindola2015-03-181-0/+17
| | | | | | | | | This should bring the windows bots back. It is a bit ugly, but it is better than what we had before: The triple would say that the object format was COFF, but llc/llvm-mc would produce an ELF. llvm-svn: 232683
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-184-14/+14
| | | | | | | | | | | | | | | Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
* [ARM] Add support for ARMV6K subtarget (LLVM)Renato Golin2015-03-171-2/+3
| | | | | | | | | | | | | | | | | | | | | ARMv6K is another layer between ARMV6 and ARMV6T2. This is the LLVM side of the changes. ARMV6 family LLVM implementation. +-------------------------------------+ | ARMV6 | +----------------+--------------------+ | ARMV6M (thumb) | ARMV6K (arm,thumb) | <- From ARMV6K and ARMV6M processors +----------------+--------------------+ have support for hint instructions | ARMV6T2 (arm,thumb,thumb2) | (SEV/WFE/WFI/NOP/YIELD). They can +-------------------------------------+ be either real or default to NOP. | ARMV7 (arm,thumb,thumb2) | The two processors also use +-------------------------------------+ different encoding for them. Patch by Vinicius Tinti. llvm-svn: 232468
* Teach Twine to support SmallString.Yaron Keren2015-03-171-7/+7
| | | | | | | | Enable removing .str() member calls for these frequent cases. http://reviews.llvm.org/D6372 llvm-svn: 232465
* Fix uses of reserved identifiers starting with an underscore followed by an ↵David Blaikie2015-03-161-17/+9
| | | | | | | | | uppercase letter This covers essentially all of llvm's headers and libs. One or two weird cases I wasn't sure were worth/appropriate to fix. llvm-svn: 232394
* [llvm] Replacing asserts with static_asserts where appropriateGabor Horvath2015-03-161-2/+3
| | | | | | | | | | | | | | | | Summary: This patch consists of the suggestions of clang-tidy/misc-static-assert check. Reviewers: alexfh Reviewed By: alexfh Subscribers: xazax.hun, llvm-commits Differential Revision: http://reviews.llvm.org/D8343 llvm-svn: 232366
* No need to prototype RtlCaptureContext with mingw-w64.Yaron Keren2015-03-141-2/+3
| | | | llvm-svn: 232269
* 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
OpenPOWER on IntegriCloud