]> granicus.if.org Git - clang/log
clang
5 years agoFix nits
Stephen Kelly [Mon, 10 Dec 2018 21:04:04 +0000 (21:04 +0000)]
Fix nits

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348798 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRe-order content of template parameter dumps
Stephen Kelly [Mon, 10 Dec 2018 21:03:00 +0000 (21:03 +0000)]
Re-order content of template parameter dumps

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348797 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRe-order content in OMPDeclareReductionDecl dump
Stephen Kelly [Mon, 10 Dec 2018 20:53:39 +0000 (20:53 +0000)]
Re-order content in OMPDeclareReductionDecl dump

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348795 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoChange InitListExpr dump to label and pointer
Stephen Kelly [Mon, 10 Dec 2018 20:53:32 +0000 (20:53 +0000)]
Change InitListExpr dump to label and pointer

Summary: Don't add a child just for the label.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348794 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd an explicit triple to this test to fix failing test bots.
Aaron Ballman [Mon, 10 Dec 2018 19:18:11 +0000 (19:18 +0000)]
Add an explicit triple to this test to fix failing test bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348790 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[constexpr][c++2a] Try-catch blocks in constexpr functions
Bruno Cardoso Lopes [Mon, 10 Dec 2018 19:03:12 +0000 (19:03 +0000)]
[constexpr][c++2a] Try-catch blocks in constexpr functions

Implement support for try-catch blocks in constexpr functions, as
proposed in http://wg21.link/P1002 and voted in San Diego for c++20.

The idea is that we can still never throw inside constexpr, so the catch
block is never entered. A try-catch block like this:

try { f(); } catch (...) { }

is then morally equivalent to just

{ f(); }

Same idea should apply for function/constructor try blocks.

rdar://problem/45530773

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348789 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdding tests for -ast-dump; NFC.
Aaron Ballman [Mon, 10 Dec 2018 18:37:47 +0000 (18:37 +0000)]
Adding tests for -ast-dump; NFC.

This adds tests for expressions in C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348786 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoComputeLineNumbers: delete SSE2 vectorization
Fangrui Song [Mon, 10 Dec 2018 18:10:35 +0000 (18:10 +0000)]
ComputeLineNumbers: delete SSE2 vectorization

Summary:
SSE2 vectorization was added in 2012, but it is 2018 now and I can't
observe any performance boost (testing clang -E [all Sema/* CodeGen/* with proper -I options]) with the existing _mm_movemask_epi8+countTrailingZeros or the following SSE4.2 (compiling with -msse4.2):

  __m128i C = _mm_setr_epi8('\r','\n',0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  _mm_cmpestri(C, 2, Chunk, 16, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_POSITIVE_POLARITY | _SIDD_LEAST_SIGNIFICANT)

Delete the vectorization to simplify the code.

Also simplify the code a bit and don't check the line ending sequence \n\r

Reviewers: bkramer, #clang

Reviewed By: bkramer

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348777 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[libclang] Revert removal of tidy plugin support from libclang introduced in r347496
Ivan Donchevskii [Mon, 10 Dec 2018 15:58:50 +0000 (15:58 +0000)]
[libclang] Revert removal of tidy plugin support from libclang introduced in r347496

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348764 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse zip_longest for iterator range comparisons. NFC.
Michael Kruse [Mon, 10 Dec 2018 15:16:37 +0000 (15:16 +0000)]
Use zip_longest for iterator range comparisons. NFC.

Use zip_longest in two locations that compare iterator ranges.
zip_longest allows the iteration using a range-based for-loop and to be
symmetric over both ranges instead of prioritizing one over the other.
In that latter case code have to handle the case that the first is
longer than the second, the second is longer than the first, and both
are of the same length, which must partially be checked after the loop.

With zip_longest, this becomes an element comparison within the loop
like the comparison of the elements themselves. The symmetry makes it
clearer that neither the first and second iterators are handled
differently. The iterators are not event used directly anymore, just
the ranges.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348762 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMisc typos fixes in ./lib folder
Raphael Isemann [Mon, 10 Dec 2018 12:37:46 +0000 (12:37 +0000)]
Misc typos fixes in ./lib folder

Summary: Found via `codespell -q 3 -I ../clang-whitelist.txt -L uint,importd,crasher,gonna,cant,ue,ons,orign,ned`

Reviewers: teemperor

Reviewed By: teemperor

Subscribers: teemperor, jholewinski, jvesely, nhaehnle, whisperity, jfb, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348755 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenCL][CodeGen] Fix replacing memcpy with addrspacecast
Andrew Savonichev [Mon, 10 Dec 2018 12:03:00 +0000 (12:03 +0000)]
[OpenCL][CodeGen] Fix replacing memcpy with addrspacecast

Summary:
If a function argument is byval and RV is located in default or alloca address space
an optimization of creating addrspacecast instead of memcpy is performed. That is
not correct for OpenCL, where that can lead to a situation of address space casting
from __private * to __global *. See an example below:

```
typedef struct {
  int x;
} MyStruct;

void foo(MyStruct val) {}

kernel void KernelOneMember(__global MyStruct* x) {
  foo (*x);
}
```

for this code clang generated following IR:
...
%0 = load %struct.MyStruct addrspace(1)*, %struct.MyStruct addrspace(1)**
%x.addr, align 4
%1 = addrspacecast %struct.MyStruct addrspace(1)* %0 to %struct.MyStruct*
...

So the optimization was disallowed for OpenCL if RV is located in an address space
different than that of the argument (0).

Reviewers: yaxunl, Anastasia

Reviewed By: Anastasia

Subscribers: cfe-commits, asavonic

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348752 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r348741 "[Sema] Further improvements to to static_assert diagnostics."
Clement Courbet [Mon, 10 Dec 2018 08:53:17 +0000 (08:53 +0000)]
Revert r348741 "[Sema] Further improvements to to static_assert diagnostics."

Seems to break build bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348742 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Sema] Further improvements to to static_assert diagnostics.
Clement Courbet [Mon, 10 Dec 2018 08:19:38 +0000 (08:19 +0000)]
[Sema] Further improvements to to static_assert diagnostics.

Summary:
We're now handling cases like `static_assert(!expr)` and
static_assert(!(expr))`.

Reviewers: aaron.ballman, Quuxplusone

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348741 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Remove the addcarry builtins. Leaving only the addcarryx builtins since that...
Craig Topper [Mon, 10 Dec 2018 06:07:59 +0000 (06:07 +0000)]
[X86] Remove the addcarry builtins. Leaving only the addcarryx builtins since that matches gcc.

The addcarry and addcarryx builtins do the same thing. The only difference is that addcarryx previously required adx feature.

This commit removes the adx feature check from addcarryx and removes the addcarry builtin. This matches the builtins that gcc has. We don't guarantee compatibility in builtins, but we generally try to be consistent if its not a burden.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348738 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMove the make_const_ptr trait into STLExtras; use add_pointer where possible; NFC.
Aaron Ballman [Sun, 9 Dec 2018 19:53:24 +0000 (19:53 +0000)]
Move the make_const_ptr trait into STLExtras; use add_pointer where possible; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348730 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: Rename TemplateDecl dump utilities
Stephen Kelly [Sun, 9 Dec 2018 13:33:30 +0000 (13:33 +0000)]
NFC: Rename TemplateDecl dump utilities

There is a clang::TemplateDecl AST type, so a method called
VisitTemplateDecl looks like it should 'override' the method from the
base visitor, but it does not because of the extra parameters it takes.

In reality, these methods are utilities, so name them like utilities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348720 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: Move dump of individual comment nodes to NodeDumper
Stephen Kelly [Sun, 9 Dec 2018 13:30:17 +0000 (13:30 +0000)]
NFC: Move dump of individual comment nodes to NodeDumper

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348719 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Introduce optional labels to dumpStmt"
Stephen Kelly [Sun, 9 Dec 2018 13:24:40 +0000 (13:24 +0000)]
Revert "Introduce optional labels to dumpStmt"

This reverts commit 933402caa09963792058198578522a95f013c69c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348718 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoIntroduce optional labels to dumpStmt
Stephen Kelly [Sun, 9 Dec 2018 13:23:07 +0000 (13:23 +0000)]
Introduce optional labels to dumpStmt

If the label is present, it is added as a child, with the statement a
child of the label.  This preserves behavior of the InitListExpr dump
output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348717 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoInline hasNodes into only caller
Stephen Kelly [Sun, 9 Dec 2018 13:20:43 +0000 (13:20 +0000)]
Inline hasNodes into only caller

It is easier to refactor with fewer utility methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348716 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoInline dumpFullComment into callers
Stephen Kelly [Sun, 9 Dec 2018 13:18:55 +0000 (13:18 +0000)]
Inline dumpFullComment into callers

It causes confusion over whether it or dumpComment is the more
important. It is easier to refactor with fewer utility methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348715 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRe-order content from InitListExpr
Stephen Kelly [Sun, 9 Dec 2018 13:15:18 +0000 (13:15 +0000)]
Re-order content from InitListExpr

Summary:
This causes no change in the output of ast-dump-stmt.cpp due to the way
child nodes are printed with a delay.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348714 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix InitListExpr test
Stephen Kelly [Sun, 9 Dec 2018 13:13:41 +0000 (13:13 +0000)]
Fix InitListExpr test

Wrong case of Check meant this has no effect.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348713 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSourceManager: insert(make_pair(..)) -> try_emplace. NFC
Fangrui Song [Sun, 9 Dec 2018 01:46:01 +0000 (01:46 +0000)]
SourceManager: insert(make_pair(..)) -> try_emplace. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348709 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoConvert some ObjC msgSends to runtime calls.
Pete Cooper [Sat, 8 Dec 2018 05:13:50 +0000 (05:13 +0000)]
Convert some ObjC msgSends to runtime calls.

It is faster to directly call the ObjC runtime for methods such as alloc/allocWithZone instead of sending a message to those functions.

This patch adds support for converting messages to alloc/allocWithZone to their equivalent runtime calls.

Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions.

Reviewed By: rjmccall

https://reviews.llvm.org/D55349

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348687 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMove diagnostic enums into Basic.
Richard Trieu [Sat, 8 Dec 2018 05:05:03 +0000 (05:05 +0000)]
Move diagnostic enums into Basic.

Move enums from */*Diagnostic.h to Basic/Diagnostic*.h.  Basic/AllDiagnostics.h
needs all the enums and moving the sources to Basic prevents a Basic->*->Basic
dependency loop.  This also allows each Basic/Diagnostics*Kinds.td to have a
header at Basic/Diagnostic*.h (except for Common).  The old headers are kept in place since other packages are still using them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348685 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoStop tracking retain count of OSObject after escape to void * / other primitive types
George Karpenkov [Sat, 8 Dec 2018 01:18:40 +0000 (01:18 +0000)]
Stop tracking retain count of OSObject after escape to void * / other primitive types

Escaping to void * / uint64_t / others non-OSObject * should stop tracking,
as such functions can have heterogeneous semantics depending on context,
and can not always be annotated.

rdar://46439133

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348675 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[tests] Fix the FileManagerTest getVirtualFile test on Windows
Stella Stamenova [Fri, 7 Dec 2018 23:50:05 +0000 (23:50 +0000)]
[tests] Fix the FileManagerTest getVirtualFile test on Windows

Summary: The test passes on Windows only when it is executed on the C: drive. If the build and tests run on a different drive, the test is currently failing.

Reviewers: kadircet, asmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348665 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CUDA] Added missing 'inline' for functions defined in a header.
Artem Belevich [Fri, 7 Dec 2018 22:20:53 +0000 (22:20 +0000)]
[CUDA] Added missing 'inline' for functions defined in a header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348662 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Preprocessor] Don't avoid entering included files after hitting a fatal error.
Volodymyr Sapsai [Fri, 7 Dec 2018 20:29:54 +0000 (20:29 +0000)]
[Preprocessor] Don't avoid entering included files after hitting a fatal error.

Change in r337953 violated the contract for `CXTranslationUnit_KeepGoing`:

> Do not stop processing when fatal errors are encountered.

Use different approach to fix long processing times with multiple inclusion
cycles. Instead of stopping preprocessing for fatal errors, do this after
reaching the max allowed include depth and only for the files that were
processed already. It is likely but not guaranteed those files cause a cycle.

rdar://problem/46108547

Reviewers: erik.pilkington, arphaman

Reviewed By: erik.pilkington

Subscribers: jkorous, dexonsmith, ilya-biryukov, Dmitry.Kozhevnikov

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348641 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Move out tracking retain count for OSObjects into a separate checker
George Karpenkov [Fri, 7 Dec 2018 20:21:51 +0000 (20:21 +0000)]
[analyzer] Move out tracking retain count for OSObjects into a separate checker

Allow enabling and disabling tracking of ObjC/CF objects
separately from tracking of OS objects.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348638 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] RetainCountChecker: remove untested, unused, incorrect option IncludeAlloc...
George Karpenkov [Fri, 7 Dec 2018 20:21:37 +0000 (20:21 +0000)]
[analyzer] RetainCountChecker: remove untested, unused, incorrect option IncludeAllocationLine

The option has no tests, is not used anywhere, and is actually
incorrect: it prints the line number without the reference to a file,
which can be outright incorrect.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348637 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake testcase more robust for bots actually building in /var
Adrian Prantl [Fri, 7 Dec 2018 17:57:44 +0000 (17:57 +0000)]
Make testcase more robust for bots actually building in /var

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348618 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CTU] test/Analysis/ctu-main.cpp Attempt to fix failing windows bot
Gabor Marton [Fri, 7 Dec 2018 17:36:44 +0000 (17:36 +0000)]
[CTU] test/Analysis/ctu-main.cpp Attempt to fix failing windows bot

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348614 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdding an AST dump test for statement expressions; NFC.
Aaron Ballman [Fri, 7 Dec 2018 17:06:40 +0000 (17:06 +0000)]
Adding an AST dump test for statement expressions; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348613 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake testcase more robust for completely-out-of-tree builds.
Adrian Prantl [Fri, 7 Dec 2018 17:04:26 +0000 (17:04 +0000)]
Make testcase more robust for completely-out-of-tree builds.

Thats to Dave Zarzycki for reprorting this!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348612 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CTU] Add triple/lang mismatch handling
Gabor Marton [Fri, 7 Dec 2018 16:32:43 +0000 (16:32 +0000)]
[CTU] Add triple/lang mismatch handling

Summary:
We introduce a strict policy for C++ CTU. It can work across TUs only if
the C++ dialects are the same. We neither allow C vs C++ CTU.  We do this
because the same constructs might be represented with different properties in
the corresponding AST nodes or even the nodes might be completely different (a
struct will be RecordDecl in C, but it will be a CXXRectordDecl in C++, thus it
may cause certain assertions during cast operations).

Reviewers: xazax.hun, a_sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348610 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CTU] test/Analysis/ctu-main.cpp Attempt to fix failing windows bot
Gabor Marton [Fri, 7 Dec 2018 16:27:31 +0000 (16:27 +0000)]
[CTU] test/Analysis/ctu-main.cpp Attempt to fix failing windows bot

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348609 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CTU] Add more lit tests and better error handling
Gabor Marton [Fri, 7 Dec 2018 16:05:58 +0000 (16:05 +0000)]
[CTU] Add more lit tests and better error handling

Summary:
Adding some more CTU list tests. E.g. to check if a construct is unsupported.
We also slightly modify the handling of the return value of the `Import`
function from ASTImporter.

Reviewers: xazax.hun, balazske, a_sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348605 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[unittests] Add C++17 and C++2a support to the tooling tests
Hamza Sood [Fri, 7 Dec 2018 15:46:29 +0000 (15:46 +0000)]
[unittests] Add C++17 and C++2a support to the tooling tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348603 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake CPUDispatch resolver emit dependent functions.
Erich Keane [Fri, 7 Dec 2018 15:31:23 +0000 (15:31 +0000)]
Make CPUDispatch resolver emit dependent functions.

Inline cpu_specific versions referenced before the cpu_dispatch function
weren't properly emitted, since they hadn't been referred to.  This
patch ensures that during resolver generation that all appropriate
versions are emitted.

Change-Id: I94c3766aaf9c75ca07a0ad8258efdbb834654ff8

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348600 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd an explicit triple to this test to prevent failures due to size_t differences.
Aaron Ballman [Fri, 7 Dec 2018 15:13:51 +0000 (15:13 +0000)]
Add an explicit triple to this test to prevent failures due to size_t differences.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348599 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix spelling of WINDOWS in a test
Erich Keane [Fri, 7 Dec 2018 15:06:43 +0000 (15:06 +0000)]
Fix spelling of WINDOWS in a test

Change-Id: I232515655359f14308e1c5509c4b7db96d1fafcb

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348598 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdding tests for -ast-dump; NFC.
Aaron Ballman [Fri, 7 Dec 2018 14:57:07 +0000 (14:57 +0000)]
Adding tests for -ast-dump; NFC.

This adds tests for various statements in C++ that are not covered by C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348596 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Multiversioning- Ensure all MV functions are emitted."
Erich Keane [Fri, 7 Dec 2018 14:56:50 +0000 (14:56 +0000)]
Revert "Multiversioning- Ensure all MV functions are emitted."

This reverts commit 65df29f9318ac13a633c0ce13b2b0bccf06e79ca.

AS suggested by @rsmith here: https://reviews.llvm.org/rL345839
I'm reverting this and solving the initial problem in a different way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348595 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CTU] Add DisplayCTUProgress analyzer switch
Gabor Marton [Fri, 7 Dec 2018 14:56:02 +0000 (14:56 +0000)]
[CTU] Add DisplayCTUProgress analyzer switch

Summary:
With a new switch we may be able to print to stderr if a new TU is being loaded
during CTU.  This is very important for higher level scripts (like CodeChecker)
to be able to parse this output so they can create e.g. a zip file in case of
a Clang crash which contains all the related TU files.

Reviewers: xazax.hun, Szelethus, a_sidorin, george.karpenkov

Subscribers: whisperity, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp,

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348594 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeComplete] Fix assertion failure
Ilya Biryukov [Fri, 7 Dec 2018 13:17:52 +0000 (13:17 +0000)]
[CodeComplete] Fix assertion failure

Summary:
...that fires when running completion inside an argument of
UnresolvedMemberExpr (see the added test).

The assertion that fires is from Sema::TryObjectArgumentInitialization:

    assert(FromClassification.isLValue());

This happens because Sema::AddFunctionCandidates does not account for
object types which are pointers. It ends up classifying them incorrectly.
All usages of the function outside code completion are used to run
overload resolution for operators. In those cases the object type being
passed is always a non-pointer type, so it's not surprising the function
did not expect a pointer in the object argument.

However, code completion reuses the same function and calls it with the
object argument coming from UnresolvedMemberExpr, which can be a pointer
if the member expr is an arrow ('->') access.

Extending AddFunctionCandidates to allow pointer object types does not
seem too crazy since all the functions down the call chain can properly
handle pointer object types if we properly classify the object argument
as an l-value, i.e. the classification of the implicitly dereferenced
pointer.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348590 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[unittests] Merge the PrintedStmtCXX..Matches functions (NFC)
Hamza Sood [Fri, 7 Dec 2018 12:55:01 +0000 (12:55 +0000)]
[unittests] Merge the PrintedStmtCXX..Matches functions (NFC)

This was reviewed as part of https://reviews.llvm.org/D36527

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348589 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdding tests for -ast-dump; NFC.
Aaron Ballman [Fri, 7 Dec 2018 12:35:15 +0000 (12:35 +0000)]
Adding tests for -ast-dump; NFC.

This adds tests for various statements in C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348588 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CTU] Eliminate race condition in CTU lit tests
Gabor Marton [Fri, 7 Dec 2018 12:29:02 +0000 (12:29 +0000)]
[CTU] Eliminate race condition in CTU lit tests

Summary:
We plan to introduce additional CTU related lit test. Since lit may run the
tests in parallel, it is not safe to use the same directory (%T) for these
tests. It is safe to use however test case specific directories (%t).

Reviewers: xazax.hun, a_sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348587 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CTU] Add asserts to protect invariants
Gabor Marton [Fri, 7 Dec 2018 12:21:43 +0000 (12:21 +0000)]
[CTU] Add asserts to protect invariants

Reviewers: xazax.hun, a_sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348586 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CTU] Add statistics
Gabor Marton [Fri, 7 Dec 2018 11:55:22 +0000 (11:55 +0000)]
[CTU] Add statistics

Reviewers: xazax.hun, a_sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348584 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd a AArch64 triple to tiny codemodel test.
David Green [Fri, 7 Dec 2018 11:16:03 +0000 (11:16 +0000)]
Add a AArch64 triple to tiny codemodel test.

Most other targets do not support the tiny code model.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348582 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC] VSX register support for inline assembly
Kang Zhang [Fri, 7 Dec 2018 08:58:12 +0000 (08:58 +0000)]
[PowerPC] VSX register support for inline assembly

Summary:
The patch is to add the VSX register support for inline assembly. After this
patch, we can use VSX register in inline assembly clobber list without error.

Reviewed By: jsji,  nemanjai

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348572 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix thunks returning memptrs via sret by emitting also scalar return values directly...
Hans Wennborg [Fri, 7 Dec 2018 08:17:26 +0000 (08:17 +0000)]
Fix thunks returning memptrs via sret by emitting also scalar return values directly in sret slot (PR39901)

Thunks that return member pointers via sret are broken due to using temporary
storage for the return value on the stack and then passing that pointer to a
tail call, violating the rule that a tail call can't access allocas in the
caller (see bug).

Since r90526, we put aggregate return values directly in the sret slot, but
this doesn't apply to member pointers which are considered scalar.

Unless I'm missing something subtle, we should be able to always use the sret
slot directly for indirect return values.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348569 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd test for InitListExpr
Stephen Kelly [Fri, 7 Dec 2018 00:08:14 +0000 (00:08 +0000)]
Add test for InitListExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348553 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: Move VisitExpr code to dumpStmt
Stephen Kelly [Thu, 6 Dec 2018 23:33:33 +0000 (23:33 +0000)]
NFC: Move VisitExpr code to dumpStmt

Summary:
The call is duplicated in the handlers of all Expr subclasses.

This change makes it easy to split statement handling out to
TextNodeDumper.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348546 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: Move VisitStmt code to dumpStmt
Stephen Kelly [Thu, 6 Dec 2018 23:33:27 +0000 (23:33 +0000)]
NFC: Move VisitStmt code to dumpStmt

Summary: This call is duplicated in Visits of all direct subclasses of Stmt.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348545 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd more expected content to match in test
Stephen Kelly [Thu, 6 Dec 2018 23:23:10 +0000 (23:23 +0000)]
Add more expected content to match in test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348543 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse relative line offsets in test
Stephen Kelly [Thu, 6 Dec 2018 22:51:51 +0000 (22:51 +0000)]
Use relative line offsets in test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348541 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[frontend][darwin] warn_stdlibcxx_not_found: supress warning for preprocessed input
Alex Lorenz [Thu, 6 Dec 2018 22:45:58 +0000 (22:45 +0000)]
[frontend][darwin] warn_stdlibcxx_not_found: supress warning for preprocessed input

Addresses second post-commit feedback for r335081 from Nico

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348540 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Rely on os_consumes_this attribute to signify that the method call consume...
George Karpenkov [Thu, 6 Dec 2018 22:07:12 +0000 (22:07 +0000)]
[analyzer] Rely on os_consumes_this attribute to signify that the method call consumes a reference for "this"

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348533 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[attributes] Add an attribute os_consumes_this, with similar semantics to ns_consumes...
George Karpenkov [Thu, 6 Dec 2018 22:06:59 +0000 (22:06 +0000)]
[attributes] Add an attribute os_consumes_this, with similar semantics to ns_consumes_self

The attribute specifies that the call of the C++ method consumes a
reference to "this".

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348532 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Fix an infinite recursion bug while checking parent methods in RetainCount...
George Karpenkov [Thu, 6 Dec 2018 22:06:44 +0000 (22:06 +0000)]
[analyzer] Fix an infinite recursion bug while checking parent methods in RetainCountChecker

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348531 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAllow forwarding -fdebug-compilation-dir to cc1as
Nico Weber [Thu, 6 Dec 2018 18:50:39 +0000 (18:50 +0000)]
Allow forwarding -fdebug-compilation-dir to cc1as

The flag -fdebug-compilation-dir is useful to make generated .o files
independent of the path of the build directory, without making the compile
command-line dependent on the path of the build directory, like
-fdebug-prefix-map requires. This change makes it so that the driver can
forward the flag to -cc1as, like it already can for -cc1. We might want to
consider making -fdebug-compilation-dir a driver flag in a follow-up.

(Since -fdebug-compilation-dir defaults to PWD, it's already possible to get
this effect by setting PWD, but explicit compiler flags are better than env
vars, because e.g. ninja tracks command lines and reruns commands that change.)

Somewhat related to PR14625.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348515 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReapply "Avoid emitting redundant or unusable directories in DIFile metadata entries.""
Adrian Prantl [Thu, 6 Dec 2018 18:44:50 +0000 (18:44 +0000)]
Reapply "Avoid emitting redundant or unusable directories in DIFile metadata entries.""

This reverts commit r348280 and reapplies D55085 without modifications.

Original commit message:

    Avoid emitting redundant or unusable directories in DIFile metadata entries.

    As discussed on llvm-dev recently, Clang currently emits redundant
    directories in DIFile entries, such as

      .file      1 "/Volumes/Data/llvm" "/Volumes/Data/llvm/tools/clang/test/CodeGen/debug-info-abspath.c"

    This patch looks at any common prefix between the compilation
    directory and the (absolute) file path and strips the redundant
    part. More importantly it leaves the compilation directory empty if
    the two paths have no common prefix.

    After this patch the above entry is (assuming a compilation dir of "/Volumes/Data/llvm/_build"):

      .file 1 "/Volumes/Data/llvm" "tools/clang/test/CodeGen/debug-info-abspath.c"

    When building the FileCheck binary with debug info, this patch makes
    the build artifacts ~1kb smaller.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348513 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CUDA] Fix nvidia-cuda-toolkit detection on Ubuntu
Joel E. Denny [Thu, 6 Dec 2018 17:46:17 +0000 (17:46 +0000)]
[CUDA] Fix nvidia-cuda-toolkit detection on Ubuntu

This just extends D40453 (r319317) to Ubuntu.

Reviewed By: Hahnfeld, tra

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348504 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP][NVPTX] Fix globalization of the mapped array sections.
Alexey Bataev [Thu, 6 Dec 2018 15:35:13 +0000 (15:35 +0000)]
[OPENMP][NVPTX] Fix globalization of the mapped array sections.

If the array section is based on pointer and this sections is mapped in
target region + then it is used in the inner parallel region, it also
must be globalized as the pointer itself is passed by value, not by
reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348492 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDiagnose friend function template redefinitions.
Serge Pavlov [Thu, 6 Dec 2018 09:35:04 +0000 (09:35 +0000)]
Diagnose friend function template redefinitions.

Friend function template defined in a class template becomes available if
the enclosing class template is instantiated. Until the function template
is used, it does not have a body, but still is considered a definition for
the purpose of redeclaration checks.

This change modifies redefinition check so that it can find the friend
function template definitions in instantiated classes.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348473 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd test for ObjC generics
Stephen Kelly [Thu, 6 Dec 2018 09:23:59 +0000 (09:23 +0000)]
Add test for ObjC generics

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348471 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoExtend OMP test
Stephen Kelly [Thu, 6 Dec 2018 09:23:53 +0000 (09:23 +0000)]
Extend OMP test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348470 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake test resistant to line numbers changing
Stephen Kelly [Thu, 6 Dec 2018 09:22:12 +0000 (09:22 +0000)]
Make test resistant to line numbers changing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348469 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove unnecessary include.
Richard Trieu [Thu, 6 Dec 2018 06:32:40 +0000 (06:32 +0000)]
Remove unnecessary include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348459 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove CodeGen dependencies on Sema.
Richard Trieu [Thu, 6 Dec 2018 06:12:20 +0000 (06:12 +0000)]
Remove CodeGen dependencies on Sema.

Move diagnostics from Sema to Frontend (or Common) so that CodeGen no longer
needs to include the Sema diagnostic IDs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348458 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoARM, AArch64: support `__attribute__((__swiftcall__))`
Saleem Abdulrasool [Thu, 6 Dec 2018 03:28:37 +0000 (03:28 +0000)]
ARM, AArch64: support `__attribute__((__swiftcall__))`

Support the Swift calling convention on Windows ARM and AArch64.  Both
of these conform to the AAPCS, AAPCS64 calling convention, and LLVM has
been adjusted to account for the register usage.  Ensure that the
frontend passes this into the backend.  This allows the swift runtime to
be built for Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348454 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[darwin] remove version number check when enabling -fobjc-subscripting-legacy-runtime
Alex Lorenz [Thu, 6 Dec 2018 02:44:23 +0000 (02:44 +0000)]
[darwin] remove version number check when enabling -fobjc-subscripting-legacy-runtime

This subscripting feature actually works on older OS versions anyway.

rdar://36287065

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348448 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReapply fix from r348062 to fix test on Windows.
Douglas Yung [Thu, 6 Dec 2018 02:13:09 +0000 (02:13 +0000)]
Reapply fix from r348062 to fix test on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348447 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[attributes] Add more tests for os_returns_retained
George Karpenkov [Thu, 6 Dec 2018 01:21:38 +0000 (01:21 +0000)]
[attributes] Add more tests for os_returns_retained

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348443 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Sema/Attribute] Check for noderef attribute
Leonard Chan [Thu, 6 Dec 2018 01:05:54 +0000 (01:05 +0000)]
[Sema/Attribute] Check for noderef attribute

This patch adds the noderef attribute in clang and checks for dereferences of
types that have this attribute. This attribute is currently used by sparse and
would like to be ported to clang.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348442 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Sema] Push and Pop Expression Evaluation Context Records at the start and end of...
Leonard Chan [Thu, 6 Dec 2018 00:10:36 +0000 (00:10 +0000)]
[Sema] Push and Pop Expression Evaluation Context Records at the start and end of function definitions

This patch creates a new context for every function definition we enter.
Currently we do not push and pop on these, usually working off of the global
context record added in the Sema constructor, which never gets popped.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348434 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix title underlines being too short after r348429
Pete Cooper [Thu, 6 Dec 2018 00:01:44 +0000 (00:01 +0000)]
Fix title underlines being too short after r348429

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348431 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUpdate ARC docs as objc_storeStrong returns void not id
Pete Cooper [Wed, 5 Dec 2018 23:49:52 +0000 (23:49 +0000)]
Update ARC docs as objc_storeStrong returns void not id

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348429 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix test change from r348365 to deal with Windows paths correctly.
Douglas Yung [Wed, 5 Dec 2018 23:10:14 +0000 (23:10 +0000)]
Fix test change from r348365 to deal with Windows paths correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348425 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Hexagon] Add intrinsics for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 22:03:04 +0000 (22:03 +0000)]
[Hexagon] Add intrinsics for Hexagon V66

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348419 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Hexagon] Add support for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 21:38:35 +0000 (21:38 +0000)]
[Hexagon] Add support for Hexagon V66

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348415 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: Extract TextNodeDumper class
Stephen Kelly [Wed, 5 Dec 2018 21:12:39 +0000 (21:12 +0000)]
NFC: Extract TextNodeDumper class

Summary:
Start by moving some utilities to it. It will eventually house dumping
of individual nodes (after indentation etc has already been accounted
for).

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348412 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: Extract TextTreeStructure class
Stephen Kelly [Wed, 5 Dec 2018 20:53:14 +0000 (20:53 +0000)]
NFC: Extract TextTreeStructure class

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348410 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: Inline handling of DependentSizedArrayType
Stephen Kelly [Wed, 5 Dec 2018 20:34:07 +0000 (20:34 +0000)]
NFC: Inline handling of DependentSizedArrayType

Summary:
Re-order handling of getElementType and getBracketsRange. It is
necessary to perform all printing before any traversal to child nodes.

This causes no change in the output of ast-dump-array.cpp due to the way
child nodes are printed with a delay.  This new order of the code is
also the order that produces the expected output anyway.

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348409 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd dump tests for inherited default template parameters
Stephen Kelly [Wed, 5 Dec 2018 20:21:13 +0000 (20:21 +0000)]
Add dump tests for inherited default template parameters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348408 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[RISCV] Mark unit tests as "requires: riscv-registered-target""
Mandeep Singh Grang [Wed, 5 Dec 2018 19:19:38 +0000 (19:19 +0000)]
Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target""

This reverts commit 8908dd12e7bbfc74e264233e900206ad31e285f0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348402 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDo not check for parameters shadowing fields in function declarations.
Aaron Ballman [Wed, 5 Dec 2018 18:56:57 +0000 (18:56 +0000)]
Do not check for parameters shadowing fields in function declarations.

We would issue a false-positive diagnostic for parameters in function declarations shadowing fields; we now only issue the diagnostic on a function definition instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348400 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdding tests for -ast-dump; NFC.
Aaron Ballman [Wed, 5 Dec 2018 18:53:57 +0000 (18:53 +0000)]
Adding tests for -ast-dump; NFC.

This adds tests for various function and class template declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348399 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoHonor -fdebug-prefix-map when creating function names for the debug info.
Adrian Prantl [Wed, 5 Dec 2018 18:37:44 +0000 (18:37 +0000)]
Honor -fdebug-prefix-map when creating function names for the debug info.

This adds a callback to PrintingPolicy to allow CGDebugInfo to remap
file paths according to -fdebug-prefix-map. Otherwise the debug info
(particularly function names for C++ lambdas) may contain paths that
should have been remapped in the debug info.

<rdar://problem/46128056>

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348397 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Attribute for RetainCountChecker for OSObject should propagate with inheri...
George Karpenkov [Wed, 5 Dec 2018 18:34:54 +0000 (18:34 +0000)]
[analyzer] Attribute for RetainCountChecker for OSObject should propagate with inheritance

rdar://46388388

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348396 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMention changes to libc++ include dir lookup in release notes.
Ilya Biryukov [Wed, 5 Dec 2018 18:32:05 +0000 (18:32 +0000)]
Mention changes to libc++ include dir lookup in release notes.

Summary: The change itself landed as r348365, see the comment for more details.

Reviewers: arphaman, EricWF

Reviewed By: arphaman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348394 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAddress a post-commit review comment on r348325.
Erik Pilkington [Wed, 5 Dec 2018 17:43:26 +0000 (17:43 +0000)]
Address a post-commit review comment on r348325.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348388 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeComplete] Fix a crash in access checks of inner classes
Ilya Biryukov [Wed, 5 Dec 2018 17:38:39 +0000 (17:38 +0000)]
[CodeComplete] Fix a crash in access checks of inner classes

Summary: The crash was introduced in r348135.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348387 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Basic] Cleanups in IdentifierInfo following the removal of PTH
Bruno Ricci [Wed, 5 Dec 2018 17:16:55 +0000 (17:16 +0000)]
[Basic] Cleanups in IdentifierInfo following the removal of PTH

The Entry pointer in IdentifierInfo was only null for IdentifierInfo
created from a PTH. Now that PTH support has been removed we can remove
some PTH specific code in IdentifierInfo::getLength and
IdentifierInfo::getNameStart.

Also make the constructor of IdentifierInfo private to make sure that
they are only created by IdentifierTable, and move it to the header so
that it can be inlined in IdentifierTable::get and IdentifierTable::getOwn.

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

Reviewed By: erichkeane

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348384 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenCL] Diagnose conflicting address spaces in templates.
Anastasia Stulova [Wed, 5 Dec 2018 17:02:22 +0000 (17:02 +0000)]
[OpenCL] Diagnose conflicting address spaces in templates.

Added new diagnostic when templates are instantiated with
different address space from the one provided in its definition.

This also prevents deducing generic address space in pointer
type of templates to allow giving them concrete address space
during instantiation.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348382 91177308-0d34-0410-b5e6-96231b3b80d8