Vedant Kumar [Thu, 3 Nov 2016 06:35:16 +0000 (06:35 +0000)]
[Sema] Remove a dead assignment, NFC.
The assignment to NextIsDereference is either followed by (1) another,
unrelated assignment to NextIsDereference or by (2) an early loop exit.
Found by clang's static analyzer: http://llvm.org/reports/scan-build
(While we're at it fix a typo.)
llvm-svn: 285879
Craig Topper [Thu, 3 Nov 2016 06:04:28 +0000 (06:04 +0000)]
[AVX-512] Use 'vnot' instead of 'not' in patterns involving vXi1 vectors.
This fixes selection of KANDN instructions and allows us to remove an extra set of patterns for KNOT and KXNOR.
Reviewers: delena, igorb
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26134
llvm-svn: 285878
Elena Demikhovsky [Thu, 3 Nov 2016 03:23:55 +0000 (03:23 +0000)]
Expandload and Compressstore intrinsics
2 new intrinsics covering AVX-512 compress/expand functionality.
This implementation includes syntax, DAG builder, operation lowering and tests.
Does not include: handling of illegal data types, codegen prepare pass and the cost model.
llvm-svn: 285876
Rafael Espindola [Thu, 3 Nov 2016 02:28:13 +0000 (02:28 +0000)]
Pass the sections to getShtGroupSignature.
This avoids fetching it again from the object.
llvm-svn: 285875
Rafael Espindola [Thu, 3 Nov 2016 02:24:59 +0000 (02:24 +0000)]
Split getSection in two.
This will allow avoiding repeated error checking in a few cases.
llvm-svn: 285874
George Burgess IV [Thu, 3 Nov 2016 02:21:43 +0000 (02:21 +0000)]
[CodeGen] Use StringRef. NFC.
Looks like CurFn's name outlives FunctionName, so we can just pass
StringRefs around rather than going from a StringRef to a std::string
to a const char* to a StringRef.
llvm-svn: 285873
Eric Fiselier [Thu, 3 Nov 2016 02:13:17 +0000 (02:13 +0000)]
[Sema] Allow static_cast<T&&>(e) to check explicit conversions for non-reference-related types.
Summary:
[expr.cast.static] states:
> 3. A glvalue of type “cv1 T1” can be cast to type “rvalue reference to cv2 T2” if “cv2 T2” is reference-compatible
> with “cv1 T1”. The result refers to the object or the specified base class subobject thereof. If T2 is
> an inaccessible or ambiguous base class of T1, a program that necessitates such a cast is
> ill-formed.
>
> 4. Otherwise, an expression e can be explicitly converted to a type T using a static_cast of the form static_-
> cast<T>(e) if the declaration T t(e); is well-formed, for some invented temporary variable t. [...]
Currently when checking p3 Clang will diagnose `static_cast<T&&>(e)` as invalid if the argument is not reference compatible with `T`. However I believe the correct behavior is to also check p4 in those cases. For example:
```
double y = 42;
static_cast<int&&>(y); // this should be OK. 'int&& t(y)' is well formed
```
Note that we still don't check p4 for non-reference-compatible types which are reference-related since `T&& t(e);` should never be well formed in those cases.
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26231
llvm-svn: 285872
Teresa Johnson [Thu, 3 Nov 2016 01:07:16 +0000 (01:07 +0000)]
[ThinLTO] Handle distributed backend case when doing renaming
Summary:
The recent change I made to consult the summary when deciding whether to
rename (to handle inline asm) in r285513 broke the distributed build
case. In a distributed backend we will only have a portion of the
combined index, specifically for imported modules we only have the
summaries for any imported definitions. When renaming on import we were
asserting because no summary entry was found for a local reference being
linked in (def wasn't imported).
We only need to consult the summary for a renaming decision for the
exporting module. For imports, we would have prevented importing any
references to NoRename values already.
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26250
llvm-svn: 285871
Richard Smith [Thu, 3 Nov 2016 00:27:54 +0000 (00:27 +0000)]
Update manglings for C++17 noexcept function types to match Jason Merrill's
proposal on cxx-abi-dev earlier today.
llvm-svn: 285870
Richard Smith [Wed, 2 Nov 2016 23:57:18 +0000 (23:57 +0000)]
Teach clang-query to dump types. I couldn't find any existing tests for clang-query's dumping functionality. =(
llvm-svn: 285869
Argyrios Kyrtzidis [Wed, 2 Nov 2016 23:42:33 +0000 (23:42 +0000)]
[index] Fix assertion hit when handling a declaration of C++'s 'operator new' function.
Part of this is to allow creating a USR for the canonical decl of that which is implicit and does
not have a source location.
rdar://
28978992
llvm-svn: 285868
Richard Smith [Wed, 2 Nov 2016 23:41:51 +0000 (23:41 +0000)]
[p0012] Implement ABI support for throwing a noexcept function pointer and
catching as non-noexcept
This implements the following proposal from cxx-abi-dev:
http://sourcerytools.com/pipermail/cxx-abi-dev/2016-October/002988.html
... which is necessary for complete support of http://wg21.link/p0012,
specifically throwing noexcept function and member function pointers and
catching them as non-noexcept pointers.
Differential Review: https://reviews.llvm.org/D26178
llvm-svn: 285867
Greg Bedwell [Wed, 2 Nov 2016 23:17:05 +0000 (23:17 +0000)]
Revert "[InstCombine] allow splat vector folds in adjustMinMax()"
This reverts commit r285732.
This change introduced a new assertion failure in the following
testcase at -O2:
typedef short __v8hi __attribute__((__vector_size__(16)));
__v8hi foo(__v8hi &V1, __v8hi &V2, unsigned mask) {
__v8hi Result = V1;
if (mask & 0x80)
Result[0] = V2[0];
return Result;
}
llvm-svn: 285866
Michal Gorny [Wed, 2 Nov 2016 22:57:23 +0000 (22:57 +0000)]
[cmake] Build gtest from LLVM when building standalone
Include the gtest utility directory from LLVM sources when performing
a stand-alone build of LLDB. This is necessary to have a correct gtest
library to link tests against, as the one used by LLVM is not installed
(and not supposed to be). This is the same approach as used in clang.
Differential Revision: https://reviews.llvm.org/D26245
llvm-svn: 285865
Eli Friedman [Wed, 2 Nov 2016 22:32:23 +0000 (22:32 +0000)]
[Polly CodeGen] Break critical edge from RTC to original loop.
This makes polly generate a CFG which is closer to what we want
in LLVM IR, with a loop preheader for the original loop. This is
just a cleanup, but it exposes some fragile assumptions.
I'm not completely happy with the changes related to expandCodeFor;
RTCBB->getTerminator() is basically a random insertion point which
happens to work due to the way we generate runtime checks. I'm not
sure what the right answer looks like, though.
Differential Revision: https://reviews.llvm.org/D26053
llvm-svn: 285864
Rafael Espindola [Wed, 2 Nov 2016 21:39:02 +0000 (21:39 +0000)]
Simplify some typedefs. NFC.
llvm-svn: 285863
Adrian McCarthy [Wed, 2 Nov 2016 21:30:35 +0000 (21:30 +0000)]
Emit S_COMPILE3 record once per TU rather than once per function
This has some ripple effects in several tests.
llvm-svn: 285862
Malcolm Parsons [Wed, 2 Nov 2016 21:14:22 +0000 (21:14 +0000)]
[clang-tidy] Suppress notes for warnings that were ignored
Fixes PR30565.
Patch by Nikita Kakuev
llvm-svn: 285861
Kevin Enderby [Wed, 2 Nov 2016 21:08:39 +0000 (21:08 +0000)]
Add the rest of the additional error checks for invalid Mach-O files when
the offsets and sizes of an element of the Mach-O file overlaps with
another element in the Mach-O file.
Some other tests for malformed Mach-O files now run into these
checks so their tests were also adjusted.
llvm-svn: 285860
Davide Italiano [Wed, 2 Nov 2016 21:05:42 +0000 (21:05 +0000)]
[RuntimeDyld] Move an X86 only test to the correct directory.
This is an attempt to placate the bots after r285841.
llvm-svn: 285859
Dawn Perchik [Wed, 2 Nov 2016 20:57:34 +0000 (20:57 +0000)]
Fix typo which broke debugging on older OSX systems after r285172.
Reviewed by: jasonmolenda
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D26260
llvm-svn: 285858
Eli Friedman [Wed, 2 Nov 2016 20:48:11 +0000 (20:48 +0000)]
DCE math library calls with a constant operand.
On platforms which use -fmath-errno, math libcalls without any uses
require some extra checks to figure out if they are actually dead.
Fixes https://llvm.org/bugs/show_bug.cgi?id=30464 .
Differential Revision: https://reviews.llvm.org/D25970
llvm-svn: 285857
Jordan Rose [Wed, 2 Nov 2016 20:44:07 +0000 (20:44 +0000)]
Don't require nullability on template parameters in typedefs.
Previously the following code would warn on the use of "T":
template <typename T>
struct X {
typedef T *type;
};
...because nullability is /allowed/ on template parameters (because
they could be pointers). (Actually putting nullability on this use of
'T' will of course break if the argument is a non-pointer type.)
This fix doesn't handle the case where a template parameter is used
/outside/ of a typedef. That seems trickier, especially in parameter
position.
llvm-svn: 285856
Malcolm Parsons [Wed, 2 Nov 2016 20:34:10 +0000 (20:34 +0000)]
Fix Clang-tidy readability-redundant-string-cstr warnings
Reviewers: zturner, labath
Subscribers: tberghammer, danalbert, lldb-commits
Differential Revision: https://reviews.llvm.org/D26233
llvm-svn: 285855
Rui Ueyama [Wed, 2 Nov 2016 19:51:41 +0000 (19:51 +0000)]
Fix Windows buildbot.
llvm-svn: 285854
Vedant Kumar [Wed, 2 Nov 2016 19:44:13 +0000 (19:44 +0000)]
[llvm-cov] Turn line numbers in html reports into clickable links
llvm-svn: 285853
Artem Dergachev [Wed, 2 Nov 2016 19:35:20 +0000 (19:35 +0000)]
[analyzer] StdLibraryFunctions: provide platform-specific function summaries.
Because standard functions can be defined differently on different platforms,
this commit introduces a method for constructing summaries with multiple
variants, whichever matches better. It is also useful for supporting overloads.
Differential Revision: https://reviews.llvm.org/D25940
llvm-svn: 285852
Rui Ueyama [Wed, 2 Nov 2016 18:58:44 +0000 (18:58 +0000)]
Convert Out::InterpSection to In::InterpSection.
Differential Revision: https://reviews.llvm.org/D26225
llvm-svn: 285851
Rui Ueyama [Wed, 2 Nov 2016 18:42:13 +0000 (18:42 +0000)]
Reduce number of classes by merging DIHelper with ObjectFile.
DIHelper is a class having only one member, and ObjectFile has
a unique pointer to a DIHelper. So we can directly have ObjectFile
have the member.
Differential Revision: https://reviews.llvm.org/D26223
llvm-svn: 285850
Erich Keane [Wed, 2 Nov 2016 18:29:35 +0000 (18:29 +0000)]
regcall: Implement regcall Calling Conv in clang
This patch implements the register call calling convention, which ensures
as many values as possible are passed in registers. CodeGen changes
were committed in https://reviews.llvm.org/rL284108.
Differential Revision: https://reviews.llvm.org/D25204
llvm-svn: 285849
Eugene Zelenko [Wed, 2 Nov 2016 18:23:52 +0000 (18:23 +0000)]
[Documentation] Fix Clang-tidy misc-use-after-move and cert-msc50-cpp style and misspelling.
llvm-svn: 285848
Pavel Labath [Wed, 2 Nov 2016 18:06:17 +0000 (18:06 +0000)]
Remove KQueue.cpp
Summary:
This class is unused.
Reviewers: clayborg
Subscribers: mgorny, modocache, lldb-commits
Differential Revision: https://reviews.llvm.org/D26237
llvm-svn: 285847
Krzysztof Parzyszek [Wed, 2 Nov 2016 17:59:54 +0000 (17:59 +0000)]
[Hexagon] Remove registers coalesced in expand-condsets from live intervals
llvm-svn: 285846
Marshall Clow [Wed, 2 Nov 2016 17:56:05 +0000 (17:56 +0000)]
Add support for old versions of MacOS to libunwind. Fixes PR22203. Thanks to Jeremy for the bug report and the patch.
llvm-svn: 285845
Artem Tamazov [Wed, 2 Nov 2016 17:45:58 +0000 (17:45 +0000)]
[AMDGPU][mc] Improve test of special asm symbols.
Test simplified. Coverage extended.
Differential Revision: https://reviews.llvm.org/D26198
llvm-svn: 285844
Zachary Turner [Wed, 2 Nov 2016 17:42:12 +0000 (17:42 +0000)]
Fix crash in PseudoTerminal on Windows.
Patch by Rudy Pons
Differential Revision: https://reviews.llvm.org/D25681
llvm-svn: 285843
Martin Bohme [Wed, 2 Nov 2016 17:34:47 +0000 (17:34 +0000)]
[clang-tidy] Extend misc-use-after-move to support unique_ptr and shared_ptr.
Summary:
As a unique_ptr or shared_ptr that has been moved from is guaranteed to be null,
we only warn if the pointer is dereferenced.
Reviewers: hokein, alexfh, aaron.ballman
Subscribers: Prazek, cfe-commits
Differential Revision: https://reviews.llvm.org/D26041
llvm-svn: 285842
Davide Italiano [Wed, 2 Nov 2016 17:32:19 +0000 (17:32 +0000)]
[lli/COFF] Set the correct alignment for common symbols
Otherwise we set it always to zero, which is not correct,
and we assert inside alignTo (Assertion failed:
Align != 0u && "Align can't be 0.").
Differential Revision: https://reviews.llvm.org/D26173
llvm-svn: 285841
Matt Arsenault [Wed, 2 Nov 2016 17:24:54 +0000 (17:24 +0000)]
AMDGPU: Cleanup some xfailed tests
Some of these are already fixed or tested somewhere else.
llvm-svn: 285840
Chris Bieneman [Wed, 2 Nov 2016 17:19:26 +0000 (17:19 +0000)]
[CMake] Support LLDB_TEST_CLANG in check-lldb target(s)
This just hooks up the in-tree compiler to be optionally used when running the test suite.
llvm-svn: 285839
Chris Bieneman [Wed, 2 Nov 2016 17:19:23 +0000 (17:19 +0000)]
Find clang resource directory via *nix-style lookup
Summary:
This patch allows the Darwin build to fall back to to Posix-style lookups for the clang resource directory if the debugger library isn't inside a framework.
The patch also includes a bit of refactoring and cleanup around the *nix resolution of the binary and lib directories to reuse the code instead of duplicating it.
With this patch Darwin builds that don't build a framework only have 3 failing tests on my system (TestExec.py).
Reviewers: zturner, labath, spyffe, tfiala
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D26170
llvm-svn: 285838
Zachary Turner [Wed, 2 Nov 2016 17:10:55 +0000 (17:10 +0000)]
Fix build due to missing definition.
llvm-svn: 285837
Zachary Turner [Wed, 2 Nov 2016 17:05:19 +0000 (17:05 +0000)]
Add CodeViewRecordIO for reading and writing.
Using a pattern similar to that of YamlIO, this allows
us to have a single codepath for translating codeview
records to and from serialized byte streams. The
current patch only hooks this up to the reading of
CodeView type records. A subsequent patch will hook
it up for writing of CodeView type records, and then a
third patch will hook up the reading and writing of
CodeView symbols.
Differential Revision: https://reviews.llvm.org/D26040
llvm-svn: 285836
Nicolai Haehnle [Wed, 2 Nov 2016 17:03:11 +0000 (17:03 +0000)]
AMDGPU: Allow additional implicit operands on MOVRELS instructions
Summary:
The post-RA scheduler occasionally uses additional implicit operands when
the vector implicit operand as a whole is killed, but some subregisters
are still live because they are directly referenced later. Unfortunately,
this seems incredibly subtle to reproduce.
Fixes piglit spec/glsl-110/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test
and others.
Reviewers: arsenm, tstellarAMD
Subscribers: kzhuravl, wdng, yaxunl, tony-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D25656
llvm-svn: 285835
Zachary Turner [Wed, 2 Nov 2016 16:59:42 +0000 (16:59 +0000)]
Fix some warnings compiling with clang-cl on Windows.
llvm-svn: 285834
Andrey Churbanov [Wed, 2 Nov 2016 16:45:25 +0000 (16:45 +0000)]
Change task stealing to always get task from head of victim's deque.
Differential Revision: https://reviews.llvm.org/D26187
llvm-svn: 285833
Malcolm Parsons [Wed, 2 Nov 2016 16:43:50 +0000 (16:43 +0000)]
Fix Clang-tidy readability-redundant-string-cstr warnings
Reviewers: beanz, lattner, jlebar
Subscribers: jholewinski, llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D26235
llvm-svn: 285832
Marshall Clow [Wed, 2 Nov 2016 16:39:55 +0000 (16:39 +0000)]
Add conditions for PPC to libunwind. Fixes PR22200. Thanks to Jeremy for the bug report and the patch.
llvm-svn: 285831
Nirav Dave [Wed, 2 Nov 2016 16:22:51 +0000 (16:22 +0000)]
[ARM][MC] Cleanup ARM Target Assembly Parser
Summary:
Correctly parse end-of-statement tokens and handle preprocessor
end-of-line comments in ARM assembly processor.
Reviewers: rnk, majnemer
Subscribers: aemerson, rengolin, llvm-commits
Differential Revision: https://reviews.llvm.org/D26152
llvm-svn: 285830
Adrian Prantl [Wed, 2 Nov 2016 16:20:37 +0000 (16:20 +0000)]
Improve and cleanup comments in DwarfExpression.h
llvm-svn: 285829
Matt Arsenault [Wed, 2 Nov 2016 16:18:29 +0000 (16:18 +0000)]
BranchRelaxation: Fix computing indirect branch block size
llvm-svn: 285828
Adrian Prantl [Wed, 2 Nov 2016 16:12:20 +0000 (16:12 +0000)]
Simplify control flow in the the DWARF expression compiler
by refactoring common code into a DwarfExpressionCursor wrapper.
llvm-svn: 285827
Adrian Prantl [Wed, 2 Nov 2016 16:12:16 +0000 (16:12 +0000)]
Emit DW_OP_piece also if the previous value was a constant.
This fixes a bug in the DWARF backend.
llvm-svn: 285826
Alex Lorenz [Wed, 2 Nov 2016 16:11:30 +0000 (16:11 +0000)]
Simplify the test case from r285289.
This commit simplifies and clarifies the test code
that was added in r285289.
Suggested by David Blaikie.
llvm-svn: 285825
George Rimar [Wed, 2 Nov 2016 16:06:00 +0000 (16:06 +0000)]
[ELF] - Allow "-Ttext xxx", "-Tbss xxx", "-Tdata bss" commandline.
So patch just defines an alias for -Txxx=YYY forms,
this is consistent with ld and should fix PR30814.
llvm-svn: 285824
Alex Lorenz [Wed, 2 Nov 2016 15:46:34 +0000 (15:46 +0000)]
Add a note that points to the linkage specifier for the C++ linkage errors
This commit improves the "must have C++ linkage" error diagnostics that are
emitted for C++ declarations like templates and literal operators by adding an
additional note that points to the appropriate extern "C" linkage specifier.
rdar://
19021120
Differential Revision: https://reviews.llvm.org/D26189
llvm-svn: 285823
Simon Pilgrim [Wed, 2 Nov 2016 15:41:15 +0000 (15:41 +0000)]
Use !operator to test if APInt is zero/non-zero. NFCI.
Avoids APInt construction and slower comparisons.
llvm-svn: 285822
Reid Kleckner [Wed, 2 Nov 2016 15:39:08 +0000 (15:39 +0000)]
[asan] Add more dynamic CRT mode tests
Only tests using %clang_cl_asan were using the dynamic CRT before this.
The unit tests and lit tests using %clangxx_asan were using the static
CRT. Many cross-platform tests fail with the dynamic CRT, so I had to
add win32-(static|dynamic)-asan lit features.
Also deletes some redundant tests in TestCases/Windows that started
failing with this switch.
llvm-svn: 285821
Reid Kleckner [Wed, 2 Nov 2016 15:38:51 +0000 (15:38 +0000)]
[asan] Use the dynamic ASan runtime if -shared-libasan is passed
-shared-libasan is likely to be used as a link flag if the user is using
the GCC-style clang driver.
This logic is already tested in clang-cl tests, and the new flag to
exercise it will be covered by asan tests.
llvm-svn: 285820
Rafael Espindola [Wed, 2 Nov 2016 15:33:59 +0000 (15:33 +0000)]
Simplify typedefs. NFC.
llvm-svn: 285819
Marshall Clow [Wed, 2 Nov 2016 15:30:26 +0000 (15:30 +0000)]
Implement another part of P0031; adding constexpr to move_iterator
llvm-svn: 285818
Rafael Espindola [Wed, 2 Nov 2016 15:23:32 +0000 (15:23 +0000)]
Inline a version of getSectionStringTable into the only use.
llvm-svn: 285817
Rafael Espindola [Wed, 2 Nov 2016 15:21:24 +0000 (15:21 +0000)]
Pass the section table to getSectionStringTable. NFC.
This will let us simplify the llvm side.
llvm-svn: 285816
Rafael Espindola [Wed, 2 Nov 2016 15:15:59 +0000 (15:15 +0000)]
Compute the section table lazily.
As a consequence this move a bunch of error checking out of the constructor.
llvm-svn: 285815
Vasileios Kalintiris [Wed, 2 Nov 2016 15:11:27 +0000 (15:11 +0000)]
[mips] Always run the MipsOptimizePICCall pass.
Summary:
Remove this pass from addMachineSSAOptimization() and register it unconditionally in through addPreRegAlloc(). This pass is required for generating correct PIC calls.
Reviewers: sdardis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26036
llvm-svn: 285814
Joerg Sonnenberger [Wed, 2 Nov 2016 15:00:31 +0000 (15:00 +0000)]
Create the virtual register for the global base in the intersection of
GPRC and GPRC_NOR0 (or the 64bit equivalent) and not just the latter.
GPRC_NOR0 contains ZERO as alternative meaning of r0 and is therefore
not a true subclass of GPRC.
llvm-svn: 285813
Rafael Espindola [Wed, 2 Nov 2016 14:52:50 +0000 (14:52 +0000)]
Inline getSectionStringTableIndex() into only caller. NFC.
llvm-svn: 285812
Rafael Espindola [Wed, 2 Nov 2016 14:42:20 +0000 (14:42 +0000)]
Don't use getNumSections.
It is just the size of sections() which we were already calling.
llvm-svn: 285811
Aaron Ballman [Wed, 2 Nov 2016 14:31:36 +0000 (14:31 +0000)]
Turn on the /bigobj switch for RecursiveASTVisitorTest.cpp; we are now bumping up against that limit with MSVC 2015 in Win64 debug build mode.
llvm-svn: 285810
Aaron Ballman [Wed, 2 Nov 2016 14:16:36 +0000 (14:16 +0000)]
Add a new clang-tidy check for cert-msc50-cpp (and cert-msc30-c) that corresponds to the CERT C++ secure coding rule: https://securecoding.cert.org/confluence/display/cplusplus/MSC50-CPP.+Do+not+use+std%3A%3Arand%28%29+for+generating+pseudorandom+numbers
Patch by Benedek Kiss
llvm-svn: 285809
Rafael Espindola [Wed, 2 Nov 2016 14:11:05 +0000 (14:11 +0000)]
Update for llvm change.
llvm-svn: 285808
Rafael Espindola [Wed, 2 Nov 2016 14:10:57 +0000 (14:10 +0000)]
Avoid a report_fatal_error in sections().
Have it return a ErrorOr<Range> and delete section_begin and
section_end.
llvm-svn: 285807
Aaron Ballman [Wed, 2 Nov 2016 13:58:57 +0000 (13:58 +0000)]
Removing a switch statement that contains a default label, but no case labels. Silences an MSVC warning; NFC.
llvm-svn: 285806
Rafael Espindola [Wed, 2 Nov 2016 13:36:31 +0000 (13:36 +0000)]
Simplify SHF_LINK_ORDER handling. NFC.
While ARM is the only currently user we support this is a general
feature.
This avoids a second walk over the sections.
llvm-svn: 285805
Rafael Espindola [Wed, 2 Nov 2016 13:07:38 +0000 (13:07 +0000)]
getNumSections should return a uintX_t. NFC.
llvm-svn: 285804
Rafael Espindola [Wed, 2 Nov 2016 12:49:55 +0000 (12:49 +0000)]
Simplify getSection. NFC.
llvm-svn: 285803
Joerg Sonnenberger [Wed, 2 Nov 2016 12:45:28 +0000 (12:45 +0000)]
Simplify.
llvm-svn: 285802
Pavel Labath [Wed, 2 Nov 2016 12:18:42 +0000 (12:18 +0000)]
Remove TimeValue usage from two files
llvm-svn: 285801
Ulrich Weigand [Wed, 2 Nov 2016 11:32:28 +0000 (11:32 +0000)]
[SystemZ] Fix compiler warnings introduced by r285574
SystemZAsmParser::parseOperand returns a bool, not an enum.
llvm-svn: 285800
Malcolm Parsons [Wed, 2 Nov 2016 10:39:27 +0000 (10:39 +0000)]
Fix Clang-tidy readability-redundant-string-cstr warnings
Reviewers: aaron.ballman, mehdi_amini, dblaikie
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26206
llvm-svn: 285799
Pavel Labath [Wed, 2 Nov 2016 10:29:47 +0000 (10:29 +0000)]
Fix printf errors in ProcessMinidump
llvm-svn: 285798
Pavel Labath [Wed, 2 Nov 2016 10:27:54 +0000 (10:27 +0000)]
Remove TimeValue from UnwindLLDB.cpp
Really NFC, as the code is #ifdefed out, but I did make sure it compiles if I enable it.
llvm-svn: 285797
George Rimar [Wed, 2 Nov 2016 10:16:25 +0000 (10:16 +0000)]
[ELF] - Check that .dynsym is present in DSO if SHT_GNU_versym section is.
When we have SHT_GNU_versym section, it is should be associated with symbol table
section. Usually (and in out implementation) it is .dynsym.
In case when .dynsym is absent (due to broken object for example),
lld crashes in parseVerdefs() when accesses null pointer:
Versym = reinterpret_cast<const Elf_Versym *>(this->ELFObj.base() +
VersymSec->sh_offset) +
this->Symtab->sh_info;
DIfferential revision: https://reviews.llvm.org/D25553
llvm-svn: 285796
Pavel Labath [Wed, 2 Nov 2016 10:13:54 +0000 (10:13 +0000)]
Remove TimeValue usages from MacOSX-Kernel process plugin. NFC
llvm-svn: 285795
Kirill Bobyrev [Wed, 2 Nov 2016 10:00:40 +0000 (10:00 +0000)]
[llvm] FIx if-clause -Wmisleading-indentation issue.
While bootstrapping Clang with recent `gcc 6.2.0` I found a bug related to misleading indentation.
I believe, a pair of `{}` was forgotten, especially given the above similar piece of code:
```
if (!RDef || !HII->isPredicable(*RDef)) {
Done = coalesceRegisters(RD, RegisterRef(S1));
if (Done) {
UpdRegs.insert(RD.Reg);
UpdRegs.insert(S1.getReg());
}
}
```
Reviewers: kparzysz
Differential Revision: https://reviews.llvm.org/D26204
llvm-svn: 285794
Bjorn Pettersson [Wed, 2 Nov 2016 08:55:19 +0000 (08:55 +0000)]
[Reassociate] Skip analysis of dead code to avoid infinite loop.
Summary:
It was detected that the reassociate pass could enter an inifite
loop when analysing dead code. Simply skipping to analyse basic
blocks that are dead avoids such problems (and as a side effect
we avoid spending time on optimising dead code).
The solution is using the same Reverse Post Order ordering of the
basic blocks when doing the optimisations, as when building the
precalculated rank map. A nice side-effect of this solution is
that we now know that we only try to do optimisations for blocks
with ranked instructions.
Fixes https://llvm.org/bugs/show_bug.cgi?id=30818
Reviewers: llvm-commits, davide, eli.friedman, mehdi_amini
Subscribers: dberlin
Differential Revision: https://reviews.llvm.org/D26154
llvm-svn: 285793
Roger Ferrer Ibanez [Wed, 2 Nov 2016 08:36:43 +0000 (08:36 +0000)]
Remove spurious token from #endif
llvm-svn: 285792
Roger Ferrer Ibanez [Wed, 2 Nov 2016 08:14:57 +0000 (08:14 +0000)]
Protect tests for new/delete under libcpp-no-exceptions
Skip the tests that expect an exception be thrown and protect unreachable catch blocks.
Differential Revision: https://reviews.llvm.org/D26197
llvm-svn: 285791
Dylan McKay [Wed, 2 Nov 2016 06:47:40 +0000 (06:47 +0000)]
[AVR] Add instruction selection lowering code
Summary: This adds AVRISelLowering.cpp
Reviewers: arsenm, kparzysz
Subscribers: llvm-commits, modocache, japaric, wdng, beanz, mgorny
Differential Revision: https://reviews.llvm.org/D25034
llvm-svn: 285790
Shoaib Meenai [Wed, 2 Nov 2016 06:10:03 +0000 (06:10 +0000)]
[CMake] Set default build type correctly
At least with cmake 3.6.1, the default build type setting was having no
effect; the generated CMakeCache.txt still had an empty CMAKE_BUILD_TYPE.
Force the variable to be set to achieve the desired behavior.
Differential Revision: https://reviews.llvm.org/D26200
llvm-svn: 285789
Eric Fiselier [Wed, 2 Nov 2016 05:08:58 +0000 (05:08 +0000)]
Fix GCC test failure caused by manually defining _LIBCPP_HAS_NO_VARIADICS
llvm-svn: 285788
Dean Michael Berris [Wed, 2 Nov 2016 04:11:29 +0000 (04:11 +0000)]
[XRay][x86_64] Define a tail exit trampoline.
Summary:
We define a new trampoline that's a hybrid between the exit and entry
trampolines with the following properties:
- Saves all of the callee-saved registers according to the x86_64
calling conventions.
- Indicate to the log handler function being called that this is a
function exit event.
This fixes a bug that is a result of not saving enough of the register
states, and that the log handler is clobbering registers that would be
used by the function being tail-exited into manifesting as runtime
errors.
Reviewers: rSerge, echristo, majnemer
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D26020
llvm-svn: 285787
Eric Fiselier [Wed, 2 Nov 2016 03:57:34 +0000 (03:57 +0000)]
Fix __libcpp_is_constructible for source types with explicit conversion operators.
Previously __libcpp_is_constructible checked the validity of reference
construction using 'eat<To>(declval<From>())' but this doesn't consider
From's explicit conversion operators. This patch teaches __libcpp_is_constructible
how to handle these cases. To do this we need to check the validity
using 'static_cast<To>(declval<From>())'. Unfortunately static_cast allows
additional base-to-derived and lvalue-to-rvalue conversions, which have to be
checked for and manually rejected.
While implementing these changes I discovered that Clang incorrectly
rejects `static_cast<int&&>(declval<float&>())` even though
`int &&X(declval<float&>())` is well formed. In order to tolerate this bug
the `__eat<T>(...)` needs to be left in-place. Otherwise it could be replaced
entirely with the new static_cast implementation.
Thanks to Walter Brown for providing the test cases.
llvm-svn: 285786
Peter Collingbourne [Wed, 2 Nov 2016 02:58:47 +0000 (02:58 +0000)]
Bitcode: Fix short read implementation.
We need to zero extend the byte in order to correctly shift it into a
64-bit value.
llvm-svn: 285785
Rui Ueyama [Wed, 2 Nov 2016 02:18:01 +0000 (02:18 +0000)]
Add strings to .dynstr early.
Previously, we added strings from DynamicSection::finalize().
It was a bit tricky because finalize() is supposed to fix the final
size of the section, but adding new strings would change the size of
.dynstr section. So there was a dependency between finalize functions
of .dynamic and .dynstr.
However, I noticed that we can elimiante the dependency by simply
add strings early; we don't have to do that in finalize() but can do
from DynamicSection's ctor.
This patch defines a new function, DynamicSection::addEntries, to
add .dynamic entries that doesn't depend on other sections.
llvm-svn: 285784
Brad Smith [Wed, 2 Nov 2016 01:39:01 +0000 (01:39 +0000)]
Disable the use of std::call_once on OpenBSD with libstdc++.
It was noticed this caused performance regressions and deadlocks. PR30768.
Reorder the code to make it clearer what is tested.
PPC now disables the use of std::call_once only with libstdc++ with
the reordering of the code, as was the original intent.
llvm-svn: 285782
Jim Ingham [Wed, 2 Nov 2016 01:06:42 +0000 (01:06 +0000)]
Fix SBWatchpoint::SetEnabled to send an event.
We really shouldn't be sending events for SB API's, dunno when we started
doing that. We don't do it for other things. But first restore the status quo.
llvm-svn: 285781
Michael Gottesman [Wed, 2 Nov 2016 00:59:58 +0000 (00:59 +0000)]
[ilist_node] Add a getReverseIterator() method and a unittest for it.
This is the reverse_iterator analogue of getIterator().
llvm-svn: 285780
Richard Smith [Wed, 2 Nov 2016 00:47:52 +0000 (00:47 +0000)]
More forcibly resolve exception specifications when checking a function
redeclaration in C++1z mode. We need the exception specification in order for
the function's type to be complete.
llvm-svn: 285779
Eugene Zelenko [Wed, 2 Nov 2016 00:43:23 +0000 (00:43 +0000)]
[Documentation] Clang-tidy readability-redundant-declaration consistency.
Release notes checks order and consistent Clang-tidy readability-redundant-declaration description.
llvm-svn: 285778