Commit Graph

289510 Commits

Author SHA1 Message Date
Richard Smith cbebd6226d Fix regression in r332076.
If the name after 'template' is an unresolved using declaration (not containing
'typename'), then we don't yet know if it's a valid template-name, so don't
reject it prior to instantiation. Instead, treat it as naming a dependent
member of the current instantiation.

llvm-svn: 332291
2018-05-14 20:52:48 +00:00
Krzysztof Parzyszek f66f7612bf [Hexagon] Add a target feature for generating new-value stores
llvm-svn: 332290
2018-05-14 20:41:04 +00:00
Paul Robinson 5f53f07b66 [DWARF] Factor out a DWARFUnitHeader class. NFC
Extract information related to a "unit header" from DWARFUnit into a
new DWARFUnitHeader class, and add a DWARFUnit member for the header.
This is one step in the direction of allowing type units in the
.debug_info section for DWARF v5.

Differential Revision: https://reviews.llvm.org/D46707

llvm-svn: 332289
2018-05-14 20:32:31 +00:00
George Karpenkov 098f0080da Remove the fixit for the diagnostics regarding capturing autoreleasing variables in a block
The fixit is actively harmful, as it encourages developers to ignore the
warning and to write unsafe code.
It is almost impossible to write safe code while capturing autoreleasing
variables in the block, as in order to check that the block is never
called in the autoreleasing pool the developer has to check the
transitive closure of all potential callers of the block.

Differential Revision: https://reviews.llvm.org/D46778

llvm-svn: 332288
2018-05-14 20:29:16 +00:00
Eric Liu 7129e63bcc [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.
Summary: Also pull #include related style out of FormatStyle as tooling::IncludeStyle.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: klimek, mgorny, cfe-commits, djasper

Differential Revision: https://reviews.llvm.org/D46496

llvm-svn: 332287
2018-05-14 20:17:53 +00:00
Richard Smith d699da427a PR37450: Fix bug that disabled some type checks for variables with deduced types.
Also improve diagnostic for the case where a type is non-literal because it's a lambda.

llvm-svn: 332286
2018-05-14 20:15:04 +00:00
Krzysztof Parzyszek 771f2422d0 [Hexagon] Add a target feature for memop generation
llvm-svn: 332285
2018-05-14 20:09:07 +00:00
Eric Liu 9d92c027e8 [clang-format] Move #include related style to libToolingCore
Summary: This will be shared by include insertion/deletion library.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: mgorny, klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D46758

llvm-svn: 332284
2018-05-14 19:51:33 +00:00
Sid Manning d9f2873511 Hexagon: Put relocations after instructions not packets.
Change relocation output so that relocation information follows
individual instructions rather than clustering them at the end
of packets.

This change required shifting block of code but the actual change
is in HexagonPrettyPrinter's PrintInst.

Differential Revision: https://reviews.llvm.org/D46728

llvm-svn: 332283
2018-05-14 19:46:08 +00:00
Volodymyr Sapsai 57e7470ab6 Update XFAIL so apple-clang-9.0 is the last version not implementing Core 2094.
The test is passing with apple-clang-9.1. rdar://problem/40222003

llvm-svn: 332282
2018-05-14 19:45:24 +00:00
Joel E. Denny 7509a2f5cc [AST] Print correct tag decl for tag specifier
For example, given:

  void fn() {
    struct T *p0;
    struct T { int i; } *p1;
  }

-ast-print produced:

  void fn() {
    struct T { int i; } *p0;
    struct T { int i; } *p1;
  }

Compiling that fails with a redefinition error.

Given:

  void fn() {
    struct T *p0;
    struct __attribute__((deprecated)) T *p1;
  }

-ast-print dropped the attribute.

Details:

For a tag specifier (that is, struct/union/class/enum used as a type
specifier in a declaration) that was also a tag declaration (that is,
first occurrence of the tag) or tag redeclaration (that is, later
occurrence that specifies attributes or a member list), clang printed
the tag specifier as either (1) the full tag definition if one
existed, or (2) the first tag declaration otherwise.  Redefinition
errors were sometimes introduced, as in the first example above.  Even
when that was impossible because no member list was ever specified,
attributes were sometimes lost, thus changing semantics and
diagnostics, as in the second example above.

This patch fixes a major culprit for these problems.  It does so by
creating an ElaboratedType with a new OwnedDecl member wherever an
occurrence of a tag type is a (re)declaration of that tag type.
PrintingPolicy's IncludeTagDefinition used to trigger printing of the
member list, attributes, etc. for a tag specifier by using a tag
(re)declaration selected as described above.  Now, it triggers the
same thing except it uses the tag (re)declaration stored in the
OwnedDecl.  Of course, other tooling can now make use of the new
OwnedDecl as well.

Also, to be more faithful to the original source, this patch
suppresses printing of attributes inherited from previous
declarations.

Reviewed by: rsmith, aaron.ballman

Differential Revision: https://reviews.llvm.org/D45463

llvm-svn: 332281
2018-05-14 19:36:45 +00:00
Nico Weber 9668e45b61 Inline a few CMake variables into their only uses.
No behavior change. Makes unittests CMakeLists.txt files more self-consistent.

llvm-svn: 332280
2018-05-14 19:23:31 +00:00
Yaxun Liu daceb1ea0f CodeGen: Emit string literal in constant address space
Some targets have constant address space (e.g. amdgcn). For them string literal should be
emitted in constant address space then casted to default address space.

Differential Revision: https://reviews.llvm.org/D46643

llvm-svn: 332279
2018-05-14 19:20:12 +00:00
Nico Weber 38f8b9c882 Remove a workaround that should be unneeded after r202806.
llvm-svn: 332278
2018-05-14 19:13:23 +00:00
Eugene Zelenko 7dbce69ba7 [Documentation] Alphabetical order of new checks in Release Notes.
llvm-svn: 332277
2018-05-14 19:12:40 +00:00
Vitaly Buka cdb89b72f5 Revert "[sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock"
Tsan tests fail.

This reverts commit r332268

llvm-svn: 332276
2018-05-14 18:53:13 +00:00
Joel E. Denny 7bcc21027d [AST] Fix -ast-print for _Bool when have diagnostics
For example, given:

  #define bool _Bool
  _Bool i;
  void fn() { 1; }

-ast-print produced:

  tmp.c:3:13: warning: expression result unused
  void fn() { 1; }
              ^
  bool i;
  void fn() {
      1;
  }

That fails to compile because bool is undefined.

Details:

Diagnostics print _Bool as bool when the latter is defined as the
former.  However, diagnostics were altering the printing policy for
-ast-print as well.  The printed source was then invalid because the
preprocessor eats the bool definition.

Problematic diagnostics included suppressed warnings (e.g., add
-Wno-unused-value to the above example), including those that are
suppressed by default.

This patch fixes this bug and cleans up some related comments.

Reviewed by: aaron.ballman, rsmith

Differential Revision: https://reviews.llvm.org/D45093

llvm-svn: 332275
2018-05-14 18:41:44 +00:00
Simon Pilgrim 215ce4a1ca [X86] Add NT load/store scheduler classes
llvm-svn: 332274
2018-05-14 18:37:19 +00:00
Peter Collingbourne 62f7af712c COFF: Allow ICFing sections with different alignments.
The combined section gets the maximum alignment of all sections.

Differential Revision: https://reviews.llvm.org/D46786

llvm-svn: 332273
2018-05-14 18:36:51 +00:00
Nico Weber 1b64a12654 alphabetize list
llvm-svn: 332272
2018-05-14 18:23:05 +00:00
Craig Topper 53ceb4805f [X86] Remove and autoupgrade avx512.vbroadcast.ss/avx512.vbroadcast.sd intrinsics.
llvm-svn: 332271
2018-05-14 18:21:22 +00:00
Simon Pilgrim 5bd5e2fd3e [llvm-mca][X86] Add missing SSE4A test file
llvm-svn: 332270
2018-05-14 18:20:40 +00:00
Simon Pilgrim 228d24a2d6 [X86][BtVer2] Fix MMX/YMM integer vector nt store schedules
MMX was missing and YMM was tagged as a fp nt store

llvm-svn: 332269
2018-05-14 18:07:28 +00:00
Vitaly Buka e5bd326822 [sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock
Reviewers: eugenis, dvyukov

Subscribers: srhines, kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D46793

llvm-svn: 332268
2018-05-14 18:03:34 +00:00
Craig Topper 5e0feeae34 [X86] Remove GCCBuiltin from the intrinsics that clang stopped using in r332266.
Add a FIXME for their eventual removal.

llvm-svn: 332267
2018-05-14 18:02:21 +00:00
Craig Topper 25de41cfbc [X86] Use __builtin_convertvector to replace some of the avx512 truncate builtins.
As long as the destination type is a 256 or 128 bit vector with the same number of elements we can use __builtin_convertvector to directly generate trunc IR instruction which will be handled natively by the backend.

Differential Revision: https://reviews.llvm.org/D46742

llvm-svn: 332266
2018-05-14 17:50:40 +00:00
Geoff Berry 64a2ea41ea [BranchFolding] Allow hoisting to block with a single conditional branch.
Summary:
The BranchFolding pass is currently missing opportunities to hoist
common code if the hoisted-to block contains a single conditional branch
that has register uses.  This occurs somewhat frequently on AArch64 with
CBZ/TBZ opcodes.

This change also eliminates some code differences when debug info is
present since the presence of e.g. DBG_VALUE instructions in the
hoisted-to block can enable hoisting that wouldn't have occurred without
them.

Reviewers: MatzeB, rnk, kparzysz, twoh, aprantl, javed.absar

Subscribers: kristof.beyls, JDevlieghere, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D46324

llvm-svn: 332265
2018-05-14 17:31:18 +00:00
Simon Pilgrim 4135de2e93 [llvm-mca][x86] Add scalar nt-store instruction tests
llvm-svn: 332262
2018-05-14 17:10:33 +00:00
Pavel Labath 4f107ba20e Revert "Remove Process references from the Host module"
The first fix wasn't enough, there is still a missing
ProcessInstanceInfo include in Host.mm. I won't be able to test a fix
before leaving work, so I am reverting both commits.

This reverts commit r332250 and the subsequent fix attempt.

llvm-svn: 332261
2018-05-14 16:54:53 +00:00
Krzysztof Parzyszek 329c3e9a5f [Hexagon] Avoid predicate copies to integer registers from store-locked
llvm-svn: 332260
2018-05-14 16:41:40 +00:00
Zaara Syeda 6b8b868db5 [ELF][PPC64] Fix getRelExpr for R_PPC64_REL64
The relocation R_PPC64_REL64 should return R_PC for getRelExpr since it
computes S + A - P.

Differential Revision: https://reviews.llvm.org/D46766

llvm-svn: 332259
2018-05-14 16:39:45 +00:00
Simon Dardis bb818b4421 [mips] Fix the predicates of round, ceiling, floor and trunc.
Reviewers: atanasyan, abeserminji, smaksimovic

Differential Revision: https://reviews.llvm.org/D46691

llvm-svn: 332258
2018-05-14 16:26:50 +00:00
Simon Pilgrim 7340d88740 [llvm-mca][x86] Add and/not/or/xor instruction tests
llvm-svn: 332257
2018-05-14 16:26:24 +00:00
Aleksei Sidorin 54d6af5be6 [ASTImporter] Turn StringRefs back to std::strings to avoid use-after-free
This is a workaround for the issue in buildASTFromCodeWithArgs()
where a local buffer can be used to store the program text
referred by SourceManager.
FIXME: Fix the root issue in buildASTFromCodeWithArgs().

llvm-svn: 332256
2018-05-14 16:12:31 +00:00
Pavel Labath 4a20f3b3f9 Fix macosx build broken by r332250
llvm-svn: 332255
2018-05-14 16:01:49 +00:00
Dan Liew fe7250c2fa Fix another case where libstdc++ is being inappropriately requested (see
r328775) for all platforms.

Given that this is the second occurance of this problem it seemed worth
fixing this problem in a more generic way. r328775 has been reverted and
now a substitution `%linux_static_libstdcplusplus` has been provided.
This substitution expands to Clang driver arguments to use a static
libstdc++ on Linux and on all other platforms it expands to nothing.

The `asan/TestCases/throw_invoke_test.cc` and
`test/tsan/static_init6.cc` test cases now use this substitution.

rdar://problem/39948818

Differential Revision: https://reviews.llvm.org/D46401

llvm-svn: 332254
2018-05-14 15:48:49 +00:00
Zaara Syeda 421a5960d2 [NFC] [Power] Fix instruction format for xsrqpi
xsrqpi is currently using Z23Form_1.
The instruction format is xsrqpi R,VRT,VRB,RMC.
Rathar than bits 11-15 being used for FRA, it should have
bits 11-14 reserved and bit 15 for R. This patch adds a new
class Z23Form_4 to fix the instruction format.

Differential Revision: https://reviews.llvm.org/D46761

llvm-svn: 332253
2018-05-14 15:45:15 +00:00
Zaara Syeda c87e16718f [ELF][PPC64] Fix getRelExpr for R_PPC64_REL32
The relocation R_PPC64_REL32 should return R_PC for getRelExpr since it
computes S + A - P.

Differential Revision: https://reviews.llvm.org/D46586

llvm-svn: 332252
2018-05-14 15:26:44 +00:00
Evandro Menezes 14fa2e4fa5 [AArch64] Improve single vector lane stores
When storing the 0th lane of a vector, use a simpler and usually more efficient scalar store instead.

Differential revision: https://reviews.llvm.org/D46655

llvm-svn: 332251
2018-05-14 15:26:35 +00:00
Pavel Labath 58b54894c7 Remove Process references from the Host module
The Process class was only being referenced because of the last-ditch
effort in the process launchers to set a process death callback in case
one isn't set already.

Although launching a process for debugging is the most important kind of
"launch" we are doing, it is by far not the only one, so assuming this
particular callback is the one to be used is not a good idea (besides
breaking layering). Instead of assuming a particular exit callback, I
change the launcher code to require the callback to be set by the user (and fix
up the two call sites which did not set the callback already).

Reviewers: jingham, davide

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D46395

llvm-svn: 332250
2018-05-14 15:13:13 +00:00
Andrea Di Biagio 8ea3a34e39 [llvm-mca] Improved support for dependency-breaking instructions.
The tool assumes that a zero-latency instruction that doesn't consume hardware
resources is an optimizable dependency-breaking instruction. That means, it
doesn't have to wait on register input operands, and it doesn't consume any
physical register. The PRF knows how to optimize it at register renaming stage.

llvm-svn: 332249
2018-05-14 15:08:22 +00:00
Pavel Labath 2cb7cf8e87 FileSpec: Remove PathSyntax enum and use llvm version instead
Summary:
The llvm version of the enum has the same enumerators, with stlightly
different names, so this is mostly just a search&replace exercise. One
concrete benefit of this is that we can remove the function for
converting between the two enums.

To avoid typing llvm::sys::path::Style::windows everywhere I import the
enum into the FileSpec class, so it can be referenced as
FileSpec::Style::windows.

Reviewers: zturner, clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D46753

llvm-svn: 332247
2018-05-14 14:52:47 +00:00
Pavel Labath 2a6afe5f87 [CodeGen/AccelTable]: Handle -dwarf-linkage-names=Abstract correctly
Summary:
If we are not emitting a linkage name in the .debug_info sections, we
should not add it into the index either. This makes sure our index is
consistent with the actual debug info.

I am also explicitly setting the --dwarf-linkage-names=All in the
name-collsions test as that one would now fail on targets where this
defaults to "Abstract" (in fact, it would have failed already if there
wasn't a bug in the DWARF verifier, which I fix as well).

Reviewers: probinson, aprantl, JDevlieghere

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D46748

llvm-svn: 332246
2018-05-14 14:13:20 +00:00
Nicola Zaghen ded3dae331 Docs: Fix the title underline too short.
llvm-svn: 332245
2018-05-14 13:54:39 +00:00
Ilya Biryukov fb9dde7040 [CodeComplete] Provide completion in decls even for incomplete types
Summary:
This change fixes lack of completions in the following case
('^'designates completion points) :

    void f(^);
    struct Incomplete;
    Incomplete g(^);

Reviewers: bkramer, aaron.ballman, sammccall

Reviewed By: aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D46639

llvm-svn: 332244
2018-05-14 13:50:36 +00:00
Sanjay Patel bf55e6dee1 [AggressiveInstCombine] avoid crashing on unsimplified code (PR37446)
This bug:
https://bugs.llvm.org/show_bug.cgi?id=37446
...raises another question: why do we run aggressive-instcombine before 
regular instcombine?

llvm-svn: 332243
2018-05-14 13:43:32 +00:00
George Rimar 8f2b2f4e04 [ELF] - Simplify. NFC.
llvm-svn: 332242
2018-05-14 13:21:09 +00:00
Simon Dardis bb95dea8e7 [mips] Add missing test case from r332227
I did not commit this test from D46689.

llvm-svn: 332241
2018-05-14 13:18:51 +00:00
Nicola Zaghen d34e60ca85 Rename DEBUG macro to LLVM_DEBUG.
The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM
- Manual change to APInt
- Manually chage DOCS as regex doesn't match it.

In the transition period the DEBUG() macro is still present and aliased
to the LLVM_DEBUG() one.

Differential Revision: https://reviews.llvm.org/D43624

llvm-svn: 332240
2018-05-14 12:53:11 +00:00
Simon Pilgrim affbc99bea Fix Wdocumentation warnings. NFCI.
llvm-svn: 332239
2018-05-14 12:22:30 +00:00