summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* Silence g++ 4.9 build issueAlp Toker2013-12-311-2/+3
| | | | | | | | | lib/Support/ThreadLocal.cpp:53:15: error: typedef 'SIZE_TOO_BIG' locally defined but not used [-Werror=unused-local-typedefs] typedef int SIZE_TOO_BIG[sizeof(pthread_key_t) <= sizeof(data) ? 1 : -1]; Done the C++11 way, switching on and using LLVM_STATIC_ASSERT() instead of LLVM_ATTRIBUTE_UNUSED. llvm-svn: 198255
* Use two variables here rather than reusing (and abusing) one. This isChandler Carruth2013-12-271-6/+6
| | | | | | | much more clear to me. I meant to make this change before committing the original patch, but forgot to merge it in. Sorry. llvm-svn: 198069
* Introduce a simple line-by-line iterator type into the Support library.Chandler Carruth2013-12-272-0/+69
| | | | | | | | | | | | | | | | | | | This is an iterator which you can build around a MemoryBuffer. It will iterate through the non-empty, non-comment lines of the buffer as a forward iterator. It should be small and reasonably fast (although it could be made much faster if anyone cares, I don't really...). This will be used to more simply support the text-based sample profile file format, and is largely based on the original patch by Diego. I've re-worked the style of it and separated it from the work of producing a MemoryBuffer from a file which both simplifies the interface and makes it easier to test. The style of the API follows the C++ standard naming conventions to fit in better with iterators in general, much like the Path and FileSystem interfaces follow standard-based naming conventions. llvm-svn: 198068
* Dwarf: Fix a copy-paste bug.Benjamin Kramer2013-12-221-1/+1
| | | | | | This tag isn't emitted by any compiler at the moment. PR18306. llvm-svn: 197877
* Add support for krait cpu in llvm::sys::getHostCPUName()Kai Nacke2013-12-201-0/+11
| | | | | | | Recently, support for krait cpu was added. This commit extends getHostCPUName() to return krait as cpu for the APQ8064 (a Krait 300). llvm-svn: 197792
* Make sys::ThreadLocal<> zero-initialized on non-thread builds (PR18205)Hans Wennborg2013-12-192-2/+2
| | | | | | | | | | | | | According to the docs, ThreadLocal<>::get() should return NULL if no object has been set. This patch makes that the case also for non-thread builds and adds a very basic unit test to check it. (This was causing PR18205 because PrettyStackTraceHead didn't get zero- initialized and we'd crash trying to read past the end of that list. We didn't notice this so much on Linux since we'd crash after printing all the entries, but on Mac we print into a SmallString, and would crash before printing that.) llvm-svn: 197718
* Pull in a couple of new constants from the upcoming DWARF 5 standard.Adrian Prantl2013-12-181-0/+21
| | | | llvm-svn: 197611
* Revert r197438 and r197447 until we figure out how to avoid circular ↵Quentin Colombet2013-12-173-157/+0
| | | | | | dependency at link time llvm-svn: 197451
* [LLVM Diagnostic Capabilities] Remove useless includes fromQuentin Colombet2013-12-171-2/+0
| | | | | | | | | DiagnosticPrinter.cpp. These was creating a link time dependencies of IR on CodeGen and Analysis. Part of <rdar://problem/15515174> llvm-svn: 197447
* Add warning capabilities in LLVM.Quentin Colombet2013-12-163-0/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch adds a new LLVMContext::diagnose that can be used to communicate to the front-end, if any, that something of interest happened. The diagnostics are supported by a new abstraction, the DiagnosticInfo class. The base class contains the following information: - The kind of the report: What this is about. - The severity of the report: How bad this is. This patch also adds 2 classes: - DiagnosticInfoInlineAsm: For inline asm reporting. Basically, this diagnostic will be used to switch to the new diagnostic API for LLVMContext::emitError. - DiagnosticStackSize: For stack size reporting. Comes as a replacement of the hard coded warning in PEI. This patch also features dynamic diagnostic identifiers. In other words plugins can use this infrastructure for their own diagnostics (for more details, see getNextAvailablePluginDiagnosticKind). This patch introduces a new DiagnosticHandlerTy and a new DiagnosticContext in the LLVMContext that should be set by the front-end to be able to map these diagnostics in its own system. http://llvm-reviews.chandlerc.com/D2376 <rdar://problem/15515174> llvm-svn: 197438
* Recognize EABIHF as environment and use it for RTAPI + VFP.Joerg Sonnenberger2013-12-161-0/+2
| | | | llvm-svn: 197405
* MemoryBuffer: Increase the alignment of small file buffers to 16Reid Kleckner2013-12-161-2/+3
| | | | | | | This was manifesting as an LLVM_ASSUME_ALIGNED() failure in an ELF debug info test when building LLVM with clang in the Microsoft C++ ABI. llvm-svn: 197401
* [block-freq] Add a right shift to BlockFrequency that saturates at 1.Michael Gottesman2013-12-141-0/+12
| | | | llvm-svn: 197302
* [block-freq] Remove old BlockFrequency entry frequency and printing code.Michael Gottesman2013-12-141-21/+0
| | | | llvm-svn: 197297
* Remove APInt::extractBit since it is already implemented via operator[]. ↵Michael Gottesman2013-12-131-8/+0
| | | | | | Change tests for extractBit to test operator[]. llvm-svn: 197277
* [block-freq] Add the APInt method extractBit.Michael Gottesman2013-12-131-0/+8
| | | | llvm-svn: 197271
* Fix pr18235.Rafael Espindola2013-12-131-22/+14
| | | | | | | | | | The cpp backend is not a reasonable fallback for a missing target. It is a very special backend, so it is reasonable to use it only if explicitly requested. While at it, simplify the interface a bit. llvm-svn: 197241
* Fix Typo.Rafael Espindola2013-12-121-1/+1
| | | | llvm-svn: 197168
* Convert the other getHostByName implementations to StringRef.Rafael Espindola2013-12-121-5/+5
| | | | llvm-svn: 197166
* Return a StringRef from getHostCPUName.Rafael Espindola2013-12-121-1/+1
| | | | llvm-svn: 197158
* Add missing escape characters to the new Regex::escape() functionAlp Toker2013-12-121-21/+6
| | | | | | | | | The old AddFixedStringToRegEx() it was based on got away with this for the longest time, but the problem became easy to spot after the cleanup in r197096. Also add a quick unit test to cover regex escaping. llvm-svn: 197121
* Expose FileCheck's AddFixedStringToRegEx as Regex::escapeHans Wennborg2013-12-121-0/+29
| | | | | | | Both FileCheck and clang's -verify need to escape strings for regexes, so let's expose this as a utility in the Regex class. llvm-svn: 197096
* Build fix for Android NDK which has neither futimes nor futimensAlp Toker2013-12-111-3/+6
| | | | | | Based on a patch by Neil Henning! llvm-svn: 197045
* Darwin: update default iOS version to 5.0Tim Northover2013-12-101-3/+3
| | | | | | | | | | | | Defaulting to iOS 3.0 when LLVM has to guess the version is no longer a useful option and can give surprising results (like tail calls being disabled). 5.0 seems like a reasonable compromise as a platform that's still interesting to some people. rdar://problem/15567348 llvm-svn: 196912
* Improve the detection of the pathSylvestre Ledru2013-12-091-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When clang is used under GNU/Linux in a chroot without /proc mount, it falls back on the BSD method. However, since the buf variable is used twice and fails with snprintf to produce the correct path. When called as relatived (ie ./clang), it was failing with: "" -cc1 [...] -x c++ x.cc error: unable to execute command: Executable "" doesn't exist! I also took the opportunity to simply the code (the first arg of test_dir was useless). Reviewers: rafael Reviewed By: rafael CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2361 llvm-svn: 196791
* Support: Fix handling of args that begin with @ but aren't filesJustin Bogner2013-12-061-0/+3
| | | | | | | | | | | | | | | Command line arguments that begin with @ but aren't a path to an existing file currently cause later @file arguments to be ignored. Correctly skip over these arguments instead of trying to read a non-existent file 20 times and giving up. Since the problem manifests in the clang driver, the test is in that repository. Fixes rdar://problem/15590906 llvm-svn: 196620
* Correct word hyphenationsAlp Toker2013-12-053-3/+3
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. llvm-svn: 196471
* Return true on success in cl::ExpandResponseFilesReid Kleckner2013-12-031-1/+1
| | | | | | | | | | | | This fixes a logic bug pointed out by Juraj Ivancic. No behavior change because none of the in-tree clients of cl::ExpandResponseFiles check the return value. In this case, the @prefixed arguments are left in the command line. Downstream command line processing has the opportunity to emit errors about it, so this isn't that bad. llvm-svn: 196306
* Lift self-copy protection up to the header file and add self-moveChandler Carruth2013-11-261-2/+3
| | | | | | | | | | | | protection to the same layer. This is in line with Howard's advice on how best to handle self-move assignment as he explained on SO[1]. It also ensures that implementing swap with move assignment continues to work in the case of self-swap. [1]: http://stackoverflow.com/questions/9322174/move-assignment-operator-and-if-this-rhs llvm-svn: 195705
* Fix a self-memcpy which only breaks under Valgrind's memcpyChandler Carruth2013-11-261-0/+3
| | | | | | | implementation. Silliness, but it'll be a trivial performance optimization. This should clear up a failure on the vg_leak bot. llvm-svn: 195704
* Make helper function static.Benjamin Kramer2013-11-251-2/+3
| | | | llvm-svn: 195650
* X86: enable AVX2 under Haswell native compilationTim Northover2013-11-251-6/+90
| | | | | | Patch by Adam Strzelecki llvm-svn: 195632
* revert r194655Nick Kledzik2013-11-211-2/+2
| | | | llvm-svn: 195285
* Make the moved-from SmallPtrSet be a valid, empty, small-state object.Chandler Carruth2013-11-201-1/+13
| | | | | | | | | | | Enhance the tests to actually require moves in C++11 mode, in addition to testing the moved-from state. Further enhance the tests to cover copy-assignment into a moved-from object and moving a large-state object. (Note that we can't really test small-state vs. large-state as that isn't an observable property of the API really.) This should finish addressing review on r195239. llvm-svn: 195261
* Give SmallPtrSet move semantics when we have R-value references.Chandler Carruth2013-11-201-0/+44
| | | | | | | | | | | | Somehow, this ADT got missed which is moderately terrifying considering the efficiency of move for it. The code to implement move semantics for it is pretty horrible currently but was written to reasonably closely match the rest of the code. Unittests that cover both copying and moving (at a basic level) added. llvm-svn: 195239
* YAML I/O - Added default trait support for std:string. Making another ↵John Thompson2013-11-191-0/+11
| | | | | | attempt at this, this time doing a clean build on Linux, and running the LLVM, clang, and extra tests, to try to make sure there's no problems. llvm-svn: 195134
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-193-0/+17
| | | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. The memory leaks in this version have been fixed. Thanks Alexey for pointing them out. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy llvm-svn: 195064
* Checking for a return value with FormatMessage; if the call fails, there's ↵Aaron Ballman2013-11-181-4/+9
| | | | | | no guarantee that the buffer will be non-null. llvm-svn: 195019
* Fixing a possible memory leak from a failing realloc() call.Aaron Ballman2013-11-181-2/+7
| | | | llvm-svn: 195018
* Recover gracefully when deserializing invalid YAML input.Alexander Kornienko2013-11-181-7/+26
| | | | | | | | | Fixes http://llvm.org/PR16221, http://llvm.org/PR15927 Phabricator: http://llvm-reviews.chandlerc.com/D1236 Patch by Andrew Tulloch! llvm-svn: 195016
* Revert r194865 and r194874.Alexey Samsonov2013-11-184-20/+0
| | | | | | | | | | | | This change is incorrect. If you delete virtual destructor of both a base class and a subclass, then the following code: Base *foo = new Child(); delete foo; will not cause the destructor for members of Child class. As a result, I observe plently of memory leaks. Notable examples I investigated are: ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl. llvm-svn: 194997
* [block-freq] Add BlockFrequency::scale that returns a remainder from the ↵Michael Gottesman2013-11-171-38/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | division and make the private scale in BlockFrequency more performant. This change is the first in a series of changes improving LLVM's Block Frequency propogation implementation to not lose probability mass in branchy code when propogating block frequency information from a basic block to its successors. This patch is a simple infrastructure improvement that does not actually modify the block frequency algorithm. The specific changes are: 1. Changes the division algorithm used when scaling block frequencies by branch probabilities to a short division algorithm. This gives us the remainder for free as well as provides a nice speed boost. When I benched the old routine and the new routine on a Sandy Bridge iMac with disabled turbo mode performing 8192 iterations on an array of length 32768, I saw ~600% increase in speed in mean/median performance. 2. Exposes a scale method that returns a remainder. This is important so we can ensure that when we scale a block frequency by some branch probability BP = N/D, the remainder from the division by D can be retrieved and propagated to other children to ensure no probability mass is lost (more to come on this). llvm-svn: 194950
* X86: Encode the 'h' cpu subtype in the MachO header for x86.Jim Grosbach2013-11-161-1/+1
| | | | llvm-svn: 194906
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-154-0/+20
| | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy llvm-svn: 194865
* Path: Recognize COFF import library file magic.Rui Ueyama2013-11-151-0/+4
| | | | | | | | | | | | Summary: Make identify_magic to recognize COFF import file. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2165 llvm-svn: 194852
* Recognize 0x0000 as a COFF file magic.Rui Ueyama2013-11-141-0/+3
| | | | | | | | | | | | | | | Summary: Some machine-type-neutral object files containing only undefined symbols actually do exist in the Windows standard library. Need to recognize them as COFF files. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2164 llvm-svn: 194734
* yaml::Input::mapTag(): Don't use StringRef to hold return type of std::string.NAKAMURA Takumi2013-11-141-1/+1
| | | | llvm-svn: 194681
* Whitespace.NAKAMURA Takumi2013-11-141-1/+1
| | | | llvm-svn: 194680
* Add dyn_cast<> support to YAML I/O's IO classNick Kledzik2013-11-141-2/+2
| | | | llvm-svn: 194655
* Add simple support for tags in YAML I/ONick Kledzik2013-11-141-0/+18
| | | | llvm-svn: 194644
OpenPOWER on IntegriCloud