summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Support: Add dwarf::getVirtuality()Duncan P. N. Exon Smith2015-02-071-0/+8
| | | | llvm-svn: 228474
* Support: Use Dwarf.def for DW_VIRTUALITY, NFCDuncan P. N. Exon Smith2015-02-071-4/+6
| | | | | | | Use definition file for `DW_VIRTUALITY_*`. Add a `DW_VIRTUALITY_max` both for ease of testing and for future use by the `LLParser`. llvm-svn: 228473
* Support: Add dwarf::getAttributeEncoding()Duncan P. N. Exon Smith2015-02-061-0/+7
| | | | llvm-svn: 228470
* Support: Rewrite AttributeEncodingString(), NFCDuncan P. N. Exon Smith2015-02-061-17/+5
| | | | llvm-svn: 228469
* Support: Stop stringifying DW_ATE_{lo,hi}_userDuncan P. N. Exon Smith2015-02-061-2/+0
| | | | llvm-svn: 228468
* Support: Add dwarf::getLanguage()Duncan P. N. Exon Smith2015-02-061-0/+7
| | | | llvm-svn: 228458
* Support: Rewrite dwarf::LanguageString(), NFCDuncan P. N. Exon Smith2015-02-061-29/+6
| | | | llvm-svn: 228457
* Support: Stop stringifying DW_LANG_{lo,hi}_userDuncan P. N. Exon Smith2015-02-061-2/+0
| | | | llvm-svn: 228451
* Make helper functions/classes/globals static. NFC.Benjamin Kramer2015-02-061-0/+4
| | | | llvm-svn: 228410
* SpecialCaseList: Add support for parsing multiple input files.Alexey Samsonov2015-02-041-23/+35
| | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows users to create SpecialCaseList objects from multiple local files. This is needed to implement a proper support for -fsanitize-blacklist flag (allow users to specify multiple blacklists, in addition to default blacklist, see PR22431). DFSan can also benefit from this change, as DFSan instrumentation pass now accepts ABI-lists both from -fsanitize-blacklist= and -mllvm -dfsan-abilist flags. Go bindings are fixed accordingly. Test Plan: regression test suite Reviewers: pcc Subscribers: llvm-commits, axw, kcc Differential Revision: http://reviews.llvm.org/D7367 llvm-svn: 228155
* Support: Add string => unsigned mapping for DW_TAGDuncan P. N. Exon Smith2015-02-031-0/+8
| | | | | | Add `dwarf::getTag()` to translate from `StringRef` to `unsigned`. llvm-svn: 228031
* Support: Re-implement dwarf::TagString() using a .def file, NFCDuncan P. N. Exon Smith2015-02-031-78/+5
| | | | | | | | | Also re-implements the `dwarf::Tag` enumerator. I've moved the mock tags into the enumerator since there's no other way to do this. Really they shouldn't be used at all (they're just a hack to identify `MDNode`s, but we have a class hierarchy for that now). llvm-svn: 228030
* Support: Stop stringifying DW_TAG_{lo,hi}_userDuncan P. N. Exon Smith2015-02-031-2/+0
| | | | | | | | `dwarf::TagString()` shouldn't stringify `DW_TAG_lo_user` or `DW_TAG_hi_user`. These aren't actual tags; they're markers for the edge of vendor-specific tag regions. llvm-svn: 228029
* NFC. Making printOptionValues an API on the parser class.Chris Bieneman2015-01-301-3/+7
| | | | llvm-svn: 227626
* [Cygming] Seek also chkstk_ms, or JIT fails with DLL builds. It is fixup for ↵NAKAMURA Takumi2015-01-301-0/+6
| | | | | | r227519. llvm-svn: 227574
* iOS doesn't have crt_externs.h available, so we fall back to the posix method.Chris Bieneman2015-01-301-2/+5
| | | | llvm-svn: 227521
* All signal handlers are required to have C language linkage in C++. This ↵Aaron Ballman2015-01-291-1/+1
| | | | | | does not fix all signal handlers, but does fix the most recent one. llvm-svn: 227490
* [Support][Windows] Unify dialog box suppression and print stack traces on abort.Michael J. Spencer2015-01-292-20/+30
| | | | llvm-svn: 227470
* CommandLineParser: Avoid non-static member nitializer(s).NAKAMURA Takumi2015-01-291-2/+4
| | | | llvm-svn: 227428
* Fix the preprocessor checks used to determine if backtraces have been enabled.Owen Anderson2015-01-291-6/+6
| | | | llvm-svn: 227424
* Use the existing build configuration parameter ENABLE_BACKTRACE to compile ↵Owen Anderson2015-01-291-0/+16
| | | | | | | | | | out all pretty stack trace support when backtraces are disabled. This has the nice secondary effect of allowing LLVM to continue to build for targets without __thread or thread_local support to continue to work so long as they build without support for backtraces. llvm-svn: 227423
* [LPM] Clean up the use of TLS in pretty stack trace and disable itChandler Carruth2015-01-291-20/+2
| | | | | | | | | | | | | | | | | | | | | entirely when threads are not enabled. This should allow anyone who needs to bootstrap or cope with a host loader without TLS support to limp along without threading support. There is still some bug in the PPC TLS stuff that is not worked around. I'm getting access to a machine to reproduce and debug this further. There is some chance that I'll have to add a terrible workaround for PPC. There is also some problem with iOS, but I have no ability to really evaluate what the issue is there. I'm leaving it to folks maintaining that platform to suggest a path forward -- personally I don't see any useful path forward that supports threading in LLVM but does so without support for *very basic* TLS. Note that we don't need more than some pointers, and we don't need constructors, destructors, or any of the other fanciness which remains widely unimplemented. llvm-svn: 227411
* [LPM] Fix the PPC attribute to be spelled 'global-dynamic'. This shouldChandler Carruth2015-01-281-2/+2
| | | | | | let the build bot make finish compiling stage2. llvm-svn: 227391
* Build fix for Visual Studio. NFC.Chris Bieneman2015-01-281-5/+2
| | | | llvm-svn: 227385
* [LPM] Try to work around a bug with local-dynamic TLS on PowerPC 64.Chandler Carruth2015-01-281-5/+18
| | | | | | | | | | | | | | | | Sadly, this precludes optimizing it down to initial-exec or local-exec when statically linking, and in general makes the code slower on PPC 64, but there's nothing else for it until we can arrange to produce the correct bits for the linker. Lots of thanks to Ulirch for tracking this down and Bill for working on the long-term fix to LLVM so that we can relegate this to old host clang versions. I'll be watching the PPC build bots to make sure this effectively revives them. llvm-svn: 227352
* Refactoring llvm command line parsing and option registration.Chris Bieneman2015-01-281-170/+158
| | | | | | | | | | | | | | | | | | | | | Summary: The primary goal of this patch is to remove the need for MarkOptionsChanged(). That goal is accomplished by having addOption and removeOption properly sort the options. This patch puts the new add and remove functionality on a CommandLineParser class that is a placeholder. Some of the functionality in this class will need to be merged into the OptionRegistry, and other bits can hopefully be in a better abstraction. This patch also removes the RegisteredOptionList global, and the need for cl::Option objects to be linked list nodes. The changes in CommandLineTest.cpp are required because these changes shift when we validate that options are not duplicated. Before this change duplicate options were only found during certain cl API calls (like cl::ParseCommandLine). With this change duplicate options are found during option construction. Reviewers: dexonsmith, chandlerc, pete Reviewed By: pete Subscribers: pete, majnemer, llvm-commits Differential Revision: http://reviews.llvm.org/D7132 llvm-svn: 227345
* [Hexagon] Replacing intrinsics for halfword adds and max/min word/dword.Colin LeMahieu2015-01-281-8/+0
| | | | llvm-svn: 227322
* [LPM] Rip all of ManagedStatic and ThreadLocal out of the pretty stackChandler Carruth2015-01-281-21/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tracing code. Managed static was just insane overhead for this. We took memory fences and external function calls in every path that pushed a pretty stack frame. This includes a multitude of layers setting up and tearing down passes, the parser in Clang, everywhere. For the regression test suite or low-overhead JITs, this was contributing to really significant overhead. Even the LLVM ThreadLocal is really overkill here because it uses pthread_{set,get}_specific logic, and has careful code to both allocate and delete the thread local data. We don't actually want any of that, and this code in particular has problems coping with deallocation. What we want is a single TLS pointer that is valid to use during global construction and during global destruction, any time we want. That is exactly what every host compiler and OS we use has implemented for a long time, and what was standardized in C++11. Even though not all of our host compilers support the thread_local keyword, we can directly use the platform-specific keywords to get the minimal functionality needed. Provided this limited trial survives the build bots, I will move this to Compiler.h so it is more widely available as a light weight if limited alternative to the ThreadLocal class. Many thanks to David Majnemer for helping me think through the implications across platforms and craft the MSVC-compatible syntax. The end result is *substantially* faster. When running llc in a tight loop over a small IR file targeting the aarch64 backend, this improves its performance by over 10% for me. It also seems likely to fix the remaining regressions seen by JIT users with threading enabled. This may actually have more impact on real-world compile times due to the use of the pretty stack tracing utility throughout the rest of Clang or LLVM, but I've not collected any detailed measurements. llvm-svn: 227300
* [mips] Use __clear_cache builtin instead of cacheflush()Petar Jovanovic2015-01-271-13/+2
| | | | | | | | | Use __clear_cache builtin instead of cacheflush() in Unix Memory::InvalidateInstructionCache(). Differential Revision: http://reviews.llvm.org/D7198 llvm-svn: 227269
* Re-landing changes to use ArrayRef instead of SmallVectorImpl, and new API test.Chris Bieneman2015-01-271-2/+1
| | | | | | This contains the changes from r227148 & r227154, and also fixes to the test case to properly clean up the stack options. llvm-svn: 227255
OpenPOWER on IntegriCloud