Rui Ueyama [Tue, 20 Dec 2016 23:09:09 +0000 (23:09 +0000)]
Move GlobPattern class from LLD to llvm/Support.
GlobPattern is a class to handle glob pattern matching. Currently
only LLD is using that, but technically that feature is not specific
to linkers, so in this patch I move that file to LLVM.
Differential Revision: https://reviews.llvm.org/D27969
llvm-svn: 290212
Michael Zolotukhin [Tue, 20 Dec 2016 23:03:42 +0000 (23:03 +0000)]
[SCEV] Be less conservative when extending bitwidths for computing ranges.
Summary:
In getRangeForAffineAR we compute ranges for affine exprs E = A + B*C,
where ranges for A, B, and C are known. To avoid overflow, we need to
operate on a bigger bitwidth, and originally we chose 2*x+1 for this
(x being the original bitwidth). However, it is safe to use just 2*x:
A+B*C <= (2^x - 1) + (2^x - 1)*(2^x - 1) =
= 2^x - 1 + 2^2x - 2^x - 2^x + 1 =
= 2^2x - 2^x <= 2^2x - 1
Unnecessary extending of bitwidths results in noticeable slowdowns: ranges
perform arithmetic operations using APInt, which are much slower when bitwidths
are bigger than 64.
Reviewers: sanjoy, majnemer, chandlerc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27795
llvm-svn: 290211
Malcolm Parsons [Tue, 20 Dec 2016 22:57:21 +0000 (22:57 +0000)]
Comment out char16_t and char32_t tests
llvm-svn: 290210
Chris Bieneman [Tue, 20 Dec 2016 22:36:42 +0000 (22:36 +0000)]
Revert "[ObjectYAML] Support for DWARF debug_info section"
This reverts commit r290204.
Still breaking bots... In a meeting now, so I can't fix it immediately.
Bot URL:
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2415
llvm-svn: 290209
Paul Robinson [Tue, 20 Dec 2016 22:30:44 +0000 (22:30 +0000)]
Make a test use a specific C++ dialect
In stack-reuse-miscompile.cpp, the allocas for the temps come out in
a different order depending on whether the dialect is C++03 or
C++11. Specify C++03 explicitly to avoid depending on the default.
Differential Revision: http://reviews.llvm.org/D27956
llvm-svn: 290208
Paul Robinson [Tue, 20 Dec 2016 22:26:11 +0000 (22:26 +0000)]
C++11 test cleanup: nonthrowing destructors
If a dtor has no interesting members, then it ends up being nothrow,
which affects the generated IR. Modify some tests to tolerate this
difference between C++03 and C++11.
Differential Revision: http://reviews.llvm.org/D27936
llvm-svn: 290207
Simon Atanasyan [Tue, 20 Dec 2016 22:24:45 +0000 (22:24 +0000)]
[ELF] Do not warn about missed entry symbol in case of relocatable output
Relocatable file does not need to have an entry symbol so the warning is
useless in that case.
llvm-svn: 290206
Paul Robinson [Tue, 20 Dec 2016 22:22:24 +0000 (22:22 +0000)]
Make two vtable tests tolerate C++11.
In C++11 we don't emit vtables as eagerly as we do for C++03, so
fiddle the tests to emit them when the test expects them.
Differential Revision: http://reviews.llvm.org/D27994
llvm-svn: 290205
Chris Bieneman [Tue, 20 Dec 2016 21:35:31 +0000 (21:35 +0000)]
[ObjectYAML] Support for DWARF debug_info section
This patch adds support for YAML<->DWARF for debug_info sections.
This re-lands r290147, after fixing the issue that caused bots to fail (thank you UBSan!).
llvm-svn: 290204
Richard Smith [Tue, 20 Dec 2016 21:35:28 +0000 (21:35 +0000)]
[c++1z] P0195R2: Support pack-expansion of using-declarations.
This change introduces UsingPackDecl as a marker for the set of UsingDecls
produced by pack expansion of a single (unresolved) using declaration. This is
not strictly necessary (we just need to be able to map from the original using
declaration to its expansions somehow), but it's useful to maintain the
invariant that each declaration reference instantiates to refer to one
declaration.
This is a re-commit of r290080 (reverted in r290092) with a fix for a
use-after-lifetime bug.
llvm-svn: 290203
Malcolm Parsons [Tue, 20 Dec 2016 21:26:07 +0000 (21:26 +0000)]
[clang-tidy] Add modernize-use-default-member-init check
Summary: Fixes PR18858
Reviewers: alexfh, hokein, aaron.ballman
Subscribers: JDevlieghere, Eugene.Zelenko, Prazek, mgorny, cfe-commits, modocache
Differential Revision: https://reviews.llvm.org/D26750
llvm-svn: 290202
Kostya Kortchinsky [Tue, 20 Dec 2016 21:17:58 +0000 (21:17 +0000)]
[scudo] ARM32 support
Summary:
With the previous modifications, the code works on ARM32. The random shuffle
test is unsupported on 32-bit platforms for the moment and being marked as
such. There is no hardware support for the checksum computation yet, this will
come at a later point.
Reviewers: kcc, alekseyshl
Subscribers: llvm-commits, aemerson, rengolin, mgorny
Differential Revision: https://reviews.llvm.org/D27957
llvm-svn: 290201
Peter Collingbourne [Tue, 20 Dec 2016 21:12:28 +0000 (21:12 +0000)]
IR: Eliminate non-determinism in the module summary analysis.
Also make the summary ref and call graph vectors immutable. This means
a smaller API surface and fewer places to audit for non-determinism.
Differential Revision: https://reviews.llvm.org/D27875
llvm-svn: 290200
Haicheng Wu [Tue, 20 Dec 2016 20:23:48 +0000 (20:23 +0000)]
[LoopUnroll] Modify a comment to clarify the usage of TripCount. NFC.
Make it clear that TripCount is the upper bound of the iteration on which
control exits LatchBlock.
Differential Revision: https://reviews.llvm.org/D26675
llvm-svn: 290199
Eli Friedman [Tue, 20 Dec 2016 20:05:07 +0000 (20:05 +0000)]
[ARM] Implement isExtractSubvectorCheap.
See https://reviews.llvm.org/D6678 for the history of
isExtractSubvectorCheap. Essentially the same considerations apply
to ARM.
This temporarily breaks the formation of vpadd/vpaddl in certain cases;
AddCombineToVPADDL essentially assumes that we won't form VUZP shuffles.
See https://reviews.llvm.org/D27779 for followup fix.
Differential Revision: https://reviews.llvm.org/D27774
llvm-svn: 290198
Boris Ulasevich [Tue, 20 Dec 2016 20:00:58 +0000 (20:00 +0000)]
Rollback my commit r290168 to fix linux tests failure. I'll be back!
llvm-svn: 290197
Eli Friedman [Tue, 20 Dec 2016 19:33:24 +0000 (19:33 +0000)]
[ARM] Generate checks for shuffle tests using update_llc_test_checks.py.
llvm-svn: 290196
Matt Arsenault [Tue, 20 Dec 2016 19:06:15 +0000 (19:06 +0000)]
Use MaxDepth instead of repeating its value
llvm-svn: 290194
Matt Arsenault [Tue, 20 Dec 2016 19:06:12 +0000 (19:06 +0000)]
AMDGPU: Allow 16-bit types in inline asm constraints
llvm-svn: 290193
Matt Arsenault [Tue, 20 Dec 2016 18:55:11 +0000 (18:55 +0000)]
AMDGPU: Run fp combine tests on VI
llvm-svn: 290192
Matt Arsenault [Tue, 20 Dec 2016 18:55:06 +0000 (18:55 +0000)]
AMDGPU: Don't add same instruction multiple times to worklist
When the instruction is processed the first time, it may be
deleted resulting in crashes. While the new test adds the same
user to the worklist twice, this particular case doesn't crash
but I'm not sure why.
llvm-svn: 290191
George Burgess IV [Tue, 20 Dec 2016 18:46:27 +0000 (18:46 +0000)]
Replace std::find_if with llvm::find_if. NFC.
llvm-svn: 290190
Zachary Turner [Tue, 20 Dec 2016 18:05:47 +0000 (18:05 +0000)]
Revert "Re-add the assert to StringRef's const char *, length constructor."
This reverts commit r290188, which is causing internal compiler errors
on GCC 4.8
llvm-svn: 290189
Zachary Turner [Tue, 20 Dec 2016 17:57:56 +0000 (17:57 +0000)]
Re-add the assert to StringRef's const char *, length constructor.
By putting the assert behind a conditional in the initializer list
we can ensure that it will still work in a constexpr context as
the else branch of the ternary operator won't be examined unless
the condition fails.
llvm-svn: 290188
David Blaikie [Tue, 20 Dec 2016 17:43:48 +0000 (17:43 +0000)]
Fix missing '>' in docs (hopefully fixes bot error... )
llvm-svn: 290187
David Blaikie [Tue, 20 Dec 2016 17:33:58 +0000 (17:33 +0000)]
Add some brief documentation about GDB pretty printers
llvm-svn: 290186
Tom Stellard [Tue, 20 Dec 2016 17:26:34 +0000 (17:26 +0000)]
AMDGPU/SI: Make a function const
llvm-svn: 290185
Tom Stellard [Tue, 20 Dec 2016 17:19:44 +0000 (17:19 +0000)]
AMDGPU/SI: Add a MachineMemOperand when lowering llvm.amdgcn.buffer.load.*
Reviewers: arsenm, nhaehnle, mareko
Subscribers: kzhuravl, wdng, yaxunl, llvm-commits, tony-tye
Differential Revision: https://reviews.llvm.org/D27834
llvm-svn: 290184
Simon Pilgrim [Tue, 20 Dec 2016 17:09:52 +0000 (17:09 +0000)]
[X86][SSE] Ensure we're only combining shuffles with legal mask types.
I haven't managed to get this to fail yet but its technically possible for the AND -> shuffle decomposition to result in illegal types.
llvm-svn: 290183
Alexey Bataev [Tue, 20 Dec 2016 16:51:02 +0000 (16:51 +0000)]
[OPENMP] Fix for PR31416: Clang crashes on OMPCapturedExpr during source
based coverage compilation
Added source location info to captured expression declaration + fixed
source location info for loop based directives.
llvm-svn: 290181
Chris Bieneman [Tue, 20 Dec 2016 16:28:18 +0000 (16:28 +0000)]
[CMake] [PR31433] Fix LLDB tool installation
This resolves PR 31433.
llvm-svn: 290180
Tom Stellard [Tue, 20 Dec 2016 15:52:17 +0000 (15:52 +0000)]
AMDGPU/SI: Add a MachineMemOperand to MIMG instructions
Summary:
Without a MachineMemOperand, the scheduler was assuming MIMG instructions
were ordered memory references, so no loads or stores could be reordered
across them.
Reviewers: arsenm
Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye
Differential Revision: https://reviews.llvm.org/D27536
llvm-svn: 290179
Daniel Jasper [Tue, 20 Dec 2016 15:27:46 +0000 (15:27 +0000)]
clang-format: Fix bug in understanding string-label&value analysis.
While for <<-operators often used in log statments, a single key value
pair is always on the second operator, e.g.
llvm::errs() << "aaaaa=" << aaaaa;
It is on the first operator for plus- or comma-concatenated strings:
string s = "
aaaaaaaaaa: " +
aaaaaaaa;
(the "=" not counting because that's a different operator precedence)
llvm-svn: 290177
Eric Liu [Tue, 20 Dec 2016 14:39:04 +0000 (14:39 +0000)]
[change-namespace] do not fix calls to overloaded operator functions.
Summary: Also make sure one function reference is only processed once.
Reviewers: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D27982
llvm-svn: 290176
Alexey Bataev [Tue, 20 Dec 2016 12:10:05 +0000 (12:10 +0000)]
[OPENMP] Fix for PR31428: variable named like directive name modifier
Directive name modifiers in 'if' clause are allowed only for OpenMP 4.5
and higher + in OpenMP 4.5 parsing procedure emits error message if ':'
is not found after directive name modifier.
llvm-svn: 290175
George Rimar [Tue, 20 Dec 2016 11:28:54 +0000 (11:28 +0000)]
[ELF] - Treat .openbsd.randomdata as relro section
That was requested by Mark Kettenis in llvm-dev:
"It is the intention that .openbsd.randomdata sections are made
read-only after initialization. The native (ld.bfd based) OpenBSD
toolchain accomplishes this by including .openbsd.randomdata into the
PT_GNU_RELRO segment."
He suggested code change, I added testcase.
Differential revision: https://reviews.llvm.org/D27974
llvm-svn: 290174
Daniel Jasper [Tue, 20 Dec 2016 10:05:04 +0000 (10:05 +0000)]
Revert "[OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand."
This reverts commit r290171. It triggers a bunch of warnings, because
the new enumerator isn't handled in all switches. We want a warning-free
build.
Replied on the commit with more details.
llvm-svn: 290173
Kevin Funk [Tue, 20 Dec 2016 09:56:56 +0000 (09:56 +0000)]
Fix for clang_Cursor_getSpellingNameRange()
Summary:
Fixes spelling name ranges for user-defined string literal operators.
Example:
constexpr int operator""_toint(unsigned long long val)
{ return int(val); }
Before this patch the spelling name range on consisted of 'operator'.
After this patch: 'operator""_toint'.
Related to http://reviews.llvm.org/D5041, which fixes the function for
other cursor kinds.
Reviewers: akyrtzi, craigt, skalinichev, klimek, milianw, bkramer
Subscribers: cfe-commits
Tags: #clang-c
Differential Revision: https://reviews.llvm.org/D18462
llvm-svn: 290172
Egor Churaev [Tue, 20 Dec 2016 09:15:21 +0000 (09:15 +0000)]
[OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand.
Summary: Enabling the compression of CLK_NULL_QUEUE to variable of type queue_t.
Reviewers: Anastasia
Subscribers: cfe-commits, yaxunl, bader
Differential Revision: https://reviews.llvm.org/D27569
llvm-svn: 290171
Serge Pavlov [Tue, 20 Dec 2016 08:48:51 +0000 (08:48 +0000)]
Fix build with expensive checks enabled
Include of llvm/IR/Verifier.h was removed from HexagonCommonGEP.cpp in r289604
as unused. In fact it is required when expensive checks are enabled, because
it declared function `verifyFunction`, which is called in conditionally compiled
part of the file.
llvm-svn: 290170
Chandler Carruth [Tue, 20 Dec 2016 08:28:19 +0000 (08:28 +0000)]
Revert r290149: Add the alloc_size attribute to clang.
This commit fails MSan when running test/CodeGen/object-size.c in
a confusing way. After some discussion with George, it isn't really
clear what is going on here. We can make the MSan failure go away by
testing for the invalid bit, but *why* things are invalid isn't clear.
And yet, other code in the surrounding area is doing precisely this and
testing for invalid.
George is going to take a closer look at this to better understand the
nature of the failure and recommit it, for now backing it out to clean
up MSan builds.
llvm-svn: 290169
Boris Ulasevich [Tue, 20 Dec 2016 08:09:50 +0000 (08:09 +0000)]
Bug 30863 - Step doesn't stop with coditional breakpoint on the next line
Fixed by additional completed plans detection, and applying them on breakpoint condition fail.
Thread::GetStopInfo reworked. New test added.
Review https://reviews.llvm.org/D26497
Many thanks to Jim
llvm-svn: 290168
Dimitry Andric [Tue, 20 Dec 2016 07:58:49 +0000 (07:58 +0000)]
Fix build breakage on FreeBSD after rL289878/rL289881
Summary:
After rL289878/rL289881, the build on FreeBSD is broken, because
sanitizer_platform_limits_posix.cc attempts to include <utmp.h> and use
`struct utmp`, neither of which are supported anymore on FreeBSD.
Fix this by adding `&& !SANITIZER_FREEBSD` in a few places, and stop
intercepting utmp functions altogether for FreeBSD.
Reviewers: kubabrecka, emaste, eugenis, ed
Subscribers: ed, llvm-commits
Differential Revision: https://reviews.llvm.org/D27902
llvm-svn: 290167
Richard Smith [Tue, 20 Dec 2016 07:24:53 +0000 (07:24 +0000)]
Add test for DR692.
llvm-svn: 290166
Rui Ueyama [Tue, 20 Dec 2016 05:49:56 +0000 (05:49 +0000)]
Remove extraneous space.
llvm-svn: 290165
Rui Ueyama [Tue, 20 Dec 2016 05:47:55 +0000 (05:47 +0000)]
Remove `Compressed` member from InputSectionData.
This value is used only once, and we can compute a value.
So we don't need to save it.
llvm-svn: 290164
Jason Molenda [Tue, 20 Dec 2016 04:54:04 +0000 (04:54 +0000)]
Change the timeout in CallBoardSystemServiceOpenApplication to
30 seconds to match the old springboard timeout; the launcher
should time out before that and we will hopefully get back
an informative error message instead of timing out ourselves.
llvm-svn: 290163
Chandler Carruth [Tue, 20 Dec 2016 03:32:17 +0000 (03:32 +0000)]
[PM] Rework a loop in the CGSCC update logic to be more conservative and
clear. The current RefSCC can occur in exactly one position so we should
just enforce that and leverage the property rather than checking for it
anywhere.
This addresses review comments made on another patch.
llvm-svn: 290162
Chandler Carruth [Tue, 20 Dec 2016 03:15:32 +0000 (03:15 +0000)]
[PM] Provide an initial, minimal port of the inliner to the new pass manager.
This doesn't implement *every* feature of the existing inliner, but
tries to implement the most important ones for building a functional
optimization pipeline and beginning to sort out bugs, regressions, and
other problems.
Notable, but intentional omissions:
- No alloca merging support. Why? Because it isn't clear we want to do
this at all. Active discussion and investigation is going on to remove
it, so for simplicity I omitted it.
- No support for trying to iterate on "internally" devirtualized calls.
Why? Because it adds what I suspect is inappropriate coupling for
little or no benefit. We will have an outer iteration system that
tracks devirtualization including that from function passes and
iterates already. We should improve that rather than approximate it
here.
- Optimization remarks. Why? Purely to make the patch smaller, no other
reason at all.
The last one I'll probably work on almost immediately. But I wanted to
skip it in the initial patch to try to focus the change as much as
possible as there is already a lot of code moving around and both of
these *could* be skipped without really disrupting the core logic.
A summary of the different things happening here:
1) Adding the usual new PM class and rigging.
2) Fixing minor underlying assumptions in the inline cost analysis or
inline logic that don't generally hold in the new PM world.
3) Adding the core pass logic which is in essence a loop over the calls
in the nodes in the call graph. This is a bit duplicated from the old
inliner, but only a handful of lines could realistically be shared.
(I tried at first, and it really didn't help anything.) All told,
this is only about 100 lines of code, and most of that is the
mechanics of wiring up analyses from the new PM world.
4) Updating the LazyCallGraph (in the new PM) based on the *newly
inlined* calls and references. This is very minimal because we cannot
form cycles.
5) When inlining removes the last use of a function, eagerly nuking the
body of the function so that any "one use remaining" inline cost
heuristics are immediately refined, and queuing these functions to be
completely deleted once inlining is complete and the call graph
updated to reflect that they have become dead.
6) After all the inlining for a particular function, updating the
LazyCallGraph and the CGSCC pass manager to reflect the
function-local simplifications that are done immediately and
internally by the inline utilties. These are the exact same
fundamental set of CG updates done by arbitrary function passes.
7) Adding a bunch of test cases to specifically target CGSCC and other
subtle aspects in the new PM world.
Many thanks to the careful review from Easwaran and Sanjoy and others!
Differential Revision: https://reviews.llvm.org/D24226
llvm-svn: 290161
Rui Ueyama [Tue, 20 Dec 2016 03:12:28 +0000 (03:12 +0000)]
Fix a bug that the glob pattern parser falls in an infinite loop for invalid patterns.
llvm-svn: 290160
Chandler Carruth [Tue, 20 Dec 2016 02:43:58 +0000 (02:43 +0000)]
Fix the spelling of 'bitfield' in diagnostics to be consistently 'bit-field'.
The latter agrees with most existing diagnostics and the C and C++ standards.
Differential Revision: https://reviews.llvm.org/D26530
llvm-svn: 290159
Adrian Prantl [Tue, 20 Dec 2016 02:33:30 +0000 (02:33 +0000)]
Reapply r289926: attempt to fix windows build
llvm-svn: 290158
Rui Ueyama [Tue, 20 Dec 2016 02:17:24 +0000 (02:17 +0000)]
Set Config->ColorDiagnostics early so that all error messages are colored.
Previously, some errors that were checked before we set to
Config->ColorDiagnostics weren't colored. This patch moves the code
to set the variable so that such error messages are colored just like
other error messages.
llvm-svn: 290157
Akira Hatanaka [Tue, 20 Dec 2016 02:11:29 +0000 (02:11 +0000)]
[Parser] Correct typo after lambda capture initializer is parsed.
This patch fixes an assertion that is triggered when RecordLayoutBuilder
tries to compute the size of a field (for capture "name" in the test
case) whose type hasn't been deduced. The patch fixes the bug by
correcting the typo of the capture initializer after the initializer is
parsed and before setting the expression for the annotation token.
Fixes PR30566.
rdar://problem/
23380132
Differential Revision: https://reviews.llvm.org/D25206
llvm-svn: 290156
Adrian Prantl [Tue, 20 Dec 2016 02:10:02 +0000 (02:10 +0000)]
Update for LLVM global variable debug info API change.
This reapplies r289921.
llvm-svn: 290155
Adrian Prantl [Tue, 20 Dec 2016 02:09:59 +0000 (02:09 +0000)]
Fix debug info metadata for upstream change in LLVM.
llvm-svn: 290154
Adrian Prantl [Tue, 20 Dec 2016 02:09:43 +0000 (02:09 +0000)]
[IR] Remove the DIExpression field from DIGlobalVariable.
This patch implements PR31013 by introducing a
DIGlobalVariableExpression that holds a pair of DIGlobalVariable and
DIExpression.
Currently, DIGlobalVariables holds a DIExpression. This is not the
best way to model this:
(1) The DIGlobalVariable should describe the source level variable,
not how to get to its location.
(2) It makes it unsafe/hard to update the expressions when we call
replaceExpression on the DIGLobalVariable.
(3) It makes it impossible to represent a global variable that is in
more than one location (e.g., a variable with multiple
DW_OP_LLVM_fragment-s). We also moved away from attaching the
DIExpression to DILocalVariable for the same reasons.
This reapplies r289902 with additional testcase upgrades and a change
to the Bitcode record for DIGlobalVariable, that makes upgrading the
old format unambiguous also for variables without DIExpressions.
<rdar://problem/
29250149>
https://llvm.org/bugs/show_bug.cgi?id=31013
Differential Revision: https://reviews.llvm.org/D26769
llvm-svn: 290153
Chandler Carruth [Tue, 20 Dec 2016 01:57:31 +0000 (01:57 +0000)]
Make this REQUIRES match the other REQUIRES lines that mention requiring
a darwin system.
llvm-svn: 290152
Rui Ueyama [Tue, 20 Dec 2016 01:51:08 +0000 (01:51 +0000)]
Simplify type of Config->SymbolOrderingFile.
That variable was of type DenseMap<StringRef, unsigned>, but the
unsigned numbers needed to be monotonicly increasing numbers because
the implementation that used the variable depended on that fact.
That was an implementation detail and shouldn't have leaked into Config.
This patch simplifies its type to std::vector<StringRef>.
llvm-svn: 290151
Rui Ueyama [Tue, 20 Dec 2016 01:34:31 +0000 (01:34 +0000)]
Inline a small function.
llvm-svn: 290150
George Burgess IV [Tue, 20 Dec 2016 01:05:42 +0000 (01:05 +0000)]
Add the alloc_size attribute to clang.
This patch does three things:
- Gives us the alloc_size attribute in clang, which lets us infer the
number of bytes handed back to us by malloc/realloc/calloc/any user
functions that act in a similar manner.
- Teaches our constexpr evaluator that evaluating some `const` variables
is OK sometimes. This is why we have a change in
test/SemaCXX/constant-expression-cxx11.cpp and other seemingly
unrelated tests. Richard Smith okay'ed this idea some time ago in
person.
- Uniques some Blocks in CodeGen, which was reviewed separately at
D26410. Lack of uniquing only really shows up as a problem when
combined with our new eagerness in the face of const.
Differential Revision: https://reviews.llvm.org/D14274
llvm-svn: 290149
Chris Bieneman [Tue, 20 Dec 2016 00:42:06 +0000 (00:42 +0000)]
Revert "[ObjectYAML] Support for DWARF debug_info section"
This reverts commit r290147.
This commit is breaking a bot (http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/621). I don't have time to investigate at the moment, so I'll revert for now.
llvm-svn: 290148
Chris Bieneman [Tue, 20 Dec 2016 00:26:24 +0000 (00:26 +0000)]
[ObjectYAML] Support for DWARF debug_info section
This patch adds support for YAML<->DWARF for debug_info sections.
llvm-svn: 290147
Richard Smith [Mon, 19 Dec 2016 23:59:34 +0000 (23:59 +0000)]
Fix completely bogus types for some builtins:
* In C++, never create a FunctionNoProtoType for a builtin (fixes C++1z
crasher from r289754).
* Fix type of __sync_synchronize to be a no-parameter function rather than a
varargs function. This matches GCC.
* Fix type of vfprintf to match its actual type. We gave it a wrong type due
to PR4290 (apparently autoconf generates invalid code and expects compilers
to choke it down or it miscompiles the program; the relevant error in clang
was downgraded to a warning in r122744 to fix other occurrences of this
autoconf brokenness, so we don't need this workaround any more).
* Turn off vararg argument checking for __noop, since it's not *really* a
varargs function. Alternatively we could add custom type checking for it
and synthesize parameter types matching the actual arguments in each call,
but that seemed like overkill.
llvm-svn: 290146
Paul Robinson [Mon, 19 Dec 2016 23:32:10 +0000 (23:32 +0000)]
Make another test insensitive to the default C++ dialect.
Differential Revision: http://reviews.llvm.org/D27955
llvm-svn: 290145
Eli Friedman [Mon, 19 Dec 2016 23:09:51 +0000 (23:09 +0000)]
Add ARM support to update_llc_test_checks.py
Just the minimal support to get it working at the moment.
Includes checks for test/CodeGen/ARM/vzip.ll as an example.
Differential Revision: https://reviews.llvm.org/D27829
llvm-svn: 290144
Devin Coughlin [Mon, 19 Dec 2016 22:50:31 +0000 (22:50 +0000)]
[analyzer] Add checker modeling gtest APIs.
gtest is a widely-used unit-testing API. It provides macros for unit test
assertions:
ASSERT_TRUE(p != nullptr);
that expand into an if statement that constructs an object representing
the result of the assertion and returns when the assertion is false:
if (AssertionResult gtest_ar_ = AssertionResult(p == nullptr))
;
else
return ...;
Unfortunately, the analyzer does not model the effect of the constructor
precisely because (1) the copy constructor implementation is missing from the
the header (so it can't be inlined) and (2) the boolean-argument constructor
is constructed into a temporary (so the analyzer decides not to inline it since
it doesn't reliably call temporary destructors right now).
This results in false positives because the analyzer does not realize that the
the assertion must hold along the non-return path.
This commit addresses the false positives by explicitly modeling the effects
of the two un-inlined constructors on the AssertionResult state.
I've added a new package, "apiModeling", for these kinds of checkers that
model APIs but don't emit any diagnostics. I envision all the checkers in
this package always being on by default.
This addresses the false positives reported in PR30936.
Differential Revision: https://reviews.llvm.org/D27773
rdar://problem/
22705813
llvm-svn: 290143
Michael Kuperstein [Mon, 19 Dec 2016 22:47:52 +0000 (22:47 +0000)]
[LV] Sink tripcount query to where it's actually used. NFC.
llvm-svn: 290142
Jordan Rose [Mon, 19 Dec 2016 22:35:24 +0000 (22:35 +0000)]
Don't try to emit nullability fix-its within/around macros.
The newly-added notes from r290132 are too noisy even when the fix-it
is valid. For the existing warning from r286521, it's probably the
right decision 95% of the time to put the change outside the macro if
the array is outside the macro and inside otherwise, but I don't want
to overthink it right now.
Caught by the ASan bot!
More rdar://problem/
29524992
llvm-svn: 290141
Devin Coughlin [Mon, 19 Dec 2016 22:23:22 +0000 (22:23 +0000)]
[analyzer] Add sink after construction of temporary with no-return destructor.
The analyzer's CFG currently doesn't have nodes for calls to temporary
destructors. This causes the analyzer to explore infeasible paths in which
a no-return destructor would have stopped exploration and so results in false
positives when no-return destructors are used to implement assertions.
To mitigate these false positives, this patch stops generates a sink after
evaluating a constructor on a temporary object that has a no-return destructor.
This results in a loss of coverage because the time at which the destructor is
called may be after the time of construction (especially for lifetime-extended
temporaries).
This addresses PR15599.
rdar://problem/
29131566
llvm-svn: 290140
Chris Bieneman [Mon, 19 Dec 2016 22:22:12 +0000 (22:22 +0000)]
[ObjectYAML] Support for DWARF Pub Sections
This patch adds support for YAML<->DWARF round tripping for pub* section data. The patch supports both GNU and non-GNU style entries.
llvm-svn: 290139
Mike Aizatsky [Mon, 19 Dec 2016 22:18:08 +0000 (22:18 +0000)]
[libfuzzer] dump_coverage command line flag
Reviewers: kcc, vitalybuka
Differential Revision: https://reviews.llvm.org/D27942
llvm-svn: 290138
Jason Henline [Mon, 19 Dec 2016 21:34:07 +0000 (21:34 +0000)]
[Axccel] Remove -Wno-missing-braces in build
Summary:
I originally added the -Wno-missing-braces flag because I thought it was
erroneously flagging std::array initializations. Now I realize the extra
braces really are desired for these initializations, so I'm turning the
warning flag back on.
Reviewers: jlebar
Subscribers: mgorny, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D27941
llvm-svn: 290137
Rafael Espindola [Mon, 19 Dec 2016 21:21:07 +0000 (21:21 +0000)]
Fix corner cases of setting the section address.
This handles all the corner cases if setting a section address:
- If the address is too low, we cannot allocate the program headers.
- If the load address is lowered, we have to do that before finalize
This also shares some code with the linker script since it was already
hitting similar cases.
This is used by the freebsd boot loader. It is not clear if we need to
support this with a non binary output, but it is not as bad as I was
expecting.
llvm-svn: 290136
Benjamin Kramer [Mon, 19 Dec 2016 21:10:50 +0000 (21:10 +0000)]
[Format] Remove dead code.
No functionality change.
llvm-svn: 290135
Bruno Cardoso Lopes [Mon, 19 Dec 2016 21:06:06 +0000 (21:06 +0000)]
[ASTReader] Sort RawComments before merging
`RawComments` are sorted by comparing underlying `SourceLocation`'s. This is
done by comparing `FileID` and `Offset`; when the `FileID` is the same it means
the locations are within the same TU and the `Offset` is used.
FileID, from the source code: "A mostly-opaque identifier, where 0 is
"invalid", >0 is this module, and <-1 is something loaded from another
module.". That said, when de-serializing SourceLocations, FileID's from
RawComments loaded from other modules get negative IDs where previously they
were positive. This makes imported RawComments unsorted, leading to a wrong
merge with other comments from the current TU. Fix that by sorting RawComments
properly after de-serialization and before merge.
This fixes an assertion in `ASTContext::getRawCommentForDeclNoCache`,
which fires only in a debug build of clang.
Differential Revision: https://reviews.llvm.org/D27546
rdar://problem/
29287314
llvm-svn: 290134
Michael LeMay [Mon, 19 Dec 2016 21:02:41 +0000 (21:02 +0000)]
[TargetInstrInfo] replace redundant expression in getMemOpBaseRegImmOfs
Summary:
The expression for computing the return value of getMemOpBaseRegImmOfs has only
one possible value. The other value would result in a return earlier in the
function. This patch replaces the expression with its only possible value.
Reviewers: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27437
llvm-svn: 290133
Jordan Rose [Mon, 19 Dec 2016 20:58:20 +0000 (20:58 +0000)]
Add fix-it notes to the nullability consistency warning.
This is especially important for arrays, since no one knows the proper
syntax for putting qualifiers in arrays.
nullability.h:3:26: warning: array parameter is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
void arrayParameter(int x[]);
^
nullability.h:3:26: note: insert '_Nullable' if the array parameter may be null
void arrayParameter(int x[]);
^
_Nullable
nullability.h:3:26: note: insert '_Nonnull' if the array parameter should never be null
void arrayParameter(int x[]);
^
_Nonnull
rdar://problem/
29524992
llvm-svn: 290132
Greg Clayton [Mon, 19 Dec 2016 20:36:41 +0000 (20:36 +0000)]
Make a function to correctly extract the DW_AT_high_pc given the low pc value.
DWARF 4 and later supports encoding the PC as an address or as as offset from the low PC. Clients using DWARFDie should be insulated from how to extract the high PC value. This function takes care of extracting the form value and looking for the correct form.
Differential Revision: https://reviews.llvm.org/D27885
llvm-svn: 290131
Sean Callanan [Mon, 19 Dec 2016 19:15:43 +0000 (19:15 +0000)]
Reverting r290004, r290006, r290010 pending review.
llvm-svn: 290130
Kuba Mracek [Mon, 19 Dec 2016 18:54:34 +0000 (18:54 +0000)]
Fixup for r290119: Only run debug_alloc_stack.cc on Darwin until I figure out how to make it work on Linux.
llvm-svn: 290129
Paul Robinson [Mon, 19 Dec 2016 18:43:26 +0000 (18:43 +0000)]
Make a few OpenMP tests "C++11 clean."
This time trying to commit just the relevant 3 tests!
Reviewed by abataev (in D27794)
llvm-svn: 290128
Sanjay Patel [Mon, 19 Dec 2016 18:35:37 +0000 (18:35 +0000)]
[InstCombine] use commutative matcher for pattern with commutative operators
This is a case that was missed in:
https://reviews.llvm.org/rL290067
...and it would regress if we fix operand complexity (PR28296).
llvm-svn: 290127
Kuba Mracek [Mon, 19 Dec 2016 18:27:26 +0000 (18:27 +0000)]
More fixup for r290119: Make the ifdef work.
llvm-svn: 290126
Paul Robinson [Mon, 19 Dec 2016 18:20:19 +0000 (18:20 +0000)]
Revert another accidental bit
llvm-svn: 290125
Kuba Mracek [Mon, 19 Dec 2016 18:09:18 +0000 (18:09 +0000)]
Another fix-up for r290119: Include stdint.h so we have uint64_t on Linux.
llvm-svn: 290124
Kuba Mracek [Mon, 19 Dec 2016 18:06:49 +0000 (18:06 +0000)]
Fix-up for r290119 - don't check global size, it might not be available when using atos
llvm-svn: 290123
George Rimar [Mon, 19 Dec 2016 18:00:52 +0000 (18:00 +0000)]
[ELF] - Implemented --retain-symbols-file option
--retain-symbols-file=filename
Retain only the symbols listed in the file filename, discarding all others.
filename is simply a flat file, with one symbol name per line. This option
is especially useful in environments (such as VxWorks) where a large global
symbol table is accumulated gradually, to conserve run-time memory.
Note: though documentation says "--retain-symbols-file does not discard
undefined symbols, or symbols needed for relocations.", both bfd and gold
do that, and this patch too, like testcase show.
Differential revision: https://reviews.llvm.org/D27716
llvm-svn: 290122
Paul Robinson [Mon, 19 Dec 2016 18:00:45 +0000 (18:00 +0000)]
Undo accidental comit
llvm-svn: 290121
Paul Robinson [Mon, 19 Dec 2016 17:58:09 +0000 (17:58 +0000)]
Make a few OpenMP tests "C++11 clean."
Reviewed by abataev (in D27794)
llvm-svn: 290120
Kuba Mracek [Mon, 19 Dec 2016 17:52:20 +0000 (17:52 +0000)]
[tsan] Implement __tsan_get_alloc_stack and __tsan_locate_address to query pointer types and allocation stacks of heap pointers
In ASan, we have __asan_locate_address and __asan_get_alloc_stack, which is used in LLDB/Xcode to show the allocation backtrace for a heap memory object. This patch implements the same for TSan.
Differential Revision: https://reviews.llvm.org/D27656
llvm-svn: 290119
Sanjay Patel [Mon, 19 Dec 2016 17:32:37 +0000 (17:32 +0000)]
[InstCombine] add folds for icmp (umin|umax X, Y), X
This is a follow-up to:
https://reviews.llvm.org/rL289855 (https://reviews.llvm.org/D27531)
https://reviews.llvm.org/rL290111
llvm-svn: 290118
Luke Drummond [Mon, 19 Dec 2016 17:22:44 +0000 (17:22 +0000)]
Expression evaluation for overloaded C functions (redux)
This is a redux of [Ewan's patch](https://reviews.llvm.org/D17957) , refactored
to properly substitute primitive types using a hook in the itanium demangler,
and updated after the previous patch went stale
The new `SubsPrimitiveParmItanium` function takes a symbol name and replacement
primitive type parameter as before but parses it using the FastDemangler, which
has been modified to be able to notify clients of parse events (primitive types
at this point).
Additionally, we now use a `set` of `ConstStrings` instead of a `vector` so
that we don't try and resolve the same invalid candidate multiple times.
Differential Revision: https://reviews.llvm.org/D27223
Subscribers: lldb-commits
llvm-svn: 290117
Florian Hahn [Mon, 19 Dec 2016 17:13:37 +0000 (17:13 +0000)]
[LoopVersioning] Require loop-simplify form for loop versioning.
Summary:
Requiring loop-simplify form for loop versioning ensures that the
runtime check block always dominates the exit block.
This patch closes #30958 (https://llvm.org/bugs/show_bug.cgi?id=30958).
Reviewers: silviu.baranga, hfinkel, anemet, ashutosh.nema
Subscribers: ashutosh.nema, mzolotukhin, efriedma, hfinkel, llvm-commits
Differential Revision: https://reviews.llvm.org/D27469
llvm-svn: 290116
Rafael Espindola [Mon, 19 Dec 2016 17:01:01 +0000 (17:01 +0000)]
Detemplate PhdrEntry. NFC.
llvm-svn: 290115
Konstantin Zhuravlyov [Mon, 19 Dec 2016 16:54:24 +0000 (16:54 +0000)]
[AMDGPU] When unifying metadata, add operands to named metadata individually
Differential Revision: https://reviews.llvm.org/D27725
llvm-svn: 290114
NAKAMURA Takumi [Mon, 19 Dec 2016 16:50:43 +0000 (16:50 +0000)]
[libclang] Revert part of r290025, "Remove the 'extern "C"' blocks from the implementation files."
mingw32-ld complains missing symbols in exports,
Cannot export clang_findIncludesInFileWithBlock: symbol not defined
Cannot export clang_findReferencesInFileWithBlock: symbol not defined
Cannot export clang_visitChildrenWithBlock: symbol not defined
They are excluded conditionally in header along has_blocks.
We should do either;
1. Exclude also function bodies conditionally, and introduce "optional" exporter.
2. Give dummy function bodies for them.
3. Implement functions w/o blocks.
llvm-svn: 290113
Rafael Espindola [Mon, 19 Dec 2016 16:50:20 +0000 (16:50 +0000)]
Use existing variable. NFC.
llvm-svn: 290112
Sanjay Patel [Mon, 19 Dec 2016 16:28:53 +0000 (16:28 +0000)]
[InstCombine] add folds for icmp (smax X, Y), X
This is a follow-up to:
https://reviews.llvm.org/rL289855 (D27531)
llvm-svn: 290111
Prakhar Bahuguna [Mon, 19 Dec 2016 15:43:33 +0000 (15:43 +0000)]
[ARM] Add missing -backend-option for -arm-execute-only
llvm-svn: 290110