summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* ADT: remove MinGW32 and Cygwin OSType enumSaleem Abdulrasool2014-08-091-9/+13
| | | | | | | | | | | Remove the MinGW32 and Cygwin types from the OSType enumeration. These values are represented via environments of Windows. It is a source of confusion and needlessly clutters the code. The cost of doing this is that we must sink the check for them into the normalization code path along with the spelling. Addresses PR20592. llvm-svn: 215303
* Fix typo.Eric Christopher2014-08-091-1/+1
| | | | llvm-svn: 215266
* Fix the windows build.Rafael Espindola2014-08-081-1/+1
| | | | | | Sorry for the noise. llvm-svn: 215249
* Reword comment slightly.Eric Christopher2014-08-081-4/+3
| | | | llvm-svn: 215248
* Remove dead code. Fixes pr20544.Rafael Espindola2014-08-082-18/+0
| | | | llvm-svn: 215243
* Convert from Windows to Unix paths in sys::path::native.Rafael Espindola2014-08-081-1/+11
| | | | | | Part of pr20544. Test to follow in a second. llvm-svn: 215241
* Fix bug 20125 - clang-format segfaults on bad config.Rafael Espindola2014-08-081-1/+6
| | | | | | | The problem was in unchecked dyn_cast inside of Input::createHNodes. Patch by Roman Kashitsyn! llvm-svn: 215205
* Remove Support/IncludeFile.h and its only user. This is actively harmful, sinceRichard Smith2014-08-072-21/+0
| | | | | | | | | | | | | it breaks the modules builds (where CallGraph.h can be quite reasonably transitively included by an unimported portion of a module, and CallGraph.cpp not linked in), and appears to have been entirely redundant since PR780 was fixed back in 2008. If this breaks anything, please revert; I have only tested this with a single configuration, and it's possible that this is still somehow fixing something (though I doubt it, since no other similar file uses this mechanism any more). llvm-svn: 215142
* getNewMemBuffer memsets the buffer to zeros,Yaron Keren2014-08-061-1/+1
| | | | | | the caller don't have to initialize it. llvm-svn: 214994
* Path: Stop claiming path::const_iterator is bidirectionalJustin Bogner2014-08-041-12/+27
| | | | | | | | | | | | | | | | | | | | | | path::const_iterator claims that it's a bidirectional iterator, but it doesn't satisfy all of the contracts for a bidirectional iterator. For example, n3376 24.2.5 p6 says "If a and b are both dereferenceable, then a == b if and only if *a and *b are bound to the same object", but this doesn't work with how we stash and recreate Components. This means that our use of reverse_iterator on this type is invalid and leads to many of the valgrind errors we're hitting, as explained by Tilmann Scheller here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140728/228654.html Instead, we admit that path::const_iterator is only an input_iterator, and implement a second input_iterator for path::reverse_iterator (by changing const_iterator::operator-- to reverse_iterator::operator++). All of the uses of this just traverse once over the path in one direction or the other anyway. llvm-svn: 214737
* MemoryBuffer: Don't use mmap when FileSize is multiple of 4k on Cygwin.NAKAMURA Takumi2014-08-041-0/+8
| | | | | | | | | | | On Cygwin, getpagesize() returns 64k(AllocationGranularity). In r214580, the size of X86GenInstrInfo.inc became 1499136. FIXME: We should reorganize again getPageSize() on Win32. MapFile allocates address along AllocationGranularity but view is mapped by physical page. llvm-svn: 214681
* Remove some calls to std::move.Rafael Espindola2014-08-013-13/+13
| | | | | | | | | Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get a reference to it. Thanks to David Blaikie for the suggestion. llvm-svn: 214516
* Remove dead code.Rafael Espindola2014-07-251-28/+0
| | | | llvm-svn: 213963
* Windows: Don't wildcard expand /? or -?Hans Wennborg2014-07-241-0/+5
| | | | | | | Even if there's a file called c:\a, we want /? to be preserved as an option, not expanded to a filename. llvm-svn: 213894
* AArch64: remove "arm64_be" support in favour of "aarch64_be".Tim Northover2014-07-231-2/+0
| | | | | | | | | There really is no arm64_be: it was a useful fiction to test big-endian support while both backends existed in parallel, but now the only platform that uses the name (iOS) doesn't have a big-endian variant, let alone one called "arm64_be". llvm-svn: 213748
* AArch64: remove arm64 triple enumerator.Tim Northover2014-07-231-16/+5
| | | | | | | | | | | | Having both Triple::arm64 and Triple::aarch64 is extremely confusing, and invites bugs where only one is checked. In reality, the only legitimate difference between the two (arm64 usually means iOS) is also present in the OS part of the triple and that's what should be checked. We still parse the "arm64" triple, just canonicalise it to Triple::aarch64, so there aren't any LLVM-side test changes. llvm-svn: 213743
* Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ↵David Blaikie2014-07-191-1/+1
| | | | | | | | | | | ".reset()" It's also possible to just write "= nullptr", but there's some question of whether that's as readable, so I leave it up to authors to pick which they prefer for now. If we want to discuss standardizing on one or the other, we can do that at some point in the future. llvm-svn: 213438
* Add MIPS Technologies to the vendors in llvm::Triple.Daniel Sanders2014-07-181-0/+2
| | | | | | | | This is a prerequisite for checking for 'mti' and 'img' in a consistent way in clang. Previously 'img' could use Triple::getVendor() but 'mti' could only use Triple::getVendorName(). llvm-svn: 213381
* Refactor ARM subarchitecture parsingRenato Golin2014-07-181-0/+25
| | | | | | | | | Re-commit of a patch to rework the triple parsing on ARM to a more sane model. Patch by Gabor Ballabas. llvm-svn: 213367
* Drop the udis86 wrapper from llvm::sysAlp Toker2014-07-172-75/+0
| | | | | | | | This optional dependency on the udis86 library was added some time back to aid JIT development, but doesn't make much sense to link into LLVM binaries these days. llvm-svn: 213300
* Typo: exists -> exitsHans Wennborg2014-07-171-1/+1
| | | | llvm-svn: 213290
* Fix the prefix for arm64 tripleYi Kong2014-07-171-3/+2
| | | | | | | | | | | | Triple.cpp still returns "arm64" as prefix for arm64 triple, causing Clang not being able to select the correct GCCBuiltin IR. This patch changes the value to correct prefix "aarch64". Regression test will be added in the coming patch. Differential Revision: http://reviews.llvm.org/D4516 llvm-svn: 213240
* Perform wildcard expansion in Process::GetArgumentVector on Windows (PR17098)Hans Wennborg2014-07-161-19/+71
| | | | | | | | | | | | | | On Windows, wildcard expansion isn't performed by the shell, but left to the program itself. The common way to do this is to link with setargv.obj, which performs the expansion on argc/argv before main is entered. However, we don't use argv in Clang on Windows, but instead call GetCommandLineW so we can handle unicode arguments. This means we have to do wildcard expansion ourselves. A test case will be added on the Clang side. Differential Revision: http://reviews.llvm.org/D4529 llvm-svn: 213114
* Fix a -Wunused-local-typedefs warningAlp Toker2014-07-141-1/+1
| | | | llvm-svn: 213002
* Support: Use a range-based forJustin Bogner2014-07-141-5/+4
| | | | llvm-svn: 212973
* Move the API and implementation of clang::driver::getARMCPUForMArch() to ↵Argyrios Kyrtzidis2014-07-111-0/+82
| | | | | | | | llvm::Triple::getARMCPUForArch(). Suggested by Eric Christopher. llvm-svn: 212846
* Simplify the raw_svector_ostream tweak from r212816Alp Toker2014-07-111-13/+4
| | | | | | | | | | | | The memcpy() and overlap helps didn't help much with timings, so clean up the change. The difference at this point is that we now leave growth of the storage buffer up to SmallVector's implementation: - OS.reserve(OS.capacity() * 2); + OS.reserve(OS.size() + 64); llvm-svn: 212837
* raw_svector_ostream: grow and reserve atomicallyAlp Toker2014-07-111-15/+17
| | | | | | | | | | Including the scratch buffer size in the initial reservation eliminates the subsequent malloc+move operation and offers a healthier constant growth with less memory wastage. When doing this, take care to avoid invalidating the source buffer. llvm-svn: 212816
* Add the CSR company and the Kalimba DSP processor to Triple.Eric Christopher2014-07-101-0/+9
| | | | | | Patch by Matthew Gardiner with fixes by me. llvm-svn: 212745
* Remove move assignment operator to appease older GCCs.Peter Collingbourne2014-07-101-5/+0
| | | | llvm-svn: 212682
* Explicitly define move constructor and move assignment operator to appease MSVC.Peter Collingbourne2014-07-101-0/+9
| | | | llvm-svn: 212679
* SpecialCaseList: use std::unique_ptr.Peter Collingbourne2014-07-101-15/+3
| | | | llvm-svn: 212678
* Decouple llvm::SpecialCaseList text representation and its LLVM IR semantics.Alexey Samsonov2014-07-092-0/+179
| | | | | | | | | | | | | | | | Turn llvm::SpecialCaseList into a simple class that parses text files in a specified format and knows nothing about LLVM IR. Move this class into LLVMSupport library. Implement two users of this class: * DFSanABIList in DFSan instrumentation pass. * SanitizerBlacklist in Clang CodeGen library. The latter will be modified to use actual source-level information from frontend (source file names) instead of unstable LLVM IR things (LLVM Module identifier). Remove dependency edge from ClangCodeGen/ClangDriver to LLVMTransformUtils. No functionality change. llvm-svn: 212643
* Add Imagination Technologies to the vendors in llvm::TripleDaniel Sanders2014-07-091-0/+2
| | | | | | | | Summary: This is a pre-requisite for supporting the mips-img-linux-gnu triple in clang. Differential Revision: http://reviews.llvm.org/D4435 llvm-svn: 212626
* SourceMgr: consistently use 'unsigned' for the memory buffer ID typeDmitri Gribenko2014-07-091-3/+3
| | | | llvm-svn: 212595
* Fix some Twine locals.Benjamin Kramer2014-07-081-3/+2
| | | | | | Two of those are use after frees. Found by clang-tidy, fixed by me. llvm-svn: 212537
* Revert "Refactor ARM subarchitecture parsing"Renato Golin2014-07-081-23/+0
| | | | | | This reverts commit 7b4a6882467e7fef4516a0cbc418cbfce0fc6f6d. llvm-svn: 212521
* Refactor ARM subarchitecture parsingRenato Golin2014-07-071-0/+23
| | | | | | | | | According to a FIXME in ARMMCTargetDesc.cpp the ARM version parsing should be in the Triple helper class. Patch by: Gabor Ballabas llvm-svn: 212479
* Update the MemoryBuffer API to use ErrorOr.Rafael Espindola2014-07-065-86/+74
| | | | llvm-svn: 212405
* SourceMgr: make valid buffer IDs start from oneAlp Toker2014-07-061-15/+16
| | | | | | | | | | Use 0 for the invalid buffer instead of -1/~0 and switch to unsigned representation to enable more idiomatic usage. Also introduce a trivial SourceMgr::getMainFileID() instead of hard-coding 0/1 to identify the main file. llvm-svn: 212398
* Remove obsolete function TargetRegistry::getClosestTargetForJIT()Alp Toker2014-07-011-11/+0
| | | | | | | This was kept around "for compatibility through 2.6" in 2009 and is not used or tested. llvm-svn: 212095
* Refactor the code in clang to find a file in a PATH like environment ↵Ehsan Akhgari2014-06-301-0/+30
| | | | | | variable into a helper function llvm-svn: 212057
* Fix 'platform-specific' hyphenationsAlp Toker2014-06-301-1/+1
| | | | llvm-svn: 212056
* Build fix for systems without futimes/futimensAlp Toker2014-06-301-1/+1
| | | | | | | | | Some versions of Android don't have futimes/futimens and this code wasn't updated during the recent errc refactoring. Patch by Luqman Aden! llvm-svn: 212055
* lldb can interrupt waitpid, so EINTR shouldn't be an error. This fixes the caseJulien Lerouge2014-06-271-1/+5
| | | | | | | | | | where there is no timeout. In the case where there is a timeout though, the code is still wrong since it doesn't check that the alarm really went off. Without this patch, I cannot debug a program that forks itself using sys::ExecuteAndWait with lldb. llvm-svn: 211918
* Re-apply r211287: Remove support for LLVM runtime multi-threading.Chandler Carruth2014-06-271-26/+3
| | | | | | | I'll fix the problems in libclang and other projects in ways that don't require <mutex> until we sort out the cygwin situation. llvm-svn: 211900
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-262-19/+19
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* Add support for ppc64/power8 as a hostWill Schmidt2014-06-261-0/+2
| | | | llvm-svn: 211781
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-262-19/+19
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* For CrashRecoveryContext::RunSafelyOnThread, propagate Darwin's ↵Argyrios Kyrtzidis2014-06-251-2/+21
| | | | | | | | | | | | PRIO_DARWIN_BG to the new thread if it is set on the calling thread. This allows libclang's indexing threads to propagate their priority to the clang module building threads. rdar://17459872 llvm-svn: 211747
OpenPOWER on IntegriCloud