Rafael Espindola [Fri, 20 Mar 2015 14:33:25 +0000 (14:33 +0000)]
Reduce indentation after return. NFC.
llvm-svn: 232814
Rafael Espindola [Fri, 20 Mar 2015 14:23:46 +0000 (14:23 +0000)]
Use early returns. NFC.
llvm-svn: 232813
Alexander Potapenko [Fri, 20 Mar 2015 14:11:05 +0000 (14:11 +0000)]
[ASan] fix litling warnings for coverage-order-pcs.cc
llvm-svn: 232812
Rafael Espindola [Fri, 20 Mar 2015 13:50:15 +0000 (13:50 +0000)]
Fold a llvm_unreachable into an assert. NFC.
llvm-svn: 232811
Rafael Espindola [Fri, 20 Mar 2015 13:47:40 +0000 (13:47 +0000)]
clang-format a function. NFC.
llvm-svn: 232810
Alexander Potapenko [Fri, 20 Mar 2015 13:42:11 +0000 (13:42 +0000)]
[ASan] Move a couple of Posix-specific tests to Posix/
Add a comment about potential breakage of coverage-maybe-open-file.cc on Win
llvm-svn: 232809
Alexander Potapenko [Fri, 20 Mar 2015 13:31:03 +0000 (13:31 +0000)]
[ASan] Move the coverage tests that work on Darwin to common testcase dir.
llvm-svn: 232808
Simon Atanasyan [Fri, 20 Mar 2015 11:28:22 +0000 (11:28 +0000)]
[Mips] Create special PLT entry in case of MIPS R6 ABI
llvm-svn: 232806
Pavel Labath [Fri, 20 Mar 2015 11:24:36 +0000 (11:24 +0000)]
Fix ninja check-lldb
Ninja apparently has issues with commands writing nul characters '\0' to stdout. When it
encounters a nul character, the rest of the output is skipped (I will file a bug with ninja about
that). This breaks the linux buildbot since it parses the ninja check-lldb output to get a list
of failures.
Recently, we have started outputting nul characters in lldb-server tests. This is probably
a bug in itself, but I am not addressing that now. This is just a workaround commit, which
prevents the nul characters from appearing in the output, and gets the buildbot operational again.
llvm-svn: 232805
Daniel Jasper [Fri, 20 Mar 2015 10:00:37 +0000 (10:00 +0000)]
[MBP] Don't outline short optional branches
With the option -outline-optional-branches, LLVM will place optional
branches out of line (more details on r231230).
With this patch, this is not done for short optional branches. A short
optional branch is a branch containing a single block with an
instruction count below a certain threshold (defaulting to 3). Still
everything is guarded under -outline-optional-branches).
Outlining a short branch can't significantly improve code locality. It
can however decrease performance because of the additional jmp and in
cases where the optional branch is hot. This fixes a compile time
regression I have observed in a benchmark.
Review: http://reviews.llvm.org/D8108
llvm-svn: 232802
Pavel Labath [Fri, 20 Mar 2015 09:43:20 +0000 (09:43 +0000)]
Support for truncate/append on log files
Summary:
Presently, if a log file already exists, lldb simply starts overwriting bits of it, without
truncating or anything. This patch makes it use eFileOptionFileTruncate by default. It also adds
an --append option, which will append to the file without truncating. A test is included.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D8450
llvm-svn: 232801
Alexey Bataev [Fri, 20 Mar 2015 07:21:46 +0000 (07:21 +0000)]
[MSVC] Explicit specializations can be declared in any namespace (fix for llvm.org/PR13738)
MS compiler emits no errors in case of explicit specializations outside declaration enclosing namespaces, even when language extensions are disabled.
The patch is to suppress errors and emit extension warnings if explicit specializations are not declared in the corresponding namespaces.
This fixes PR13738.
Patch by Alexey Frolov.
Differential Revision: http://reviews.llvm.org/D8283
llvm-svn: 232800
Justin Bogner [Fri, 20 Mar 2015 06:34:38 +0000 (06:34 +0000)]
InstrProf: Make profile variables private to reduce binary size overhead
When we instrument a program for profiling, we copy the linkage of an
instrumented function so that our datastructures merge in the same way
as the function. This avoids redundant copies for things like
linkonce, but ends up emitting names we never need to reference for
normal and internal symbols. Promoting internal and external linkage
to private for these variables reduces the size overhead of profiling
drastically.
llvm-svn: 232799
Craig Topper [Fri, 20 Mar 2015 05:09:06 +0000 (05:09 +0000)]
[Tablegen] Attempt to add support for patterns containing nodes with multiple results.
This is needed for AVX512 masked scatter/gather support.
The R600 change is necessary to remove a hack that was working around the lack of multiple results.
llvm-svn: 232798
Tom Stellard [Fri, 20 Mar 2015 03:12:42 +0000 (03:12 +0000)]
R600/SI: Add missing CHECK-LABEL lines to a test
llvm-svn: 232797
Nick Lewycky [Fri, 20 Mar 2015 02:52:23 +0000 (02:52 +0000)]
Fix comment from r232794. NFC
llvm-svn: 232796
Alexei Starovoitov [Fri, 20 Mar 2015 02:35:29 +0000 (02:35 +0000)]
[bpf] fix build
fix BPF backend build broken by r232699
llvm-svn: 232795
Nick Lewycky [Fri, 20 Mar 2015 02:25:00 +0000 (02:25 +0000)]
When simplifying a SCEV truncate by distributing, consider it a simplification to replace a cast, even if we end up with a trunc around the term. Fixes PR22960!
llvm-svn: 232794
Richard Smith [Fri, 20 Mar 2015 02:17:21 +0000 (02:17 +0000)]
[modules] Remove some redundant work when building a lookup table for a DeclContext.
When we need to build the lookup table for a DeclContext, we used to pull in
all lexical declarations for the context; instead, just build a lookup table
for the local lexical declarations. We previously didn't guarantee that the
imported declarations would be in the returned map, but in some cases we'd
happen to put them all in there regardless. Now we're even lazier about this.
This unnecessary work was papering over some other bugs:
- LookupVisibleDecls would use the DC for name lookups in the TU in C, and
this was not guaranteed to find all imported names (generally, the DC for
the TU in C is not a reliable place to perform lookups). We now use an
identifier-based lookup mechanism for this.
- We didn't actually load in the list of eagerly-deserialized declarations
when importing a module (so external definitions in a module wouldn't be
emitted by users of those modules unless they happened to be deserialized
by the user of the module).
llvm-svn: 232793
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 00:56:55 +0000 (00:56 +0000)]
SampleProfile: Check for missing debug locations
Don't use `DebugLoc` accessors if we're pointing at null, which will be
a problem after a WIP patch to make the `DIDescriptor` accessors more
strict. Caught by Frontend/profile-sample-use-loc-tracking.c (in
clang).
llvm-svn: 232792
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 00:53:40 +0000 (00:53 +0000)]
DebugInfo: Check for null before using DIType
A WIP patch to turn on stricter `DIDescriptor` accessor checks fires
here; it's obvious from the code that `T` can be null, so add an
explicit check. Caught by dozens of current testcases.
llvm-svn: 232791
Duncan P. N. Exon Smith [Fri, 20 Mar 2015 00:48:23 +0000 (00:48 +0000)]
Verifier: Remove the separate DebugInfoVerifier class
Remove the separate `DebugInfoVerifier` class, as a partial step toward
better integrating debug info verification with the `Verifier`.
Right now, verification of debug info is kind of a mess.
- There are `DIDescriptor::Verify()` checks live in `DebugInfo.cpp`.
These return `bool`, and there's no way to see (except by opening a
debugger) why they fail.
- We rely on `DebugInfoFinder` to traverse the debug info graph and
dig up nodes. However, the regular `Verifier` visits many of these
nodes when it calls into debug info intrinsic operands. Visiting
twice and running different checks is kind of absurd.
- Moreover, `DebugInfoFinder` asserts on failed type resolution -- the
verifier should never assert!
By integrating the two verifiers, I'm aiming at solving these problems
(work to be done, obviously). Verification can be localized to the
`Verifier`; we can use a naive `MDNode` operand traversal to find all
the nodes; we can verify type references instead of asserting on
failure.
There are `assert()`s sprinkled throughout the optimizer and dwarf
backend on `DIDescriptor::Verify()` checks. This is a hangover from
when the debug info verifier was off, so I plan to remove them as I go
(once I confirm that the checks are done at verification time).
Note: to keep the behaviour of only running the debug info verifier when
-verify succeeds, I've added an `EverBroken` flag. Once the
`DebugInfoFinder` assertions are gone and the two traversals have been
merged, I expect to be able to remove this.
llvm-svn: 232790
Hans Wennborg [Fri, 20 Mar 2015 00:41:03 +0000 (00:41 +0000)]
Rewrite SelectionDAGBuilder::Clusterify to run in linear time. NFC.
It was previously repeatedly erasing elements from the middle of a vector,
causing O(n^2) worst-case run-time.
llvm-svn: 232789
Reid Kleckner [Fri, 20 Mar 2015 00:31:07 +0000 (00:31 +0000)]
C++14: Disable sized deallocation by default due to ABI breakage
There are no widely deployed standard libraries providing sized
deallocation functions, so we have to punt and ask the user if they want
us to use sized deallocation. In the future, when such libraries are
deployed, we can teach the driver to detect them and enable this
feature.
N3536 claimed that a weak thunk from sized to unsized deallocation could
be emitted to avoid breaking backwards compatibility with standard
libraries not providing sized deallocation. However, this approach and
other variations don't work in practice.
With the weak function approach, the thunk has to have default
visibility in order to ensure that it is overridden by other DSOs
providing sized deallocation. Weak, default visibility symbols are
particularly expensive on MachO, so John McCall was considering
disabling this feature by default on Darwin. It also changes behavior
ELF linking behavior, causing certain otherwise unreferenced object
files from an archive to be pulled into the link.
Our second approach was to use an extern_weak function declaration and
do an inline conditional branch at the deletion call site. This doesn't
work because extern_weak only works on MachO if you have some archive
providing the default value of the extern_weak symbol. Arranging to
provide such an archive has the same challenges as providing the symbol
in the standard library. Not to mention that extern_weak doesn't really
work on COFF.
Reviewers: rsmith, rjmccall
Differential Revision: http://reviews.llvm.org/D8467
llvm-svn: 232788
Kostya Serebryany [Fri, 20 Mar 2015 00:06:52 +0000 (00:06 +0000)]
Allow -fsanitize-coverage with -fsanitize=dataflow
Summary: Allow -fsanitize-coverage with -fsanitize=dataflow
Test Plan: check-clang
Reviewers: pcc
Reviewed By: pcc
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D8476
llvm-svn: 232787
David Majnemer [Fri, 20 Mar 2015 00:02:27 +0000 (00:02 +0000)]
Don't crash-on-valid when an inline function is friend of class template
We assumed that the most recent declaration of an inline function would
also be inline. However, a more recent declaration can come from a
friend declaration in a class template that is instantiated at the
definition of the function.
llvm-svn: 232786
Peter Collingbourne [Thu, 19 Mar 2015 23:55:38 +0000 (23:55 +0000)]
test: Make a start on a test suite for libLTO.
This works in a similar way to the gold plugin tests. We search for a compatible
linker on $PATH and use it to run tests against our just-built libLTO. To start
with, test the just added opt level functionality.
Differential Revision: http://reviews.llvm.org/D8472
llvm-svn: 232785
Chaoren Lin [Thu, 19 Mar 2015 23:28:10 +0000 (23:28 +0000)]
Report watchpoint hits during single stepping.
Summary:
Reorganized NativeProcessLinux::MonitorSIGTRAP to check for watchpoint hits on
TRAP_TRACE.
Added test for stepping over watchpoints.
https://llvm.org/bugs/show_bug.cgi?id=22814
Reviewers: ovyalov, tberghammer, vharron, clayborg
Subscribers: jingham, labath, lldb-commits
Differential Revision: http://reviews.llvm.org/D8404
llvm-svn: 232784
Eric Christopher [Thu, 19 Mar 2015 23:27:42 +0000 (23:27 +0000)]
Use the cached subtarget on the MachineFunction when the AsmPrinter
will have a MachineFunction, i.e. in places other than the module
level doInitialize/doFinalize.
llvm-svn: 232783
Eric Christopher [Thu, 19 Mar 2015 23:06:21 +0000 (23:06 +0000)]
Use the cached subtarget off of the machine function.
llvm-svn: 232782
Sanjay Patel [Thu, 19 Mar 2015 23:04:25 +0000 (23:04 +0000)]
move insert, extract, concat helper functions closer to related helper functions; NFCI
llvm-svn: 232781
Owen Anderson [Thu, 19 Mar 2015 22:48:57 +0000 (22:48 +0000)]
Fix a nasty bug in DAGCombine of STORE nodes.
This is very related to the bug fixed in r174431. The problem is that
SelectionDAG does not include alignment in the uniquing of loads and
stores. When an otherwise no-op DAGCombine would increase the alignment
of a load or store, the original node would be returned (with the
alignment increased), which would cause the node not to be processed by
any further DAGCombines.
I don't have a direct testcase for this that manifests on an in-tree
target, but I did see some noise in the tests for other targets and have
updated them for it.
llvm-svn: 232780
Duncan P. N. Exon Smith [Thu, 19 Mar 2015 22:43:38 +0000 (22:43 +0000)]
Clang follow-up to LLVM r232772
-verify-di is dead! Long live -verify!
llvm-svn: 232779
Chandler Carruth [Thu, 19 Mar 2015 22:39:51 +0000 (22:39 +0000)]
[Modules] Implement __builtin_isinf_sign in Clang.
Somehow, we never managed to implement this fully. We could constant
fold it like crazy, including constant folding complex arguments, etc.
But if you actually needed to generate code for it, error.
I've implemented it using the somewhat obvious lowering. Happy for
suggestions on a more clever way to lower this.
Now, what you might ask does this have to do with modules? Fun story. So
it turns out that libstdc++ actually uses __builtin_isinf_sign to
implement std::isinf when in C++98 mode, but only inside of a template.
So if we're lucky, and we never instantiate that, everything is good.
But once we try to instantiate that template function, we need this
builtin. All of my customers at least are using C++11 and so they never
hit this code path.
But what does that have to do with modules? Fun story. So it turns out
that with modules we actually observe a bunch of bugs in libstdc++ where
their <cmath> header clobbers things exposed by <math.h>. To fix these,
we have to provide global function definitions to replace the macros
that C99 would have used. And it turns out that ::isinf needs to be
implemented using the exact semantics used by the C++98 variant of
std::isinf. And so I started to fix this bug in libstdc++ and ceased to
be able to compile libstdc++ with Clang.
The yaks are legion.
llvm-svn: 232778
Eric Christopher [Thu, 19 Mar 2015 22:36:38 +0000 (22:36 +0000)]
Remove unused headers.
llvm-svn: 232777
Eric Christopher [Thu, 19 Mar 2015 22:36:37 +0000 (22:36 +0000)]
Add an MCSubtargetInfo variable to the TargetMachine.
This enables us to remove calls to the subtarget from the TargetMachine
and with a small hack for backends that require global subtarget
information for module level code generation, e.g. mips abi flags, as
mentioned in a fixme in the code.
llvm-svn: 232776
Eric Christopher [Thu, 19 Mar 2015 22:36:32 +0000 (22:36 +0000)]
Add a TargetMachine local MCRegisterInfo and MCInstrInfo so that
they can be used without a subtarget in constructing subtarget
independent passes.
llvm-svn: 232775
Reid Kleckner [Thu, 19 Mar 2015 22:31:02 +0000 (22:31 +0000)]
WinEH: Make llvm.eh.actions emission match the EH docs
This switches the sense of the i32 values and updates the test cases.
We can also use CHECK-SAME to clean up some tests, and reduce the visual
noise from bitcasts.
llvm-svn: 232774
Sanjay Patel [Thu, 19 Mar 2015 22:29:40 +0000 (22:29 +0000)]
[X86, AVX] use blends instead of insert128 with index 0
Another case of x86-specific shuffle strength reduction:
avoid generating insert*128 instructions with index 0 because
they are slower than their non-lane-changing blend equivalents.
Shuffle lowering already catches most of these cases, but
the zero vector case and some other paths such as in the
modified test in vector-shuffle-256-v32.ll were getting
through.
Differential Revision: http://reviews.llvm.org/D8366
llvm-svn: 232773
Duncan P. N. Exon Smith [Thu, 19 Mar 2015 22:24:17 +0000 (22:24 +0000)]
Verifier: Remove the separate -verify-di pass
Remove `DebugInfoVerifierLegacyPass` and the `-verify-di` pass.
Instead, call into the `DebugInfoVerifier` from inside
`VerifierLegacyPass::finalizeModule()`. This better matches the logic
in `verifyModule()` (used by the new PassManager), avoids requiring two
separate passes to verify the IR, and makes the API for "add a pass to
verify the IR" simple.
Note: the `-verify-debug-info` flag still works (for now, at least;
eventually it might make sense to just remove it).
llvm-svn: 232772
Peter Collingbourne [Thu, 19 Mar 2015 22:12:08 +0000 (22:12 +0000)]
Fix build failure.
llvm-svn: 232771
Peter Collingbourne [Thu, 19 Mar 2015 22:02:10 +0000 (22:02 +0000)]
LowerBitSets: Avoid reusing byte set addresses.
Each use of the byte array uses a different alias. This makes the
backend less likely to reuse previously computed byte array addresses,
improving the security of the CFI mechanism based on this pass.
Differential Revision: http://reviews.llvm.org/D8455
llvm-svn: 232770
Peter Collingbourne [Thu, 19 Mar 2015 22:01:00 +0000 (22:01 +0000)]
libLTO, llvm-lto, gold: Introduce flag for controlling optimization level.
This change also introduces a link-time optimization level of 1. This
optimization level runs only the globaldce pass as well as cleanup passes for
passes that run at -O0, specifically simplifycfg which cleans up lowerbitsets.
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20150316/266951.html
llvm-svn: 232769
Zachary Turner [Thu, 19 Mar 2015 22:00:21 +0000 (22:00 +0000)]
Move LLDB initialization/shutdown to Initialization.
This creates a new top-level folder called Initialization which
is intended to hold code specific to LLDB system initialization.
Currently this holds the Initialize() and Terminate() functions,
as well as the fatal error handler.
This provides a means to break the massive dependency cycle which
is caused by the fact that Debugger depends on Initialize and
Terminate which then depends on the entire LLDB project. With
this structure, it will be possible for applications to invoke
lldb_private::Initialize() directly, and have that invoke
Debugger::Initialize.
llvm-svn: 232768
Chaoren Lin [Thu, 19 Mar 2015 22:00:13 +0000 (22:00 +0000)]
Fix SBFrame::FindValue for when only global variables exist.
Summary:
sc.block->AppendVariables(...) returns 0 if there are no arguments or local
variables, but we still need to check for global variables.
Test Plan:
```
$ cat test.cpp
int i;
int main() {
}
$ lldb test -o 'b main' -o r
(lldb) script
>>> print lldb.frame.FindValue('i', lldb.eValueTypeVariableGlobal)
(int) i = 0 # as opposed to "No value"
```
Reviewers: jingham, ovyalov, vharron, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D8464
llvm-svn: 232767
David Majnemer [Thu, 19 Mar 2015 21:54:30 +0000 (21:54 +0000)]
MS ABI: Implement the MSVC 2015 scheme for scope disambiguation
consider C++ that looks like:
inline int &f(bool b) {
if (b) {
static int i;
return i;
}
static int i;
return i;
}
Both 'i' variables must have distinct (and stable) names for linkage
purposes. The MSVC 2013 ABI would number the variables using a count of
the number of scopes that have been created. However, the final 'i'
returns to a scope that has already been created leading to a mangling
collision.
MSVC 2015 fixes this by giving the second 'i' the name it would have if
it were declared before the 'if'. However, this results in ABI breakage
because the mangled name, in cases where there was no ambiguity, would
now be different.
We implement the new behavior and only enable it if we are targeting the
MSVC 2015 ABI, otherwise the old behavior will be used.
This fixes PR18131.
llvm-svn: 232766
Duncan P. N. Exon Smith [Thu, 19 Mar 2015 21:37:17 +0000 (21:37 +0000)]
PassManagerBuilder: Remove effectively dead 'StripDebug' option
`StripDebug` was only used by tools/opt/opt.cpp in
`AddStandardLinkPasses()`, but opt.cpp adds the same pass based on its
command-line flag before it calls `AddStandardLinkPasses()`. Stripping
debug info twice isn't very useful.
llvm-svn: 232765
Eric Fiselier [Thu, 19 Mar 2015 21:11:02 +0000 (21:11 +0000)]
Create macro to allow testing of is_convertible without the compiler builtin.
Summary: This patch also fixes one test case that failed in the library version of is_convertible.
Reviewers: mclow.lists, EricWF
Reviewed By: EricWF
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D8456
llvm-svn: 232764
Kostya Serebryany [Thu, 19 Mar 2015 21:01:27 +0000 (21:01 +0000)]
[sanitizer] fix 'sancov.py merge' and add a test for it
llvm-svn: 232763
Eric Fiselier [Thu, 19 Mar 2015 20:59:45 +0000 (20:59 +0000)]
[libcxx] Unify LIBCXX_<ABI-Name>_INCLUDE_PATHS to be LIBCXX_CXX_ABI_INCLUDE_PATHS
Summary:
Clean up all the different possible CMake options for specifying the ABI include paths into one CMake option named `LIBCXX_CXX_ABI_INCLUDE_PATHS`.
The documentation has been updated to reflect this change.
For the next week I have added explicit errors if any of the old flags is used. These errors inform users of the change and the new option to use.
Before committing the change I will announce this change on cfe-dev.
Reviewers: danalbert, mclow.lists
Reviewed By: danalbert, mclow.lists
Subscribers: jroelofs, cbergstrom, cfe-commits
Differential Revision: http://reviews.llvm.org/D5039
llvm-svn: 232762
Simon Atanasyan [Thu, 19 Mar 2015 20:56:34 +0000 (20:56 +0000)]
[Mips] Add comments to the relocation calculation functions
No functional changes.
llvm-svn: 232761
Kaelyn Takata [Thu, 19 Mar 2015 20:56:07 +0000 (20:56 +0000)]
Correct typos in C11 generic-selection expressions.
llvm-svn: 232760
Hans Wennborg [Thu, 19 Mar 2015 20:41:48 +0000 (20:41 +0000)]
Switch lowering: extract NextBlock function. NFC.
llvm-svn: 232759
Krzysztof Parzyszek [Thu, 19 Mar 2015 20:22:17 +0000 (20:22 +0000)]
Unxfail test/CodeGen/Generic/vector.ll now passing on Hexagon
llvm-svn: 232758
Simon Atanasyan [Thu, 19 Mar 2015 19:59:17 +0000 (19:59 +0000)]
[Mips] Implement R_MIPS_PCHI16 / R_MIPS_PCLO16 relocations handling
llvm-svn: 232757
Simon Atanasyan [Thu, 19 Mar 2015 19:59:06 +0000 (19:59 +0000)]
[Mips] Implement R_MIPS_PC18_S3 relocation handling
llvm-svn: 232756
Simon Atanasyan [Thu, 19 Mar 2015 19:58:58 +0000 (19:58 +0000)]
[Mips] Implement R_MIPS_PC19_S2 / R_MIPS_PC26_S2 relocations handling
llvm-svn: 232755
Kostya Serebryany [Thu, 19 Mar 2015 19:52:30 +0000 (19:52 +0000)]
[sanitizer] trying to fix sancov.py with 32-bit python
llvm-svn: 232754
Benjamin Kramer [Thu, 19 Mar 2015 19:44:37 +0000 (19:44 +0000)]
Remove unused diagnostic.
Unused since r231851.
llvm-svn: 232751
Nico Weber [Thu, 19 Mar 2015 19:18:22 +0000 (19:18 +0000)]
Add -Wpartial-availability.
This warns when using decls that are not available on all deployment targets.
For example, a call to
- (void)ppartialMethod __attribute__((availability(macosx,introduced=10.8)));
will warn if -mmacosx-version-min is set to less than 10.8.
To silence the warning, one has to explicitly redeclare the method like so:
@interface Whatever(MountainLionAPI)
- (void)ppartialMethod;
@end
This way, one cannot accidentally call a function that isn't available
everywhere. Having to add the redeclaration will hopefully remind the user
to add an explicit respondsToSelector: call as well.
Some projects build against old SDKs to get this effect, but building against
old SDKs suppresses some bug fixes -- see http://crbug.com/463171 for examples.
The hope is that SDK headers are annotated well enough with availability
attributes that new SDK + this warning offers the same amount of protection
as using an old SDK.
llvm-svn: 232750
Artem Belevich [Thu, 19 Mar 2015 18:58:18 +0000 (18:58 +0000)]
Remove .CUDAIsDevice flags from CodeGenOpts as it's already
available in LangOpts.
Differential Revision: http://reviews.llvm.org/D8385
llvm-svn: 232749
Reid Kleckner [Thu, 19 Mar 2015 18:47:47 +0000 (18:47 +0000)]
Fix -ast-dump of dependent new and delete exprs
llvm-svn: 232748
Artem Belevich [Thu, 19 Mar 2015 18:40:25 +0000 (18:40 +0000)]
Ignore device-side asm constraint errors while compiling CUDA code for host and vice versa.
Differential Revision: http://reviews.llvm.org/D8392
llvm-svn: 232747
Peter Collingbourne [Thu, 19 Mar 2015 18:23:31 +0000 (18:23 +0000)]
gold: Make powerpc support optional for the tests.
Differential Revision: http://reviews.llvm.org/D8400
llvm-svn: 232744
Peter Collingbourne [Thu, 19 Mar 2015 18:23:29 +0000 (18:23 +0000)]
GlobalDCE: Improve performance for large modules containing comdats.
When we encounter a global with a comdat, rather than iterating over
every global in the module to find globals in the same comdat, store the
members in a multimap. This effectively lowers the complexity to O(N log N),
improving performance significantly for large modules such as might be
encountered during LTO.
It looks like we used to do something like this until r219191.
No functional change.
Differential Revision: http://reviews.llvm.org/D8431
llvm-svn: 232743
Justin Bogner [Thu, 19 Mar 2015 18:22:46 +0000 (18:22 +0000)]
docs: Update llvm-cov docs for the -use-color flag
llvm-svn: 232742
Artem Belevich [Thu, 19 Mar 2015 18:12:26 +0000 (18:12 +0000)]
Added missing case for IK_PreprocessedCuda.
llvm-svn: 232741
Reid Kleckner [Thu, 19 Mar 2015 18:09:25 +0000 (18:09 +0000)]
Add -ast-dump support for new and delete expressions to help figure out which operator got selected
llvm-svn: 232740
Reid Kleckner [Thu, 19 Mar 2015 17:45:12 +0000 (17:45 +0000)]
Fix incremental linking with ninja and CMake 3.2+, see LLVM r232662 for details
llvm-svn: 232739
Ilia K [Thu, 19 Mar 2015 17:40:15 +0000 (17:40 +0000)]
Remove IDE_MI_APP_EXIT_OK msg on exit (MI)
Summary: Remove IDE_MI_APP_EXIT_OK msg on exit (MI)
Reviewers: abidh
Reviewed By: abidh
Subscribers: lldb-commits, abidh
Differential Revision: http://reviews.llvm.org/D8446
llvm-svn: 232738
Artem Belevich [Thu, 19 Mar 2015 17:32:06 +0000 (17:32 +0000)]
Ensure that we still parse preprocessed CUDA files as CUDA when we use
-save-temps option.
Summary: Fixes PR22926.
Review: http://reviews.llvm.org/D8383
llvm-svn: 232737
Ilia K [Thu, 19 Mar 2015 17:27:23 +0000 (17:27 +0000)]
expose 64 bit addresses through MI
Summary:
This changes all reporting of addresses from lldb-mi to be 64 bit capable. There could have been cases where a 64 bit address was getting truncated to 32 bit format.
Patch from chuckr@microsoft.com
Reviewers: abidh, ChuckR
Reviewed By: abidh
Subscribers: paulmaybee, ki.stfu, zturner, lldb-commits
Differential Revision: http://reviews.llvm.org/D8238
llvm-svn: 232736
Ilia K [Thu, 19 Mar 2015 17:17:26 +0000 (17:17 +0000)]
Fix memory allocating inside signal handler (MI)
Summary:
This patch fixes a memory allocating inside signal handler.
This bug was found by @vharron:
> Hi all,
>
> I noticed these thread sanitizer warnings while running lldb-mi tests on
> Linux.
>
> WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=39721)
>
> #0 operator new(unsigned long) <null>:0 (lldb-mi-3.7.0+0x000000092b9d)
>
> #1 std::string::_Rep::_S_create(unsigned long, unsigned long,
> std::allocator<char> const&) <null>:0 (libstdc++.so.6+0x0000000ba3b8)
>
> #2 CMICmnResources::GetStringFromResource(unsigned int, CMIUtilString&)
> const
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MICmnResources.cpp:434
> (lldb-mi-3.7.0+0x00000014ddd8)
>
> #3 CMICmnResources::GetString(unsigned int) const
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MICmnResources.cpp:371
> (lldb-mi-3.7.0+0x00000014db81)
>
> #4 sigwinch_handler(int)
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriverMain.cpp:99
> (lldb-mi-3.7.0+0x0000001589ff)
>
> #5 __tsan::CallUserSignalHandler(__tsan::ThreadState*, bool, bool, int,
> my_siginfo_t*, void*) tsan_interceptors.o:0 (lldb-mi-3.7.0+0x00000009f25f)
>
> #6 void std::this_thread::sleep_for<long, std::ratio<1l, 1000l>
> >(std::chrono::duration<long, std::ratio<1l, 1000l> > const&)
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/thread:279
> (lldb-mi-3.7.0+0x00000013243e)
>
> #7 CMIDriver::ReadStdinLineQueue()
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriver.cpp:710
> (lldb-mi-3.7.0+0x000000155e62)
>
> #8 CMIDriver::DoMainLoop()
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriver.cpp:631
> (lldb-mi-3.7.0+0x000000155d37)
>
> #9 non-virtual thunk to CMIDriver::DoMainLoop()
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriver.cpp:648
> (lldb-mi-3.7.0+0x000000155fbd)
>
> #10 CMIDriverMgr::DriverMainLoop()
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriverMgr.cpp:340
> (lldb-mi-3.7.0+0x000000159ee6)
>
> #11 main
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriverMain.cpp:364
> (lldb-mi-3.7.0+0x000000158f60)
Reviewers: vharron, abidh
Reviewed By: abidh
Subscribers: lldb-commits, abidh, vharron
Differential Revision: http://reviews.llvm.org/D8256
llvm-svn: 232735
Ilia K [Thu, 19 Mar 2015 17:13:20 +0000 (17:13 +0000)]
Fix -break-insert for system functions (MI)
Summary:
# Fix -break-insert for system functions
# Fix MiExecTestCase to use -break-insert instead of CLI "b"
# Improve MiBreakTestCase: now it uses printf() instead of in-house function
All tests pass on OS X.
Test Plan:
```
$ bin/lldb-mi --interpreter
(gdb)
-file-exec-and-symbols ~/p/hello
^done
(gdb)
=shlibs-added,shlib-info=[num="1",name="hello",dyld-addr="-",reason="dyld",path="/Users/IliaK/p/hello",loaded_addr="-",dsym-objpath="/Users/IliaK/p/hello.dSYM/Contents/Resources/DWARF/hello"]
-break-insert -f printf
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0xffffffff",func="??",file="??",fullname="??/??",line="0",pending=["printf"],times="0",original-location="printf"}
(gdb)
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0xffffffff",func="??",file="??",fullname="??/??",line="0",pending=["printf"],times="0",original-location="printf"}
-exec-run
^running
...
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x7fff8a476910",func="printf",args=[],file="??",fullname="??",line="-1"},thread-id="1",stopped-threads="all"
(gdb)
```
Reviewers: abidh, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D8412
llvm-svn: 232734
Marshall Clow [Thu, 19 Mar 2015 17:05:59 +0000 (17:05 +0000)]
Add code to honor the match_not_bol and match_not_eol regex flats. Fixes PR#22651. Thanks to Jim Porter for the report and suggested fix.
llvm-svn: 232733
Artem Belevich [Thu, 19 Mar 2015 17:05:35 +0000 (17:05 +0000)]
Add support for __nvvm_reflect changes in libdevice in CUDA-7.0
Summary:
CUDA 7.0's libdevice uses slightly different IR to call __nvvm_reflect
and that triggers an assertion in nvvm_reflect optimization pass. This
change allows nvvm_reflect pass to deal with both old and new ways to
pass an argument to __nvvm_reflect.
Test Plan: ninja check-all
Reviewers: eliben, echristo
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D8399
llvm-svn: 232732
Reid Kleckner [Thu, 19 Mar 2015 17:03:58 +0000 (17:03 +0000)]
Revert "Improvement on sized deallocation from r230160"
This reverts commit r230580.
extern_weak functions don't appear to work on Darwin (PR22951), so we'll
need to come up with a new approach.
llvm-svn: 232731
Chris Bieneman [Thu, 19 Mar 2015 16:49:44 +0000 (16:49 +0000)]
Fixing dependencies for native tablegen.
The dependencies for cross-built tablegen were a bit confused. This fixes that. The following dependencies are now enforced:
(1) Tablegen tasks depend on the native tablegen
(2) Native tablegen depends on the cross-compiled tablegen
Although the native tablegen doesn't actually require the cross tablegen, having this dependency forces the native tablegen to rebuild whenever the cross tablegen changes.
llvm-svn: 232730
Hans Wennborg [Thu, 19 Mar 2015 16:42:21 +0000 (16:42 +0000)]
Switch lowering: remove unnecessary ConstantInt casts. NFC.
llvm-svn: 232729
Krzysztof Parzyszek [Thu, 19 Mar 2015 16:33:08 +0000 (16:33 +0000)]
[Hexagon] Add support for vector instructions
llvm-svn: 232728
Greg Bedwell [Thu, 19 Mar 2015 16:32:47 +0000 (16:32 +0000)]
[CMake] Don't pass in MSVC warning flags as definitions.
NFC currently but required as a prerequisite for using
the Microsoft resource compiler in conjunction with
CMake's ninja generator, which knows how to filter flags
appropriately, but not definitions.
Differential Revision: http://reviews.llvm.org/D8188
llvm-svn: 232727
Benjamin Kramer [Thu, 19 Mar 2015 16:06:49 +0000 (16:06 +0000)]
Devirtualize Attr and all subclasses.
We know all subclasses in tblgen so just generate a giant switch for
the few virtual methods or turn them into a member variable using spare
bits. The giant jump tables aren't pretty but still much smaller than
a vtable for every attribute, shrinking Release+Asserts clang by ~400k.
Also halves the size of the Attr base class. No functional change
intended.
llvm-svn: 232726
Krzysztof Parzyszek [Thu, 19 Mar 2015 15:18:57 +0000 (15:18 +0000)]
[Hexagon] ENDLOOP is a non-reversible conditional branch
llvm-svn: 232725
Tamas Berghammer [Thu, 19 Mar 2015 14:58:36 +0000 (14:58 +0000)]
Don't close pseudo terminal master file descriptor on EOF
Some application on Linux an all application on android close stdout and
stderr during the libc exit stage. Previously the master file descriptor
of the pseudo terminal used to communicate with the inferior was closed
on an EOF causing a race condition and a possible SIGHUP on process
exit. After this change the master file descriptor will be closed by the
destructor of the GDBRemoteCommunicationServerLLGS class.
Differential revision: http://reviews.llvm.org/D8436
llvm-svn: 232724
Benjamin Kramer [Thu, 19 Mar 2015 14:23:45 +0000 (14:23 +0000)]
Move ThreadSafetyReporter into an anonymous namespace. NFC.
llvm-svn: 232723
Benjamin Kramer [Thu, 19 Mar 2015 14:09:20 +0000 (14:09 +0000)]
Internalize PEI. NFC.
llvm-svn: 232722
Manuel Klimek [Thu, 19 Mar 2015 12:00:22 +0000 (12:00 +0000)]
Add option to switch off putting header modules into the dependency file.
llvm-svn: 232721
Daniel Sanders [Thu, 19 Mar 2015 11:27:23 +0000 (11:27 +0000)]
[sparc] Small fix to r232719 to make 2007-12-17-InvokeAsm.ll pass on the buildbot.
llvm-svn: 232720
Daniel Sanders [Thu, 19 Mar 2015 11:26:05 +0000 (11:26 +0000)]
[sparc] Only support the 'm' inline assembly memory constraint. NFC.
Summary:
SPARC doesn't seem to support any additional constraints. Therefore remove
the target hook.
No functional change intended.
Reviewers: venkatra
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8214
llvm-svn: 232719
Daniel Jasper [Thu, 19 Mar 2015 11:05:08 +0000 (11:05 +0000)]
[InstCombine] Don't fold a GEP into itself through a PHI node
This can only occur (I think) through the back-edge of the loop.
However, folding a GEP into itself means that the value of the previous
iteration needs to be stored in the meantime, thus requiring an
additional register variable to be live, but not actually achieving
anything (the gep still needs to be executed once per loop iteration).
The attached test case is derived from:
typedef unsigned uint32;
typedef unsigned char uint8;
inline uint8 *f(uint32 value, uint8 *target) {
while (value >= 0x80) {
value >>= 7;
++target;
}
++target;
return target;
}
uint8 *g(uint32 b, uint8 *target) {
target = f(b, f(42, target));
return target;
}
What happens is that the GEP stored in incptr2 is folded into itself
through the loop's back-edge and the phi-node stored in loopptr,
effectively incrementing the ptr by "2" in each iteration instead of "1".
In this case, it is actually increasing the number of GEPs required as
the GEP before the loop can't be folded away anymore. For comparison:
With this patch:
define i8* @test4(i32 %value, i8* %buffer) {
entry:
%cmp = icmp ugt i32 %value, 127
br i1 %cmp, label %loop.header, label %exit
loop.header: ; preds = %entry
br label %loop.body
loop.body: ; preds = %loop.body, %loop.header
%buffer.pn = phi i8* [ %buffer, %loop.header ], [ %loopptr, %loop.body ]
%newval = phi i32 [ %value, %loop.header ], [ %shr, %loop.body ]
%loopptr = getelementptr inbounds i8, i8* %buffer.pn, i64 1
%shr = lshr i32 %newval, 7
%cmp2 = icmp ugt i32 %newval, 16383
br i1 %cmp2, label %loop.body, label %loop.exit
loop.exit: ; preds = %loop.body
br label %exit
exit: ; preds = %loop.exit, %entry
%0 = phi i8* [ %loopptr, %loop.exit ], [ %buffer, %entry ]
%incptr3 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %incptr3
}
Without this patch:
define i8* @test4(i32 %value, i8* %buffer) {
entry:
%incptr = getelementptr inbounds i8, i8* %buffer, i64 1
%cmp = icmp ugt i32 %value, 127
br i1 %cmp, label %loop.header, label %exit
loop.header: ; preds = %entry
br label %loop.body
loop.body: ; preds = %loop.body, %loop.header
%0 = phi i8* [ %buffer, %loop.header ], [ %loopptr, %loop.body ]
%loopptr = phi i8* [ %incptr, %loop.header ], [ %incptr2, %loop.body ]
%newval = phi i32 [ %value, %loop.header ], [ %shr, %loop.body ]
%shr = lshr i32 %newval, 7
%incptr2 = getelementptr inbounds i8, i8* %0, i64 2
%cmp2 = icmp ugt i32 %newval, 16383
br i1 %cmp2, label %loop.body, label %loop.exit
loop.exit: ; preds = %loop.body
br label %exit
exit: ; preds = %loop.exit, %entry
%ptr2 = phi i8* [ %incptr2, %loop.exit ], [ %incptr, %entry ]
%incptr3 = getelementptr inbounds i8, i8* %ptr2, i64 1
ret i8* %incptr3
}
Review: http://reviews.llvm.org/D8245
llvm-svn: 232718
Daniel Jasper [Thu, 19 Mar 2015 09:40:16 +0000 (09:40 +0000)]
clang-format: Fix another bug in wrapping around "*".
Before:
void aaaaa(
aaaaaaaaaaaa*
aaaaaaaaaaaaaa) {} // even violation the column limit
After:
void aaaaa(
aaaaaaaaaaaa*
aaaaaaaaaaaaaa) {}
llvm-svn: 232717
Ed Schouten [Thu, 19 Mar 2015 09:17:21 +0000 (09:17 +0000)]
Don't print debugging messages to stdout.
There is some debugging code in cxa_demangle.cpp that prints messages on
stdout. In general this is not safe, as the program itself may use
stdout to write its output. Change this code to write to stderr.
Differential Revision: http://reviews.llvm.org/D8167
llvm-svn: 232716
Ilia K [Thu, 19 Mar 2015 09:17:06 +0000 (09:17 +0000)]
Fix double (gdb) prompt when command doesn't exist
llvm-svn: 232715
Sylvestre Ledru [Thu, 19 Mar 2015 09:03:58 +0000 (09:03 +0000)]
Add support for kfreebsd. Thanks to Jan Henke
Reported on the Debian BTS:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=780106
llvm-svn: 232714
Ilia K [Thu, 19 Mar 2015 08:54:17 +0000 (08:54 +0000)]
Fix error handling in CMIDriver::DoMainLoop after r215223 (MI)
llvm-svn: 232713
Alexey Bataev [Thu, 19 Mar 2015 08:44:10 +0000 (08:44 +0000)]
[OPENMP] Fixed bug in codegen of 'atomic write'.
Fixed codegen for exit/continue order after success/failed atomic cmpxchg instruction for 'atomic write' construct.
llvm-svn: 232712
Tobias Grosser [Thu, 19 Mar 2015 07:43:35 +0000 (07:43 +0000)]
Add some missing __isl_give/__isl_keep annotations
llvm-svn: 232711
Tobias Grosser [Thu, 19 Mar 2015 07:39:34 +0000 (07:39 +0000)]
Add forgotten 'FileCheck' to tiling test cases
These test cases did not verify the CHECK lines at all. We add the FileCheck
and also fix some broken CHECK lines. Being here, we extend the checks to
cover the whole loop structure.
llvm-svn: 232710
Tobias Grosser [Thu, 19 Mar 2015 07:27:29 +0000 (07:27 +0000)]
Update isl to 94d707d
The major improvements are:
- Extended schedule tree support
- AST generation from schedule trees
llvm-svn: 232709
Denis Protivensky [Thu, 19 Mar 2015 06:47:44 +0000 (06:47 +0000)]
[ARM] Implement static (initial exec) TLS model
This includes handling of R_ARM_TLS_IE32 and R_ARM_TLS_LE32 relocs.
Differential Revision: http://reviews.llvm.org/D8353
llvm-svn: 232708