Commit Graph

3056 Commits

Author SHA1 Message Date
Chris Bieneman
0213b090b8 Fixing broken bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229176 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 23:10:31 +00:00
Chris Bieneman
845c00e2e6 NFC. Moving the RegisteredOptionCategories global into the CommandLineParser class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229172 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 22:54:32 +00:00
Chris Bieneman
a87100c6d2 NFC. clang-format wants to change this from two lines to one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229171 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 22:54:29 +00:00
Chris Bieneman
736c14962e NFC. More code cleanup making LookupOption a member of the CommandLineParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229170 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 22:54:27 +00:00
Reid Kleckner
86b5c3a844 Triple: Make setEnvironment not override the object format
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229160 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 22:05:50 +00:00
Duncan P. N. Exon Smith
191690dc8c Support: Add dwarf::getOperationEncoding()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229001 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:05:00 +00:00
Duncan P. N. Exon Smith
5fc468cbf5 Support: Rewrite LocationAtom and OperationEncodingString(), NFC
Use `Dwarf.def` more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229000 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:04:08 +00:00
Benjamin Kramer
d913d9d2c3 MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line with countTrailingZeros
Update all callers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228930 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 15:35:40 +00:00
Tim Northover
6950b93dfd Triple: refactor redundant code.
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228926 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 15:12:13 +00:00
Zachary Turner
6f4e8d27e9 Revert "Change Path::filename_pos() to skip the drive letter."
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228890 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 00:05:49 +00:00
Zachary Turner
b357516cb4 Change Path::filename_pos() to skip the drive letter.
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228874 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 21:16:35 +00:00
Zachary Turner
c371307e60 Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228798 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 03:28:02 +00:00
Bradley Smith
cec93b661d [ARM] Add armv6s[-]m as an alias to armv6[-]m
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228696 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 15:15:08 +00:00
Zachary Turner
afd23204f0 Teach llvm_add_library() to find include dirs.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228670 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 05:04:37 +00:00
Ben Langmuir
ea280d963d Reduce the LockFileManager timeout, and provide unsafeRemoveLockFile
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228603 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-09 20:34:24 +00:00
Zachary Turner
3afd6d0734 Make UTF8->UTF16 conversion null terminate output on empty input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-08 18:08:51 +00:00
Joerg Sonnenberger
128482cfc4 Avoid integer overflows around realloc calls resulting in potential
heap. Problem identified by Guido Vranken. Changes differ from original
OpenBSD sources by not depending on non-portable reallocarray.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228507 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 21:24:06 +00:00
Duncan P. N. Exon Smith
5a504d487c Support: Add dwarf::getVirtuality()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228474 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 00:37:15 +00:00
Duncan P. N. Exon Smith
a496490358 Support: Use Dwarf.def for DW_VIRTUALITY, NFC
Use definition file for `DW_VIRTUALITY_*`.  Add a `DW_VIRTUALITY_max`
both for ease of testing and for future use by the `LLParser`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228473 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 00:36:23 +00:00
Duncan P. N. Exon Smith
e29c334dd4 Support: Add dwarf::getAttributeEncoding()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228470 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:46:49 +00:00
Duncan P. N. Exon Smith
87c9a125d8 Support: Rewrite AttributeEncodingString(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228469 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:45:37 +00:00
Duncan P. N. Exon Smith
f0d7e8a1b8 Support: Stop stringifying DW_ATE_{lo,hi}_user
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228468 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:44:24 +00:00
Duncan P. N. Exon Smith
81bb18728b Support: Add dwarf::getLanguage()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228458 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:55:13 +00:00
Duncan P. N. Exon Smith
e0916cdbc4 Support: Rewrite dwarf::LanguageString(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228457 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:53:19 +00:00
Duncan P. N. Exon Smith
42f3b502ce Support: Stop stringifying DW_LANG_{lo,hi}_user
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228451 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:34:48 +00:00
Benjamin Kramer
e003f1ac8c Make helper functions/classes/globals static. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228410 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 17:51:54 +00:00
Alexey Samsonov
282314741d SpecialCaseList: Add support for parsing multiple input files.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228155 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 17:39:48 +00:00
Duncan P. N. Exon Smith
5ff000f15e Support: Add string => unsigned mapping for DW_TAG
Add `dwarf::getTag()` to translate from `StringRef` to `unsigned`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228031 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:16:49 +00:00
Duncan P. N. Exon Smith
b3d53c6065 Support: Re-implement dwarf::TagString() using a .def file, NFC
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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228030 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:13:16 +00:00
Duncan P. N. Exon Smith
17e8d42c63 Support: Stop stringifying DW_TAG_{lo,hi}_user
`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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228029 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:08:33 +00:00
Chris Bieneman
2048ee38ab NFC. Making printOptionValues an API on the parser class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227626 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 22:16:01 +00:00
NAKAMURA Takumi
d379c6b491 [Cygming] Seek also chkstk_ms, or JIT fails with DLL builds. It is fixup for r227519.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227574 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 13:01:19 +00:00
Chris Bieneman
39687b93fa iOS doesn't have crt_externs.h available, so we fall back to the posix method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227521 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 00:10:39 +00:00
Aaron Ballman
1b7b2597d5 All signal handlers are required to have C language linkage in C++. This does not fix all signal handlers, but does fix the most recent one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227490 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 20:48:34 +00:00
Michael J. Spencer
9565549e5d [Support][Windows] Unify dialog box suppression and print stack traces on abort.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227470 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 17:20:29 +00:00
NAKAMURA Takumi
760c72110f CommandLineParser: Avoid non-static member nitializer(s).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227428 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 11:06:59 +00:00
Owen Anderson
b326bdc595 Fix the preprocessor checks used to determine if backtraces have been enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227424 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 07:53:13 +00:00
Owen Anderson
e9cc6bd43f Use the existing build configuration parameter ENABLE_BACKTRACE to compile 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227423 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 07:35:31 +00:00
Chandler Carruth
54e0791182 [LPM] Clean up the use of TLS in pretty stack trace and disable it
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227411 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 01:23:04 +00:00
Chandler Carruth
41e59785c1 [LPM] Fix the PPC attribute to be spelled 'global-dynamic'. This should
let the build bot make finish compiling stage2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227391 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 23:10:57 +00:00
Chris Bieneman
75a1a5c24b Build fix for Visual Studio. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227385 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 22:25:00 +00:00
Chandler Carruth
2aefa011df [LPM] Try to work around a bug with local-dynamic TLS on PowerPC 64.
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227352 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 19:29:22 +00:00
Chris Bieneman
61b9b31ef1 Refactoring llvm command line parsing and option registration.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227345 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 19:00:25 +00:00
Colin LeMahieu
4b032d5f15 [Hexagon] Replacing intrinsics for halfword adds and max/min word/dword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227322 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 17:06:40 +00:00
Chandler Carruth
d5bce3cab0 [LPM] Rip all of ManagedStatic and ThreadLocal out of the pretty stack
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 09:52:14 +00:00
Petar Jovanovic
6f2698140e [mips] Use __clear_cache builtin instead of cacheflush()
Use __clear_cache builtin instead of cacheflush() in
Unix Memory::InvalidateInstructionCache().

Differential Revision: http://reviews.llvm.org/D7198


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-27 23:30:18 +00:00
Chris Bieneman
4990e83b7b Re-landing changes to use ArrayRef instead of SmallVectorImpl, and new API test.
This contains the changes from r227148 & r227154, and also fixes to the test case to properly clean up the stack options.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227255 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-27 22:21:06 +00:00
Richard Trieu
510cadb1c2 Revert r227148 & r227154 which added a test which infinitely loops.
r227148 added test CommandLineTest.HideUnrelatedOptionsMulti which repeatedly
outputs two following lines:

-tool: CommandLine Error: Option 'test-option-1' registered more than once!
-tool: CommandLine Error: Option 'test-option-2' registered more than once!

r227154 depends on changes from r227148


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227167 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-27 03:03:47 +00:00
Chris Bieneman
57d5adfe15 One more fix to the new API to fix const-correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227154 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-27 00:42:00 +00:00
Chris Bieneman
f96362358f Pete Cooper suggested the new API should use ArrayRef instead of SmallVectorImpl. Also adding a test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227148 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-26 22:50:47 +00:00