Commit Graph

210572 Commits

Author SHA1 Message Date
Reid Kleckner 813f1b65bc [WinEH] Rip out the landingpad-based C++ EH state numbering code
It never really worked, and the new code is working better every day.

llvm-svn: 247860
2015-09-16 22:14:46 +00:00
Devin Coughlin e39bd407ba [analyzer] Add generateErrorNode() APIs to CheckerContext.
The analyzer trims unnecessary nodes from the exploded graph before reporting
path diagnostics. However, in some cases it can trim all nodes (including the
error node), leading to an assertion failure (see
https://llvm.org/bugs/show_bug.cgi?id=24184).

This commit addresses the issue by adding two new APIs to CheckerContext to
explicitly create error nodes. Unless the client provides a custom tag, these
APIs tag the node with the checker's tag -- preventing it from being trimmed.
The generateErrorNode() method creates a sink error node, while
generateNonFatalErrorNode() creates an error node for a path that should
continue being explored.

The intent is that one of these two methods should be used whenever a checker
creates an error node.

This commit updates the checkers to use these APIs. These APIs
(unlike addTransition() and generateSink()) do not take an explicit Pred node.
This is because there are not any error nodes in the checkers that were created
with an explicit different than the default (the CheckerContext's Pred node).

It also changes generateSink() to require state and pred nodes (previously
these were optional) to reduce confusion.

Additionally, there were several cases where checkers did check whether a
generated node could be null; we now explicitly check for null in these places.

This commit also includes a test case written by Ying Yi as part of
http://reviews.llvm.org/D12163 (that patch originally addressed this issue but
was reverted because it introduced false positive regressions).

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

llvm-svn: 247859
2015-09-16 22:03:05 +00:00
Rafael Espindola eade07ba59 Start adding support for Elf_Rel.
I don't intend to add full i686 support right now, just make sure we have all
the infrastructure in place for it.

llvm-svn: 247858
2015-09-16 21:57:07 +00:00
Chaoren Lin d761a9532b Fix Makefile for Windows to Android tests.
Reviewers: zturner

Subscribers: tberghammer, lldb-commits, danalbert

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

llvm-svn: 247857
2015-09-16 21:51:51 +00:00
Rui Ueyama 4dbff20c91 COFF: Fix bug that not all symbols were written to symtab if /opt:noref.
Only live symbols are written to the symbol table. Because isLive()
returned false if dead-stripping was disabled entirely, only
non-COMDAT sections were written to the symbol table. This patch fixes
the issue.

llvm-svn: 247856
2015-09-16 21:40:47 +00:00
Chaoren Lin f59497dc92 XFAIL TestCppNsImport for gcc-4.9.
Works for gcc-4.8. A bug in gcc perhaps.

llvm-svn: 247855
2015-09-16 21:32:48 +00:00
Rui Ueyama 3b153e6541 COFF: Fix bug that /opt:noicf was ignored.
llvm-svn: 247854
2015-09-16 21:30:55 +00:00
Rui Ueyama 4bce7bcc88 COFF: Output messages for /verbose to stdout instead of stderr.
This patch also makes the message less verbose.

llvm-svn: 247853
2015-09-16 21:30:40 +00:00
Ryan Brown 65d4d5c3c6 Add an OperatingSystem plugin to support goroutines
The Go runtime schedules user level threads (goroutines) across real threads.
This adds an OS plugin to create memory threads for goroutines.
It supports the 1.4 and 1.5 go runtime.

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

llvm-svn: 247852
2015-09-16 21:20:44 +00:00
Reid Kleckner 8be1847b09 [WinEH] Fix a build issue in CGException.cpp
I was constructing an object without filling in all the fields.

llvm-svn: 247851
2015-09-16 21:06:09 +00:00
Chris Bieneman bff03b0982 [CMake] More refactoring of symlink creation.
This refactoring is to enable clang to re-use this code.

llvm-svn: 247850
2015-09-16 20:49:59 +00:00
Davide Italiano 6d328d3841 [ELF2] Initial support for local symbols.
Symbol table is now populated correctly, but some fields are missing,
they'll be added in the future. This patch also adds --discard-all
flag, which was the default behavior until now.

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

llvm-svn: 247849
2015-09-16 20:45:57 +00:00
David Majnemer 67bff0d88b [WinEHPrepare] Turn terminatepad into a cleanuppad + call + cleanupret
The MSVC doesn't really support exception specifications so let's just
turn these into cleanuppads.  Later, we might use terminatepad to more
efficiently encode the "noexcept"-ness of a function body.

llvm-svn: 247848
2015-09-16 20:42:16 +00:00
Teresa Johnson ff6a2a6f50 Allow BackpatchWord to be called for non-32-bit aligned words, and
from outside the BitstreamWriter.

Split out of patch D12536 (Function bitcode index in Value Symbol Table
and lazy reading support), which will use it to patch in the VST offset.

llvm-svn: 247847
2015-09-16 20:41:43 +00:00
Sanjoy Das e5f4889ba9 [InstCombine] Optimize icmp slt signum(x), 1 --> icmp slt x, 1
Summary:
`signum(x)` is sometimes implemented as `(x >> 63) | (-x >>> 63)` (for
an `i64` `x`).  This change adds a matcher for that pattern, and an
instcombine rule to optimize `signum(x) s< 1`.

Later, we can also consider optimizing:

  icmp slt signum(x), 0 --> icmp slt x, 0
  icmp sle signum(x), 1 --> true

etc.

Reviewers: majnemer

Subscribers: llvm-commits

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

llvm-svn: 247846
2015-09-16 20:41:29 +00:00
Reid Kleckner 3e9d733e68 [Windows] xfail a test that uses C++ EH
llvm-svn: 247845
2015-09-16 20:32:22 +00:00
Reid Kleckner b005d281c3 [WinEH] Pull Adjectives and CatchObj out of the catchpad arg list
Clang now passes the adjectives as an argument to catchpad.

Getting the CatchObj working is simply a matter of threading another
static alloca through codegen, first as an alloca, then as a frame
index, and finally as a frame offset.

llvm-svn: 247844
2015-09-16 20:16:27 +00:00
Reid Kleckner 10aa77032d [WinEH] Pass the catch adjectives to catchpad directly
This avoids building a fake LLVM IR global variable just to ferry an i32
down into LLVM codegen. It also puts a nail in the coffin of using MS
ABI C++ EH with landingpads, since now we'll assert in the lpad code
when flags are present.

llvm-svn: 247843
2015-09-16 20:15:55 +00:00
Zachary Turner 7d7ca2f2ba add a dependency on terminfo library if llvm uses it
Ncurses related symbols can either all be found in libnurses or split
between libncurses and libtinfo. The main LLVM cmake scripts look for the
setupterm symbol and stores the library that has it in TERMINFO_LIBS. This
covers the split and unified ncurses case. LLDB uses symbols that can end
up in libtinfo so this library should be pulled in if it is found.

There is still an exotic case left where LLDB is configured with
-DLLDB_DISABLE_CURSES=NO and LLVM with -DLLVM_ENABLE_TERMINFO=NO but
misconfigurations will always be possible. Possibly a diagnostic could be
added for that.

This fixes bug 24693.

Differential Revision: http://reviews.llvm.org/D12672
Patch by Jeremi Piotrowski

llvm-svn: 247842
2015-09-16 20:14:01 +00:00
Zachary Turner ddf0661b38 Fix log disable command in ProcessWindowsLog.
The implications of this bug where that "log disable windows" would
not actually disable the log, and worse it would lock the file handle
making it impossible to delete the file until lldb was shut down.

This was then causing the test suite to fail, because the test suite
tries to delete log files in certain situations.

llvm-svn: 247841
2015-09-16 20:13:53 +00:00
Evgeniy Stepanov 10c9ea51a0 Fix compilation warning in compiler-rt.
error: width of bit-field 'allocated' (8 bits) exceeds the width of
its type; value will be truncated to 1 bit [-Werror,-Wbitfield-width]

llvm-svn: 247840
2015-09-16 19:54:36 +00:00
Rafael Espindola 6569522f4b Relax the test to fix some bots.
The string table contains a file path, so addresses and offsets can be
different on some setups.

llvm-svn: 247839
2015-09-16 19:48:57 +00:00
Rafael Espindola 2b92d8f184 Move code computing NumEntries to finalize.
When DynamicSection is constructed we still don't know if there will be
any dynamic relocations or not.

llvm-svn: 247838
2015-09-16 19:26:31 +00:00
Rafael Espindola 3887ebfc21 Add DT_RELA and DT_RELASZ to the dynamic table.
llvm-svn: 247837
2015-09-16 18:52:42 +00:00
Paul Herman ea188fc318 Add using directives to the clang::DeclContext and fix decls for variables inside namespaces
Summary: Supports the parsing of the "using namespace XXX" and "using XXX::XXX" directives. Added ambiguity errors when it two decls with the same name are encountered (see comments in TestCppNsImport). Fixes using directives being duplicated for anonymous namespaces. Fixes GetDeclForUID for specification DIEs.

Reviewers: sivachandra, chaoren, clayborg

Subscribers: lldb-commits

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

llvm-svn: 247836
2015-09-16 18:48:30 +00:00
David Majnemer 459a64aed7 [WinEHPrepare] Provide a cloning mode which doesn't demote
We are experimenting with a new approach to saving and restoring SSA
values used across funclets: let the register allocator do the dirty
work for us.

However, this means that we need to be able to clone commoned blocks
without relying on demotion.

llvm-svn: 247835
2015-09-16 18:40:37 +00:00
David Majnemer b3d9b960ea [WinEHPrepare] Refactor explicit EH preparation
Split the preparation machinery into several functions, we will want to
selectively enable/disable different parts of it for an alternative
mechanism for dealing with cross-funclet uses.

llvm-svn: 247834
2015-09-16 18:40:24 +00:00
Chris Bieneman 672311b368 [CMake] Make the sample program in darwin_test_archs have a symbol it needs to link.
This resolves an issue building compiler-rt using Xcode 7 that was reported on llvm-dev:

http://lists.llvm.org/pipermail/llvm-dev/2015-September/090245.html

llvm-svn: 247833
2015-09-16 18:29:52 +00:00
Argyrios Kyrtzidis 6d0a767685 [tooling] Add unit tests for change in r247468.
llvm-svn: 247832
2015-09-16 18:28:42 +00:00
Enrico Granata 7cb59e1a0f Move hardcoded formatters from the FormatManager to the Language plugins
llvm-svn: 247831
2015-09-16 18:28:11 +00:00
Zachary Turner b33bac9a70 Remove XFAIL from TestCppNsImport.
This test seems to be working now, probably due to r244764.

llvm-svn: 247830
2015-09-16 18:19:06 +00:00
Adrian McCarthy d9dbae599d Add first tests for mini-dump debugging.
Differential Revision: http://reviews.llvm.org/D12888

llvm-svn: 247829
2015-09-16 18:17:11 +00:00
Anton Yartsev c647a6df72 [analyzer] Improved behavior if Clang was not found, part II
- scan-build help: display 'Could not query Clang for the list of available checkers.' + the reason why it happened so if clang was not found.
- display requested/forced help in case of --use-analyzer=Xcode.

llvm-svn: 247828
2015-09-16 18:12:15 +00:00
Dan Albert 5e61cfdb9e Add endianness configuration block for GCC.
Previously GCC using libc++ would just leak endian.h for every
include.

llvm-svn: 247827
2015-09-16 18:10:47 +00:00
Zachary Turner dd07e00dbc Silence compiler warnings about unhandled switch cases.
llvm-svn: 247826
2015-09-16 18:08:45 +00:00
Zachary Turner 4a58dd3035 Last set of XFAILs for Windows.
llvm-svn: 247825
2015-09-16 18:08:33 +00:00
Teresa Johnson 8c8fe5a015 Disable the second verification run when performing LTO through
gold in NDEBUG mode.
Follow on patch for r247729 - LTO: Disable extra verify runs in release
builds.

llvm-svn: 247824
2015-09-16 18:06:45 +00:00
Greg Clayton 62c01ff9ca Add newline at end of file to avoid compiler warning.
llvm-svn: 247823
2015-09-16 18:05:08 +00:00
Ed Maste 1a6ddd5149 Decorate flaky FreeBSD test
ExprCommandWithTimeoutsTestCase::expectedFailureFreeBSD had an
expectedFailureFreeBSD decorator, removed in r247799. It had been flakey
on the FreeBSD buildbot but passed locally. John Wolfe has since
observed a local failure, so add expectedFlakeyFreeBSD until we can
investigate and likely increase the timeout in the test.

llvm.org/pr19605 (FreeBSD)
llvm.org/pr20275 (equivalent Linux issue)

llvm-svn: 247822
2015-09-16 18:00:09 +00:00
Oleksiy Vyalov eff9ad2e6e Add plugin.jit-loader.gdb.enable-jit-breakpoint property to make JIT loader breakpoint optional.
http://reviews.llvm.org/D12890

llvm-svn: 247821
2015-09-16 17:38:36 +00:00
Reid Kleckner 84ebff4a5e [WinEH] Skip state numbering when no EH pads are present
Otherwise we'd try to emit the thunk that passes the LSDA to
__CxxFrameHandler3. We don't emit the LSDA if there were no landingpads,
so we'd end up with an assembler error when trying to write the COFF
object.

llvm-svn: 247820
2015-09-16 17:19:44 +00:00
Mehdi Amini 6f6f137e49 Improve "default_triple" specification: make it at the directory level for test/tools/llvm-mc
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 247819
2015-09-16 17:03:12 +00:00
Dan Gohman 950a13cfa3 [WebAssembly] Check in an initial CFG Stackifier pass
This pass implements a simple algorithm for conversion from CFG to
wasm's structured control flow. It doesn't yet handle multiple-entry
loops; that will be added in a future patch.

It also adds initial support for switch statements.

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

llvm-svn: 247818
2015-09-16 16:51:30 +00:00
Rui Ueyama b02a320f5e COFF: Enable ICF by default.
MSVC linker enables ICF as long as /opt:ref is eanbled, so do we.

llvm-svn: 247817
2015-09-16 16:41:38 +00:00
Rui Ueyama c04d5dbf20 COFF: Rename /opt:lldicf -> /opt:icf.
Now that ICF is complete, we can rename this option so that
the driver accepts the MSVC-compatible command line option.

llvm-svn: 247816
2015-09-16 16:33:57 +00:00
Sanjay Patel a260701bbb propagate fast-math-flags on DAG nodes
After D10403, we had FMF in the DAG but disabled by default. Nick reported no crashing errors after some stress testing, 
so I enabled them at r243687. However, Escha soon notified us of a bug not covered by any in-tree regression tests: 
if we don't propagate the flags, we may fail to CSE DAG nodes because differing FMF causes them to not match. There is
one test case in this patch to prove that point.

This patch hopes to fix or leave a 'TODO' for all of the in-tree places where we create nodes that are FMF-capable. I 
did this by putting an assert in SelectionDAG.getNode() to find any FMF-capable node that was being created without FMF
( D11807 ). I then ran all regression tests and test-suite and confirmed that everything passes.

This patch exposes remaining work to get DAG FMF to be fully functional: (1) add the flags to non-binary nodes such as
FCMP, FMA and FNEG; (2) add the flags to intrinsics; (3) use the flags as conditions for transforms rather than the
current global settings.

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

llvm-svn: 247815
2015-09-16 16:31:21 +00:00
Reid Kleckner 85dfb68e50 Add assembler fatal error for undefined assembler labels in COFF writer
llvm-svn: 247814
2015-09-16 16:26:29 +00:00
Sanjay Patel 815adacd22 don't repeat function names in comments; NFC
llvm-svn: 247813
2015-09-16 16:21:08 +00:00
Alexander Kornienko c7a6b40d10 [clang-tidy] Ignore spaces in -checks=
llvm-svn: 247812
2015-09-16 16:16:53 +00:00
Rafael Espindola 19e3889dba Start creating dynamic relocations.
For now we don't create got/plt and only Elf_Rela is supported.

llvm-svn: 247811
2015-09-16 15:54:15 +00:00