[PATCH] D79678: [clangd] Add CSV export for trace metrics

2020-05-10 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision.
kadircet marked 2 inline comments as done.
kadircet added a comment.
This revision is now accepted and ready to land.

Thanks, LGTM!




Comment at: clang-tools-extra/clangd/support/Trace.cpp:210
+assert(!needsQuote(Metric.Name));
+std::string QuotedLabel;
+if (needsQuote(Label))

do we ever expect to have any of `\r \n , "` in a label? I think it would be OK 
to just assert notNeedsQuote on Label.

Up to you though.



Comment at: clang-tools-extra/clangd/support/Trace.cpp:214
+uint64_t Micros = timestamp();
+std::string Scratch;
+Out << llvm::formatv("{0},{1},{2},{3:e},{4}.{5:3}\r\n",

unused var



Comment at: clang-tools-extra/clangd/support/Trace.cpp:215
+std::string Scratch;
+Out << llvm::formatv("{0},{1},{2},{3:e},{4}.{5:3}\r\n",
+ typeName(Metric.Type), Metric.Name, Label, Value,

acquire `Mu` before printing ?



Comment at: clang-tools-extra/clangd/support/Trace.cpp:221
+private:
+  llvm::StringRef typeName(Metric::MetricType T) {
+switch (T) {

why not use integers instead?



Comment at: clang-tools-extra/clangd/support/Trace.cpp:251
+using namespace std::chrono;
+return MicrosT0SinceEpoch +
+   duration(steady_clock::now() - 
SteadyT0).count();

what are the benefits for making these absolute apart from being able to merge 
streams coming from different runs?
I am not sure if we'll ever merge data from multiple users, or even multiple 
runs from the same user.

This would help decrease output size only by a couple percents though, so not 
that important. Just wondering if there are any other reasons.



Comment at: clang-tools-extra/clangd/unittests/support/TraceTests.cpp:183
+  llvm::SmallVector Lines;
+  llvm::StringRef(Output).split(Lines, "\r\n");
+  EXPECT_THAT(Lines, ElementsAre(_, StartsWith(R"(d,dist,",",1)"),

nit: maybe have a `getLines()` in the fixture.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79678/new/

https://reviews.llvm.org/D79678



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] dc0f79e - clang-tidy doc: add a note for checkers with an autofix

2020-05-10 Thread Sylvestre Ledru via cfe-commits

Author: Sylvestre Ledru
Date: 2020-05-10T11:25:19+02:00
New Revision: dc0f79ea5b99b9609a21c29089c294ab82d88094

URL: 
https://github.com/llvm/llvm-project/commit/dc0f79ea5b99b9609a21c29089c294ab82d88094
DIFF: 
https://github.com/llvm/llvm-project/commit/dc0f79ea5b99b9609a21c29089c294ab82d88094.diff

LOG: clang-tidy doc: add a note for checkers with an autofix

Summary:
Currently, when looking at a checker documentation, we have to go back
to the whole list or look at the sources to figure out if an autofix
is available or not.

Reviewers: alexfh, aaron.ballman

Subscribers: wuzish, Eugene.Zelenko, nemanjai, kbarton, arphaman, Charusso, 
cfe-commits

Tags: #clang

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

Added: 


Modified: 
clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst

clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
clang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst
clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst

Removed: 




diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst 
b/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
index 3dfeb299de06..de520e9511c7 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
@@ -40,3 +40,8 @@ Options
constructors - no constructor initializers). When the function body is 
empty,
an unused parameter is unlikely to be unnoticed by a human reader, and
there's basically no place for a bug to hide.
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.

diff  --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst 
b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst
index 82c290e4a21b..35be77d11c08 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst
@@ -86,3 +86,8 @@ that accepts 2 arguments. With permissive parameter list, it 
instead generates
 which is correct.
   
 This check requires using C++14 or higher to run.
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
 
b/clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
index f217ff090445..a36d58e4e31d 100644
--- 
a/clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
+++ 
b/clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
@@ -15,3 +15,8 @@ Deprecated member type   Replacement
 ``std::ios_base::streamoff``  
 ``std::ios_base::streampos`` 
 ===  ===
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst 
b/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
index 82b27bbe9020..89d4a0c95a01 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
@@ -265,3 +265,8 @@ exclude incorrect diagnostics on OpenMP for loops prior to 
OpenMP 5.
 To prevent this check to be applied (and to break) OpenMP for loops but still 
be
 applied to non-OpenMP for loops the usage of ``NOLINT`` (see
 :ref:`clang-tidy-nolint`) on the specific for loops is recommended.
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst 
b/clang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst
index e73b32034f3d..f81ac2c9cbb9 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst
@@ -48,3 +48,8 @@ Options
 
If set to non-zero, the check will not give warnings inside macros. Default
is `1`.
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst 
b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst
index 792d3a4c3dc4..09556800ed86 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst
+

[clang-tools-extra] b082813 - clang-tidy doc: Fix the syntax to use rst list type

2020-05-10 Thread Sylvestre Ledru via cfe-commits

Author: Sylvestre Ledru
Date: 2020-05-10T11:25:20+02:00
New Revision: b0828135dbe3ee52a15163856008bcf05e81ccf8

URL: 
https://github.com/llvm/llvm-project/commit/b0828135dbe3ee52a15163856008bcf05e81ccf8
DIFF: 
https://github.com/llvm/llvm-project/commit/b0828135dbe3ee52a15163856008bcf05e81ccf8.diff

LOG: clang-tidy doc: Fix the syntax to use rst list type

Added: 


Modified: 
clang-tools-extra/docs/clang-tidy/checks/bugprone-reserved-identifier.rst

Removed: 




diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone-reserved-identifier.rst 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone-reserved-identifier.rst
index 203b1f4df9c1..388acf87efc7 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-reserved-identifier.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-reserved-identifier.rst
@@ -8,8 +8,9 @@ bugprone-reserved-identifier
 Checks for usages of identifiers reserved for use by the implementation. 
 
 The C and C++ standards both reserve the following names for such use:
-* identifiers that begin with an underscore followed by an uppercase letter;
-* identifiers in the global namespace that begin with an underscore.
+
+- identifiers that begin with an underscore followed by an uppercase letter;
+- identifiers in the global namespace that begin with an underscore.
 
 The C standard additionally reserves names beginning with a double underscore,
 while the C++ standard strengthens this to reserve names with a double 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] f97f92e - add_new_check.py: Update of the template to add an autofix section

2020-05-10 Thread Sylvestre Ledru via cfe-commits

Author: Sylvestre Ledru
Date: 2020-05-10T11:25:19+02:00
New Revision: f97f92e5b0fd14240c2ec27c44e1b3cfddfdf668

URL: 
https://github.com/llvm/llvm-project/commit/f97f92e5b0fd14240c2ec27c44e1b3cfddfdf668
DIFF: 
https://github.com/llvm/llvm-project/commit/f97f92e5b0fd14240c2ec27c44e1b3cfddfdf668.diff

LOG: add_new_check.py: Update of the template to add an autofix section

Summary: As discussed here: https://reviews.llvm.org/D77983

Reviewers: alexfh

Subscribers: cfe-commits

Tags: #clang

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

Added: 


Modified: 
clang-tools-extra/clang-tidy/add_new_check.py

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/add_new_check.py 
b/clang-tools-extra/clang-tidy/add_new_check.py
index 4477444cc127..fa8b4da4d624 100755
--- a/clang-tools-extra/clang-tidy/add_new_check.py
+++ b/clang-tools-extra/clang-tidy/add_new_check.py
@@ -391,6 +391,30 @@ def write_docs(module_path, module, check_name):
 %(underline)s
 
 FIXME: Describe what patterns does the check detect and why. Give examples.
+
+FIXME: Remove of the following section:
+
+Automatic Fixes
+^^^
+
+The check doesn't provide an automatic fix.
+
+or
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.
+
+or
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes in the following cases:
+1.
+2.
+3.
 """ % {'check_name_dashes': check_name_dashes,
'underline': '=' * len(check_name_dashes)})
 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] a832fc4 - Revert two patches, not ready to be shared

2020-05-10 Thread Sylvestre Ledru via cfe-commits

Author: Sylvestre Ledru
Date: 2020-05-10T11:27:13+02:00
New Revision: a832fc4b0c1e056edbb458973fac1f0c6db7a9e5

URL: 
https://github.com/llvm/llvm-project/commit/a832fc4b0c1e056edbb458973fac1f0c6db7a9e5
DIFF: 
https://github.com/llvm/llvm-project/commit/a832fc4b0c1e056edbb458973fac1f0c6db7a9e5.diff

LOG: Revert two patches, not ready to be shared

Revert "clang-tidy doc: add a note for checkers with an autofix"

This reverts commit dc0f79ea5b99b9609a21c29089c294ab82d88094.

Revert "add_new_check.py: Update of the template to add an autofix section"

This reverts commit f97f92e5b0fd14240c2ec27c44e1b3cfddfdf668.

Added: 


Modified: 
clang-tools-extra/clang-tidy/add_new_check.py
clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst

clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
clang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst
clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/add_new_check.py 
b/clang-tools-extra/clang-tidy/add_new_check.py
index fa8b4da4d624..4477444cc127 100755
--- a/clang-tools-extra/clang-tidy/add_new_check.py
+++ b/clang-tools-extra/clang-tidy/add_new_check.py
@@ -391,30 +391,6 @@ def write_docs(module_path, module, check_name):
 %(underline)s
 
 FIXME: Describe what patterns does the check detect and why. Give examples.
-
-FIXME: Remove of the following section:
-
-Automatic Fixes
-^^^
-
-The check doesn't provide an automatic fix.
-
-or
-
-Automatic Fixes
-^^^
-
-The check provides suggested fixes. See the documentation above for the 
details.
-
-or
-
-Automatic Fixes
-^^^
-
-The check provides suggested fixes in the following cases:
-1.
-2.
-3.
 """ % {'check_name_dashes': check_name_dashes,
'underline': '=' * len(check_name_dashes)})
 

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst 
b/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
index de520e9511c7..3dfeb299de06 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
@@ -40,8 +40,3 @@ Options
constructors - no constructor initializers). When the function body is 
empty,
an unused parameter is unlikely to be unnoticed by a human reader, and
there's basically no place for a bug to hide.
-
-Automatic Fixes
-^^^
-
-The check provides suggested fixes. See the documentation above for the 
details.

diff  --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst 
b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst
index 35be77d11c08..82c290e4a21b 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst
@@ -86,8 +86,3 @@ that accepts 2 arguments. With permissive parameter list, it 
instead generates
 which is correct.
   
 This check requires using C++14 or higher to run.
-
-Automatic Fixes
-^^^
-
-The check provides suggested fixes. See the documentation above for the 
details.

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
 
b/clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
index a36d58e4e31d..f217ff090445 100644
--- 
a/clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
+++ 
b/clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
@@ -15,8 +15,3 @@ Deprecated member type   Replacement
 ``std::ios_base::streamoff``  
 ``std::ios_base::streampos`` 
 ===  ===
-
-Automatic Fixes
-^^^
-
-The check provides suggested fixes. See the documentation above for the 
details.

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst 
b/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
index 89d4a0c95a01..82b27bbe9020 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
@@ -265,8 +265,3 @@ exclude incorrect diagnostics on OpenMP for loops prior to 
OpenMP 5.
 To prevent this check to be applied (and to break) OpenMP for loops but still 
be
 applied to non-OpenMP for loops the usage of ``NOLINT`` (see
 :ref:`clang-tidy-nolint`) on the specific for loops is recommended.
-
-Automatic Fixes
-^^^
-
-The check provides suggested fixes. See the documentation above for the 
details.

diff  --git 
a/clang-tools-extra/d

[PATCH] D77983: clang-tidy doc: add a note for every checker with an autofix

2020-05-10 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru added a comment.

@alexfh ping


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77983/new/

https://reviews.llvm.org/D77983



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D78052: add_new_check.py: Update of the template to add an autofix section

2020-05-10 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru added a comment.

@alexfh ping ? :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78052/new/

https://reviews.llvm.org/D78052



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D77983: clang-tidy doc: add a note for every checker with an autofix

2020-05-10 Thread Sylvestre Ledru via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGdc0f79ea5b99: clang-tidy doc: add a note for checkers with 
an autofix (authored by sylvestre.ledru).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77983/new/

https://reviews.llvm.org/D77983

Files:
  clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
  clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst
  
clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
  clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
  clang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst
  clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst


Index: clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst
+++ clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst
@@ -26,3 +26,8 @@
 
If set to non-zero, the check will not give warnings inside macros. Default
is `1`.
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.
Index: clang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst
+++ clang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst
@@ -48,3 +48,8 @@
 
If set to non-zero, the check will not give warnings inside macros. Default
is `1`.
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.
Index: clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
+++ clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst
@@ -265,3 +265,8 @@
 To prevent this check to be applied (and to break) OpenMP for loops but still 
be
 applied to non-OpenMP for loops the usage of ``NOLINT`` (see
 :ref:`clang-tidy-nolint`) on the specific for loops is recommended.
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.
Index: 
clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
===
--- 
clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
+++ 
clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-ios-base-aliases.rst
@@ -15,3 +15,8 @@
 ``std::ios_base::streamoff``  
 ``std::ios_base::streampos`` 
 ===  ===
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.
Index: clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst
+++ clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst
@@ -86,3 +86,8 @@
 which is correct.
   
 This check requires using C++14 or higher to run.
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.
Index: clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
+++ clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst
@@ -40,3 +40,8 @@
constructors - no constructor initializers). When the function body is 
empty,
an unused parameter is unlikely to be unnoticed by a human reader, and
there's basically no place for a bug to hide.
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.


Index: clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst
+++ clang-tools-extra/docs/clang-tidy/checks/modernize-use-bool-literals.rst
@@ -26,3 +26,8 @@
 
If set to non-zero, the check will not give warnings inside macros. Default
is `1`.
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the details.
Index: clang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst
===
--- clang-tools-

[PATCH] D78052: add_new_check.py: Update of the template to add an autofix section

2020-05-10 Thread Sylvestre Ledru via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf97f92e5b0fd: add_new_check.py: Update of the template to 
add an autofix section (authored by sylvestre.ledru).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78052/new/

https://reviews.llvm.org/D78052

Files:
  clang-tools-extra/clang-tidy/add_new_check.py


Index: clang-tools-extra/clang-tidy/add_new_check.py
===
--- clang-tools-extra/clang-tidy/add_new_check.py
+++ clang-tools-extra/clang-tidy/add_new_check.py
@@ -391,6 +391,30 @@
 %(underline)s
 
 FIXME: Describe what patterns does the check detect and why. Give examples.
+
+FIXME: Remove of the following section:
+
+Automatic Fixes
+^^^
+
+The check doesn't provide an automatic fix.
+
+or
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the 
details.
+
+or
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes in the following cases:
+1.
+2.
+3.
 """ % {'check_name_dashes': check_name_dashes,
'underline': '=' * len(check_name_dashes)})
 


Index: clang-tools-extra/clang-tidy/add_new_check.py
===
--- clang-tools-extra/clang-tidy/add_new_check.py
+++ clang-tools-extra/clang-tidy/add_new_check.py
@@ -391,6 +391,30 @@
 %(underline)s
 
 FIXME: Describe what patterns does the check detect and why. Give examples.
+
+FIXME: Remove of the following section:
+
+Automatic Fixes
+^^^
+
+The check doesn't provide an automatic fix.
+
+or
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes. See the documentation above for the details.
+
+or
+
+Automatic Fixes
+^^^
+
+The check provides suggested fixes in the following cases:
+1.
+2.
+3.
 """ % {'check_name_dashes': check_name_dashes,
'underline': '=' * len(check_name_dashes)})
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] 35d867a - [clangd] Filter pch related flags coming from the user

2020-05-10 Thread Kadir Cetinkaya via cfe-commits

Author: Kadir Cetinkaya
Date: 2020-05-10T13:03:59+02:00
New Revision: 35d867a790c2bcf2008b2ee1895ae8af2793b797

URL: 
https://github.com/llvm/llvm-project/commit/35d867a790c2bcf2008b2ee1895ae8af2793b797
DIFF: 
https://github.com/llvm/llvm-project/commit/35d867a790c2bcf2008b2ee1895ae8af2793b797.diff

LOG: [clangd] Filter pch related flags coming from the user

Summary:
PCH format is unstable, hence using a preamble built with a different
version of clang (or even worse, a different compiler) might result in
unexpected behaviour.

PCH creation on the other hand is something clangd wouldn't want to perform, as
it doesn't generate any output files.

This patch makes sure clangd drops any PCH related compile commands after
parsing the command line args.

Fixes https://github.com/clangd/clangd/issues/248

Reviewers: sammccall

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, 
cfe-commits

Tags: #clang

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

Added: 
clang-tools-extra/clangd/unittests/CompilerTests.cpp

Modified: 
clang-tools-extra/clangd/Compiler.cpp
clang-tools-extra/clangd/unittests/CMakeLists.txt

Removed: 




diff  --git a/clang-tools-extra/clangd/Compiler.cpp 
b/clang-tools-extra/clangd/Compiler.cpp
index 957d7c382125..04d48b08865d 100644
--- a/clang-tools-extra/clangd/Compiler.cpp
+++ b/clang-tools-extra/clangd/Compiler.cpp
@@ -41,8 +41,7 @@ void 
IgnoreDiagnostics::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
 }
 
 std::unique_ptr
-buildCompilerInvocation(const ParseInputs &Inputs,
-clang::DiagnosticConsumer &D,
+buildCompilerInvocation(const ParseInputs &Inputs, clang::DiagnosticConsumer 
&D,
 std::vector *CC1Args) {
   std::vector ArgStrs;
   for (const auto &S : Inputs.CompileCommand.CommandLine)
@@ -74,6 +73,15 @@ buildCompilerInvocation(const ParseInputs &Inputs,
   CI->getDependencyOutputOpts().HeaderIncludeOutputFile.clear();
   CI->getDependencyOutputOpts().DOTOutputFile.clear();
   CI->getDependencyOutputOpts().ModuleDependencyOutputDir.clear();
+
+  // Disable any pch generation/usage operations. Since serialized preamble
+  // format is unstable, using an incompatible one might result in unexpected
+  // behaviours, including crashes.
+  CI->getPreprocessorOpts().ImplicitPCHInclude.clear();
+  CI->getPreprocessorOpts().PrecompiledPreambleBytes = {0, false};
+  CI->getPreprocessorOpts().PCHThroughHeader.clear();
+  CI->getPreprocessorOpts().PCHWithHdrStop = false;
+  CI->getPreprocessorOpts().PCHWithHdrStopCreate = false;
   return CI;
 }
 

diff  --git a/clang-tools-extra/clangd/unittests/CMakeLists.txt 
b/clang-tools-extra/clangd/unittests/CMakeLists.txt
index cccb3ce7308a..a1f6af6747f4 100644
--- a/clang-tools-extra/clangd/unittests/CMakeLists.txt
+++ b/clang-tools-extra/clangd/unittests/CMakeLists.txt
@@ -34,6 +34,7 @@ add_unittest(ClangdUnitTests ClangdTests
   CodeCompletionStringsTests.cpp
   CollectMacrosTests.cpp
   CompileCommandsTests.cpp
+  CompilerTests.cpp
   DexTests.cpp
   DiagnosticsTests.cpp
   DraftStoreTests.cpp

diff  --git a/clang-tools-extra/clangd/unittests/CompilerTests.cpp 
b/clang-tools-extra/clangd/unittests/CompilerTests.cpp
new file mode 100644
index ..a12a7b9ce9af
--- /dev/null
+++ b/clang-tools-extra/clangd/unittests/CompilerTests.cpp
@@ -0,0 +1,55 @@
+//===-- CompilerTests.cpp 
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "Compiler.h"
+#include "TestTU.h"
+#include "clang/Lex/PreprocessorOptions.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+namespace clang {
+namespace clangd {
+namespace {
+
+using testing::IsEmpty;
+
+TEST(BuildCompilerInvocation, DropsPCH) {
+  IgnoreDiagnostics Diags;
+  TestTU TU;
+  TU.AdditionalFiles["test.h.pch"] = "";
+
+  TU.ExtraArgs = {"-include-pch", "test.h.pch"};
+  EXPECT_THAT(buildCompilerInvocation(TU.inputs(), Diags)
+  ->getPreprocessorOpts()
+  .ImplicitPCHInclude,
+  IsEmpty());
+
+  // Transparent include translation
+  TU.ExtraArgs = {"-include", "test.h"};
+  EXPECT_THAT(buildCompilerInvocation(TU.inputs(), Diags)
+  ->getPreprocessorOpts()
+  .ImplicitPCHInclude,
+  IsEmpty());
+
+  // CL mode parsing.
+  TU.AdditionalFiles["test.pch"] = "";
+  TU.ExtraArgs = {"--driver-mode=cl"};
+  TU.ExtraArgs.push_back("/Yutest.h");
+  EXPECT_THAT(buildCompilerInvocation(TU.inputs(), Diags)
+  ->getPreprocessorOpts()
+  .ImplicitPCHInclude,
+  IsEmpty());
+  EXPECT_THAT(buildCo

[PATCH] D79669: [clangd] Filter pch related flags coming from the user

2020-05-10 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG35d867a790c2: [clangd] Filter pch related flags coming from 
the user (authored by kadircet).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79669/new/

https://reviews.llvm.org/D79669

Files:
  clang-tools-extra/clangd/Compiler.cpp
  clang-tools-extra/clangd/unittests/CMakeLists.txt
  clang-tools-extra/clangd/unittests/CompilerTests.cpp

Index: clang-tools-extra/clangd/unittests/CompilerTests.cpp
===
--- /dev/null
+++ clang-tools-extra/clangd/unittests/CompilerTests.cpp
@@ -0,0 +1,55 @@
+//===-- CompilerTests.cpp -===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "Compiler.h"
+#include "TestTU.h"
+#include "clang/Lex/PreprocessorOptions.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+namespace clang {
+namespace clangd {
+namespace {
+
+using testing::IsEmpty;
+
+TEST(BuildCompilerInvocation, DropsPCH) {
+  IgnoreDiagnostics Diags;
+  TestTU TU;
+  TU.AdditionalFiles["test.h.pch"] = "";
+
+  TU.ExtraArgs = {"-include-pch", "test.h.pch"};
+  EXPECT_THAT(buildCompilerInvocation(TU.inputs(), Diags)
+  ->getPreprocessorOpts()
+  .ImplicitPCHInclude,
+  IsEmpty());
+
+  // Transparent include translation
+  TU.ExtraArgs = {"-include", "test.h"};
+  EXPECT_THAT(buildCompilerInvocation(TU.inputs(), Diags)
+  ->getPreprocessorOpts()
+  .ImplicitPCHInclude,
+  IsEmpty());
+
+  // CL mode parsing.
+  TU.AdditionalFiles["test.pch"] = "";
+  TU.ExtraArgs = {"--driver-mode=cl"};
+  TU.ExtraArgs.push_back("/Yutest.h");
+  EXPECT_THAT(buildCompilerInvocation(TU.inputs(), Diags)
+  ->getPreprocessorOpts()
+  .ImplicitPCHInclude,
+  IsEmpty());
+  EXPECT_THAT(buildCompilerInvocation(TU.inputs(), Diags)
+  ->getPreprocessorOpts()
+  .PCHThroughHeader,
+  IsEmpty());
+}
+
+} // namespace
+} // namespace clangd
+} // namespace clang
Index: clang-tools-extra/clangd/unittests/CMakeLists.txt
===
--- clang-tools-extra/clangd/unittests/CMakeLists.txt
+++ clang-tools-extra/clangd/unittests/CMakeLists.txt
@@ -34,6 +34,7 @@
   CodeCompletionStringsTests.cpp
   CollectMacrosTests.cpp
   CompileCommandsTests.cpp
+  CompilerTests.cpp
   DexTests.cpp
   DiagnosticsTests.cpp
   DraftStoreTests.cpp
Index: clang-tools-extra/clangd/Compiler.cpp
===
--- clang-tools-extra/clangd/Compiler.cpp
+++ clang-tools-extra/clangd/Compiler.cpp
@@ -41,8 +41,7 @@
 }
 
 std::unique_ptr
-buildCompilerInvocation(const ParseInputs &Inputs,
-clang::DiagnosticConsumer &D,
+buildCompilerInvocation(const ParseInputs &Inputs, clang::DiagnosticConsumer &D,
 std::vector *CC1Args) {
   std::vector ArgStrs;
   for (const auto &S : Inputs.CompileCommand.CommandLine)
@@ -74,6 +73,15 @@
   CI->getDependencyOutputOpts().HeaderIncludeOutputFile.clear();
   CI->getDependencyOutputOpts().DOTOutputFile.clear();
   CI->getDependencyOutputOpts().ModuleDependencyOutputDir.clear();
+
+  // Disable any pch generation/usage operations. Since serialized preamble
+  // format is unstable, using an incompatible one might result in unexpected
+  // behaviours, including crashes.
+  CI->getPreprocessorOpts().ImplicitPCHInclude.clear();
+  CI->getPreprocessorOpts().PrecompiledPreambleBytes = {0, false};
+  CI->getPreprocessorOpts().PCHThroughHeader.clear();
+  CI->getPreprocessorOpts().PCHWithHdrStop = false;
+  CI->getPreprocessorOpts().PCHWithHdrStopCreate = false;
   return CI;
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D78052: add_new_check.py: Update of the template to add an autofix section

2020-05-10 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru added a comment.

has been reverted


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78052/new/

https://reviews.llvm.org/D78052



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D77983: clang-tidy doc: add a note for every checker with an autofix

2020-05-10 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru reopened this revision.
sylvestre.ledru added a comment.

has been reverted


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77983/new/

https://reviews.llvm.org/D77983



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79477: [clang-tidy] Add --use-color command line option and UseColor option to control colors in diagnostics

2020-05-10 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment.

In D79477#2027978 , @hyd-dev wrote:

> None of the clang-tidy command line options are prefixed with `-f`.
>  This command line option used to be `--color-diagnostics`, but I've followed 
> @hokein's advice to change it to `--use-color`.
>  If you mean to use the `-fcolor-diagnostics` option from 
> `compile_commands.json`, clang-tidy and clang are two separate tools. The 
> users may not want them to share the same setting, because they may invoke 
> them in different environments.


Fair point, will this option also control the color of the diagnostics emitted 
by clang or just clang tidy specific diagnostics?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79477/new/

https://reviews.llvm.org/D79477



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79526: [CUDA][HIP] Workaround for resolving host device function against wrong-sided function

2020-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 263041.
yaxunl marked 2 inline comments as done.
yaxunl added a comment.

introduce Sema::IsCUDAImplicitHostDeviceFunction() and remove changes to 
IdentifyCUDATarget and IdentifyCUDAPreference. Added one more test.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79526/new/

https://reviews.llvm.org/D79526

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/Sema/SemaCUDA.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/test/SemaCUDA/function-overload.cu

Index: clang/test/SemaCUDA/function-overload.cu
===
--- clang/test/SemaCUDA/function-overload.cu
+++ clang/test/SemaCUDA/function-overload.cu
@@ -1,8 +1,8 @@
 // REQUIRES: x86-registered-target
 // REQUIRES: nvptx-registered-target
 
-// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify %s
-// RUN: %clang_cc1 -std=c++11 -triple nvptx64-nvidia-cuda -fsyntax-only -fcuda-is-device -verify %s
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++14 -triple nvptx64-nvidia-cuda -fsyntax-only -fcuda-is-device -verify %s
 
 #include "Inputs/cuda.h"
 
@@ -463,3 +463,72 @@
 void foo() {
   __test();
 }
+
+// Test resolving implicit host device candidate vs wrong-sided candidate.
+// In device compilation, implicit host device caller choose implicit host
+// device candidate and wrong-sided candidate with equal preference.
+namespace ImplicitHostDeviceVsWrongSided {
+inline double callee(double x);
+#pragma clang force_cuda_host_device begin
+inline void callee(int x);
+inline double implicit_hd_caller() {
+  return callee(1.0);
+}
+#pragma clang force_cuda_host_device end
+}
+
+// Test resolving implicit host device candidate vs wrong-sided candidate.
+// In host compilation, implicit host device caller choose implicit host
+// device candidate and same-sided candidate with equal preference.
+namespace ImplicitHostDeviceVsSameSide {
+inline void callee(int x);
+#pragma clang force_cuda_host_device begin
+inline double callee(double x);
+inline double implicit_hd_caller() {
+  return callee(1.0);
+}
+#pragma clang force_cuda_host_device end
+}
+
+// In the implicit host device function 'caller', the second 'callee' should be
+// since it has better match, even though it is an implicit host device function
+// whereas the first 'callee' is a host function. A diagnostic will be emitted
+// if the first 'callee' is chosen since deduced return type cannot be used
+// before it is defined.
+namespace ImplicitHostDeviceByConstExpr {
+template  a b;
+auto callee(...);
+template  constexpr auto callee(d) -> decltype(0);
+struct e {
+  template  static auto g(ad, f...) {
+return h)...>;
+  }
+  struct i {
+template  static constexpr auto caller(f... k) {
+  return callee(k...);
+}
+  };
+  template  static auto h() {
+return i::caller;
+  }
+};
+class l {
+  l() {
+e::g([] {}, this);
+  }
+};
+}
+
+// Test resolving explicit host device candidate vs. wrong-sided candidate.
+// Explicit host device caller favors host device candidate against wrong-sided
+// candidate.
+namespace ExplicitHostDeviceVsWrongSided {
+inline double callee(double x);
+inline __host__ __device__ void callee(int x);
+inline __host__ __device__ double explicit_hd_caller() {
+  return callee(1.0);
+#if __CUDA_ARCH__
+  // expected-error@-2 {{cannot initialize return object of type 'double' with an rvalue of type 'void'}}
+#endif
+}
+}
Index: clang/lib/Sema/SemaOverload.cpp
===
--- clang/lib/Sema/SemaOverload.cpp
+++ clang/lib/Sema/SemaOverload.cpp
@@ -9517,11 +9517,27 @@
   // in global variable initializers once proper context is added.
   if (S.getLangOpts().CUDA && Cand1.Function && Cand2.Function) {
 if (FunctionDecl *Caller = dyn_cast(S.CurContext)) {
+  bool IsCallerImplicitHD = S.IsCUDAImplicitHostDeviceFunction(Caller);
+  bool IsCand1ImplicitHD =
+  S.IsCUDAImplicitHostDeviceFunction(Cand1.Function);
+  bool IsCand2ImplicitHD =
+  S.IsCUDAImplicitHostDeviceFunction(Cand2.Function);
   auto P1 = S.IdentifyCUDAPreference(Caller, Cand1.Function);
   auto P2 = S.IdentifyCUDAPreference(Caller, Cand2.Function);
   assert(P1 != Sema::CFP_Never && P2 != Sema::CFP_Never);
-  auto Cand1Emittable = P1 > Sema::CFP_WrongSide;
-  auto Cand2Emittable = P2 > Sema::CFP_WrongSide;
+  // The implicit HD function may be a function in a system header which
+  // is forced by pragma. In device compilation, if we prefer HD candidates
+  // over wrong-sided candidates, overloading resolution may change, which
+  // may result in non-deferrable diagnostics. As a workaround, we let
+  // implicit HD candidates take equal preference as wrong-sided candidates.
+  // This will preserve the overloading resolution.
+  auto EmitThreshold =
+  (S.getLangOp

[PATCH] D33029: [clang-format] add option for dangling parenthesis

2020-05-10 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment.

In D33029#2028254 , @bbassi wrote:

> @MyDeveloperDay Thanks. This would be my first revision and I have few 
> questions before I start coding. Would you be able to answer those over 
> email? They are mainly about the design of clang-format and some existing 
> options.


ask away


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D33029/new/

https://reviews.llvm.org/D33029



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79526: [CUDA][HIP] Workaround for resolving host device function against wrong-sided function

2020-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done.
yaxunl added a comment.

In D79526#2027695 , @tra wrote:

> This one is just a FYI. I've managed to reduce the failure in the first 
> version of this patch and it looks rather odd because the reduced test case 
> has nothing to do with CUDA. Instead it appears to introduce a difference in 
> compilation of regular host-only C++ code with `-x cuda` vs -x `c++`. I'm not 
> sure how/why first version caused this and why the latest one fixes it. It 
> may be worth double checking that we're not missing something here.
>
>   template  a b;
>   auto c(...);
>   template  constexpr auto c(d) -> decltype(0);
>   struct e {
> template  static auto g(ad, f...) {
>   h)...>;
> }
> struct i {
>   template  static constexpr auto j(f... k) { c(k...); 
> }
> };
> template  static auto h() { i::j; }
>   };
>   class l {
> l() {
>   e::g([] {}, this);
> }
>   };
>


function j is an implicit host device function, it calls function c. There are 
two candidates: the first one is a host function, the second one is an implicit 
host device function.

Assuming this code is originally C++ code, the author intends the second to be 
chosen since it is a better match. The code will fail to compile if the first 
one is chosen since its return type cannot be deduced.

Now we compile it as CUDA code and constexpr functions automatically become 
implicit host device function. In host compilation we do not need special 
handling since host device candidates and same-sided candidates are both 
viable. There was a bug which used special handling of implicit host device 
function in host compilation, which was fixed by my last update.

Basically we only need special handling for implicit host device function in 
device compilation. In host compilation we always use the normal overloading 
resolution. For explicit host device functions we always use the normal 
overloading resolution.




Comment at: clang/include/clang/Sema/Sema.h:11663
+bool IgnoreImplicitHDAttr = false,
+bool *IsImplicitHDAttr = nullptr);
   CUDAFunctionTarget IdentifyCUDATarget(const ParsedAttributesView &Attrs);

tra wrote:
> Plumbing an optional output argument it through multiple levels of callers as 
> an output argument is rather hard to follow, especially considering that it's 
> not set in all code paths. Perhaps we can turn IsImplicitHDAttr into a 
> separate function and call it from isBetterOverloadCandidate().
will do



Comment at: clang/test/SemaCUDA/function-overload.cu:471-477
+inline double callee(double x);
+#pragma clang force_cuda_host_device begin
+inline void callee(int x);
+inline double implicit_hd_caller() {
+  return callee(1.0);
+}
+#pragma clang force_cuda_host_device end

tra wrote:
> These tests only veryfy that the code compiled, but it does not guarantee 
> that we've picked the correct overload.
> You should give callees different return types and assign the result to a 
> variable of intended type.  See `test_host_device_calls_hd_template() ` on 
> line 341 for an example.
they have different return types. The right one returns double and the wrong 
one returns void. If the wrong one is chosen, there is syntax error since the 
caller returns double.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79526/new/

https://reviews.llvm.org/D79526



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79477: [clang-tidy] Add --use-color command line option and UseColor option to control colors in diagnostics

2020-05-10 Thread hyd-dev via Phabricator via cfe-commits
hyd-dev added a comment.

> Fair point, will this option also control the color of the diagnostics 
> emitted by clang or just clang tidy specific diagnostics?

This option sets `DiagOpts->ShowColors` to `true`. As I known, it controls 
**all** diagnostics reported by the `clang-tidy` program (by 
`clang::tidy::(anonymous namespace)::ErrorReporter`), including 
`clang-diagnostic-*` and other clang-tidy checks.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79477/new/

https://reviews.llvm.org/D79477



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79477: [clang-tidy] Add --use-color command line option and UseColor option to control colors in diagnostics

2020-05-10 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment.

In D79477#2028609 , @hyd-dev wrote:

> This option sets `DiagOpts->ShowColors` to `true`. As I known, it controls 
> **all** diagnostics reported by the `clang-tidy` program (by 
> `clang::tidy::(anonymous namespace)::ErrorReporter`), including 
> `clang-diagnostic-*` and other clang-tidy checks.


Would a test case be needed?




Comment at: clang-tools-extra/test/clang-tidy/infrastructure/use-color.cpp:10
+// RUN: clang-tidy -checks='-*, modernize-use-override' -extra-arg=-std=c++11 
-use-color=false %s | FileCheck -check-prefix=CHECK-NO-COLOR %s
+// RUN: clang-tidy -checks='-*, modernize-use-override' -extra-arg=-std=c++11 
%s | FileCheck -check-prefix=CHECK-NO-COLOR %s
+// RUN: clang-tidy -checks='-*, modernize-use-override' -extra-arg=-std=c++11 
-use-color %s | FileCheck -check-prefix=CHECK-COLOR %s

Not a fan of this test case as it only demonstrates the color behaviour of the 
process running the check not the actual option itself


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79477/new/

https://reviews.llvm.org/D79477



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D78129: Add Marvell ThunderX3T110 support

2020-05-10 Thread Wei Zhao via Phabricator via cfe-commits
wxz2020 updated this revision to Diff 263070.
wxz2020 added a comment.

1. Added the predicates as suggested
2. brought back the TargetParserTest.cpp which was missed last time


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78129/new/

https://reviews.llvm.org/D78129

Files:
  llvm/include/llvm/Support/AArch64TargetParser.def
  llvm/lib/Target/AArch64/AArch64.td
  llvm/lib/Target/AArch64/AArch64SchedA53.td
  llvm/lib/Target/AArch64/AArch64SchedA57.td
  llvm/lib/Target/AArch64/AArch64SchedCyclone.td
  llvm/lib/Target/AArch64/AArch64SchedExynosM3.td
  llvm/lib/Target/AArch64/AArch64SchedExynosM4.td
  llvm/lib/Target/AArch64/AArch64SchedExynosM5.td
  llvm/lib/Target/AArch64/AArch64SchedFalkor.td
  llvm/lib/Target/AArch64/AArch64SchedKryo.td
  llvm/lib/Target/AArch64/AArch64SchedThunderX.td
  llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td
  llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td
  llvm/lib/Target/AArch64/AArch64Subtarget.cpp
  llvm/lib/Target/AArch64/AArch64Subtarget.h
  llvm/test/CodeGen/AArch64/aarch64-combine-fmul-fsub.mir
  llvm/test/CodeGen/AArch64/cpus.ll
  llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
  llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
  llvm/test/CodeGen/AArch64/remat.ll
  llvm/unittests/Support/TargetParserTest.cpp

Index: llvm/unittests/Support/TargetParserTest.cpp
===
--- llvm/unittests/Support/TargetParserTest.cpp
+++ llvm/unittests/Support/TargetParserTest.cpp
@@ -942,6 +942,11 @@
   "thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
   AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_LSE |
   AArch64::AEK_RDM | AArch64::AEK_FP | AArch64::AEK_SIMD, "8.1-A"));
+  EXPECT_TRUE(testAArch64CPU(
+  "thunderx3t100", "armv8.3-a", "crypto-neon-fp-armv8",
+  AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_LSE |
+  AArch64::AEK_RDM | AArch64::AEK_FP | AArch64::AEK_SIMD |
+  AArch64::AEK_PROFILE | AArch64::AEK_RAS, "8.3-A"));
   EXPECT_TRUE(testAArch64CPU(
   "thunderx", "armv8-a", "crypto-neon-fp-armv8",
   AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD |
@@ -983,7 +988,7 @@
   "8.2-A"));
 }
 
-static constexpr unsigned NumAArch64CPUArchs = 38;
+static constexpr unsigned NumAArch64CPUArchs = 39;
 
 TEST(TargetParserTest, testAArch64CPUArchList) {
   SmallVector List;
Index: llvm/test/CodeGen/AArch64/remat.ll
===
--- llvm/test/CodeGen/AArch64/remat.ll
+++ llvm/test/CodeGen/AArch64/remat.ll
@@ -19,6 +19,7 @@
 ; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=thunderx2t99 -o - %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=tsv110 -o - %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnuabi -mattr=+custom-cheap-as-move -o - %s | FileCheck %s
+; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=thunderx3t110 -o - %s | FileCheck %s
 
 %X = type { i64, i64, i64 }
 declare void @f(%X*)
Index: llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
===
--- llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
+++ llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
@@ -19,6 +19,7 @@
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderxt83 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderxt88 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderx2t99 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
+; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderx3t110 < %s | FileCheck --check-prefixes=ALIGN4,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=exynos-m3 < %s | FileCheck --check-prefixes=ALIGN5,CHECK %s
 
 define void @test() {
Index: llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
===
--- llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
+++ llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
@@ -6,6 +6,7 @@
 ; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=exynos-m3  < %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=kryo   < %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=thunderx2t99 < %s | FileCheck %s
+; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=thunderx3t110 < %s | FileCheck %s
 
 ; Make sure that inst-combine fuses the multiply add in the addressing mode of
 ; the load.
Index: llvm/test/CodeGen/AArch64/cpus.ll
===
--- llvm/test/CodeGen/AArch64/cpus.ll
+++ llvm/test/CodeGen/AArch64/cpus.ll
@@ -24,6 +24,7 @@
 ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=saphira 2>&1 | FileCheck %s
 ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=kryo 2>&1 | FileCheck %s
 ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=thunderx2t99 2>&1 | FileCheck %s
+; RUN

[clang] bcc5ed7 - [CodeGen] fix test to be (mostly) independent of LLVM optimizer; NFC

2020-05-10 Thread Sanjay Patel via cfe-commits

Author: Sanjay Patel
Date: 2020-05-10T11:19:43-04:00
New Revision: bcc5ed7b24e921c8902d0d0db614576bd249f128

URL: 
https://github.com/llvm/llvm-project/commit/bcc5ed7b24e921c8902d0d0db614576bd249f128
DIFF: 
https://github.com/llvm/llvm-project/commit/bcc5ed7b24e921c8902d0d0db614576bd249f128.diff

LOG: [CodeGen] fix test to be (mostly) independent of LLVM optimizer; NFC

This test would break with the proposed change to IR canonicalization
in D79171. The raw unoptimized IR from clang is massive, so I've
replaced -instcombine with -mem2reg to make it more manageable,
but still be unlikely to break with unrelated changed to optimization.

Added: 


Modified: 
clang/test/CodeGen/aarch64-neon-fp16fml.c

Removed: 




diff  --git a/clang/test/CodeGen/aarch64-neon-fp16fml.c 
b/clang/test/CodeGen/aarch64-neon-fp16fml.c
index 3436d8b212ef..3a96692edc88 100644
--- a/clang/test/CodeGen/aarch64-neon-fp16fml.c
+++ b/clang/test/CodeGen/aarch64-neon-fp16fml.c
@@ -1,5 +1,6 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
 // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +v8.2a 
-target-feature +neon -target-feature +fp16fml \
-// RUN: -fallow-half-arguments-and-returns -disable-O0-optnone -emit-llvm -o - 
%s | opt -S -instcombine | FileCheck %s
+// RUN: -fallow-half-arguments-and-returns -disable-O0-optnone -emit-llvm -o - 
%s | opt -S -mem2reg | FileCheck %s
 
 // REQUIRES: aarch64-registered-target
 
@@ -9,188 +10,1252 @@
 
 // Vector form
 
+// CHECK-LABEL: @test_vfmlal_low_f16(
+// CHECK-NEXT:  entry:
+// CHECK-NEXT:[[TMP0:%.*]] = bitcast <2 x float> [[A:%.*]] to <8 x i8>
+// CHECK-NEXT:[[TMP1:%.*]] = bitcast <4 x half> [[B:%.*]] to <8 x i8>
+// CHECK-NEXT:[[TMP2:%.*]] = bitcast <4 x half> [[C:%.*]] to <8 x i8>
+// CHECK-NEXT:[[VFMLAL_LOW3_I:%.*]] = call <2 x float> 
@llvm.aarch64.neon.fmlal.v2f32.v4f16(<2 x float> [[A]], <4 x half> [[B]], <4 x 
half> [[C]]) #3
+// CHECK-NEXT:ret <2 x float> [[VFMLAL_LOW3_I]]
+//
 float32x2_t test_vfmlal_low_f16(float32x2_t a, float16x4_t b, float16x4_t c) {
-// CHECK-LABEL: define <2 x float> @test_vfmlal_low_f16(<2 x float> %a, <4 x 
half> %b, <4 x half> %c)
-// CHECK: [[RESULT:%.*]] = call <2 x float> 
@llvm.aarch64.neon.fmlal.v2f32.v4f16(<2 x float> %a, <4 x half> %b, <4 x half> 
%c)
-// CHECK: ret <2 x float> [[RESULT]]
   return vfmlal_low_f16(a, b, c);
 }
 
+// CHECK-LABEL: @test_vfmlsl_low_f16(
+// CHECK-NEXT:  entry:
+// CHECK-NEXT:[[TMP0:%.*]] = bitcast <2 x float> [[A:%.*]] to <8 x i8>
+// CHECK-NEXT:[[TMP1:%.*]] = bitcast <4 x half> [[B:%.*]] to <8 x i8>
+// CHECK-NEXT:[[TMP2:%.*]] = bitcast <4 x half> [[C:%.*]] to <8 x i8>
+// CHECK-NEXT:[[VFMLSL_LOW3_I:%.*]] = call <2 x float> 
@llvm.aarch64.neon.fmlsl.v2f32.v4f16(<2 x float> [[A]], <4 x half> [[B]], <4 x 
half> [[C]]) #3
+// CHECK-NEXT:ret <2 x float> [[VFMLSL_LOW3_I]]
+//
 float32x2_t test_vfmlsl_low_f16(float32x2_t a, float16x4_t b, float16x4_t c) {
-// CHECK-LABEL: define <2 x float> @test_vfmlsl_low_f16(<2 x float> %a, <4 x 
half> %b, <4 x half> %c)
-// CHECK: [[RESULT:%.*]] = call <2 x float> 
@llvm.aarch64.neon.fmlsl.v2f32.v4f16(<2 x float> %a, <4 x half> %b, <4 x half> 
%c)
-// CHECK: ret <2 x float> [[RESULT]]
   return vfmlsl_low_f16(a, b, c);
 }
 
+// CHECK-LABEL: @test_vfmlal_high_f16(
+// CHECK-NEXT:  entry:
+// CHECK-NEXT:[[TMP0:%.*]] = bitcast <2 x float> [[A:%.*]] to <8 x i8>
+// CHECK-NEXT:[[TMP1:%.*]] = bitcast <4 x half> [[B:%.*]] to <8 x i8>
+// CHECK-NEXT:[[TMP2:%.*]] = bitcast <4 x half> [[C:%.*]] to <8 x i8>
+// CHECK-NEXT:[[VFMLAL_HIGH3_I:%.*]] = call <2 x float> 
@llvm.aarch64.neon.fmlal2.v2f32.v4f16(<2 x float> [[A]], <4 x half> [[B]], <4 x 
half> [[C]]) #3
+// CHECK-NEXT:ret <2 x float> [[VFMLAL_HIGH3_I]]
+//
 float32x2_t test_vfmlal_high_f16(float32x2_t a, float16x4_t b, float16x4_t c) {
-// CHECK-LABEL: define <2 x float> @test_vfmlal_high_f16(<2 x float> %a, <4 x 
half> %b, <4 x half> %c)
-// CHECK: [[RESULT:%.*]] = call <2 x float> 
@llvm.aarch64.neon.fmlal2.v2f32.v4f16(<2 x float> %a, <4 x half> %b, <4 x half> 
%c)
-// CHECK: ret <2 x float> [[RESULT]]
   return vfmlal_high_f16(a, b, c);
 }
 
+// CHECK-LABEL: @test_vfmlsl_high_f16(
+// CHECK-NEXT:  entry:
+// CHECK-NEXT:[[TMP0:%.*]] = bitcast <2 x float> [[A:%.*]] to <8 x i8>
+// CHECK-NEXT:[[TMP1:%.*]] = bitcast <4 x half> [[B:%.*]] to <8 x i8>
+// CHECK-NEXT:[[TMP2:%.*]] = bitcast <4 x half> [[C:%.*]] to <8 x i8>
+// CHECK-NEXT:[[VFMLSL_HIGH3_I:%.*]] = call <2 x float> 
@llvm.aarch64.neon.fmlsl2.v2f32.v4f16(<2 x float> [[A]], <4 x half> [[B]], <4 x 
half> [[C]]) #3
+// CHECK-NEXT:ret <2 x float> [[VFMLSL_HIGH3_I]]
+//
 float32x2_t test_vfmlsl_high_f16(float32x2_t a, float16x4_t b, float16x4_t c) {
-// CHECK-LABEL: define <2 x float> @test_vfmlsl_high_f16(<2 x float> %a, <4 x 
half> %b, <4 x half> %c)
-// CHECK: [[RESULT:

[clang] d02b3ab - [CodeGen] fix test to be (mostly) independent of LLVM optimizer; NFC

2020-05-10 Thread Sanjay Patel via cfe-commits

Author: Sanjay Patel
Date: 2020-05-10T11:25:37-04:00
New Revision: d02b3aba37d9a18691669392ff26ec28b51741f5

URL: 
https://github.com/llvm/llvm-project/commit/d02b3aba37d9a18691669392ff26ec28b51741f5
DIFF: 
https://github.com/llvm/llvm-project/commit/d02b3aba37d9a18691669392ff26ec28b51741f5.diff

LOG: [CodeGen] fix test to be (mostly) independent of LLVM optimizer; NFC

This test would break with the proposed change to IR canonicalization
in D79171.

The test tried to do the right thing by only using -mem2reg with opt,
but it was using -O3 before that step, so the opt part was meaningless.

Added: 


Modified: 
clang/test/CodeGen/arm-mve-intrinsics/cplusplus.cpp

Removed: 




diff  --git a/clang/test/CodeGen/arm-mve-intrinsics/cplusplus.cpp 
b/clang/test/CodeGen/arm-mve-intrinsics/cplusplus.cpp
index f0455eb31e84..77862b9f49cf 100644
--- a/clang/test/CodeGen/arm-mve-intrinsics/cplusplus.cpp
+++ b/clang/test/CodeGen/arm-mve-intrinsics/cplusplus.cpp
@@ -1,6 +1,6 @@
 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
-// RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature 
+mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O3 
-disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
-// RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature 
+mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O3 
-disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | 
FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature 
+mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -disable-O0-optnone 
-S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature 
+mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -disable-O0-optnone 
-DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
 
 #include 
 
@@ -63,7 +63,7 @@ uint16x8_t test_vorrq_n_u16(uint16x8_t a)
 // CHECK-LABEL: @_Z16test_vcmpeqq_f1619__simd128_float16_tS_(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[TMP0:%.*]] = fcmp oeq <8 x half> [[A:%.*]], [[B:%.*]]
-// CHECK-NEXT:[[TMP1:%.*]] = tail call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 
x i1> [[TMP0]]), !range !3
+// CHECK-NEXT:[[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> 
[[TMP0]])
 // CHECK-NEXT:[[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
 // CHECK-NEXT:ret i16 [[TMP2]]
 //
@@ -78,13 +78,17 @@ mve_pred16_t test_vcmpeqq_f16(float16x8_t a, float16x8_t b)
 
 // CHECK-LABEL: @_Z18test_vcmpeqq_n_f1619__simd128_float16_tDh(
 // CHECK-NEXT:  entry:
-// CHECK-NEXT:[[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
-// CHECK-NEXT:[[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
-// CHECK-NEXT:[[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
-// CHECK-NEXT:[[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, 
half [[TMP1]], i32 0
+// CHECK-NEXT:[[B:%.*]] = alloca half, align 2
+// CHECK-NEXT:[[TMP:%.*]] = alloca float, align 4
+// CHECK-NEXT:store float [[B_COERCE:%.*]], float* [[TMP]], align 4
+// CHECK-NEXT:[[TMP0:%.*]] = bitcast half* [[B]] to i8*
+// CHECK-NEXT:[[TMP1:%.*]] = bitcast float* [[TMP]] to i8*
+// CHECK-NEXT:call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 [[TMP0]], 
i8* align 4 [[TMP1]], i32 2, i1 false)
+// CHECK-NEXT:[[B1:%.*]] = load half, half* [[B]], align 2
+// CHECK-NEXT:[[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, 
half [[B1]], i32 0
 // CHECK-NEXT:[[DOTSPLAT:%.*]] = shufflevector <8 x half> 
[[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
-// CHECK-NEXT:[[TMP2:%.*]] = fcmp oeq <8 x half> [[DOTSPLAT]], [[A:%.*]]
-// CHECK-NEXT:[[TMP3:%.*]] = tail call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 
x i1> [[TMP2]]), !range !3
+// CHECK-NEXT:[[TMP2:%.*]] = fcmp oeq <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT:[[TMP3:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> 
[[TMP2]])
 // CHECK-NEXT:[[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
 // CHECK-NEXT:ret i16 [[TMP4]]
 //
@@ -116,8 +120,8 @@ uint16x8_t test_vld1q_u16(const uint16_t *base)
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
 // CHECK-NEXT:[[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
-// CHECK-NEXT:[[TMP2:%.*]] = tail call <4 x i1> 
@llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
-// CHECK-NEXT:tail call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> 
[[VALUE:%.*]], <4 x i32>* [[TMP0]], i32 4, <4 x i1> [[TMP2]])
+// CHECK-NEXT:[[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 
[[TMP1]])
+// CHECK-NEXT:call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> 
[[VALUE:%.*]], <4 x i32>* [[TMP0]], i32 4, <4 x i1> [[TMP2]])
 // CHECK-NEXT:ret void
 //
 void test_vst1q_p_s32(int32_t *base, int32x4_t v

[PATCH] D79477: [clang-tidy] Add --use-color command line option and UseColor option to control colors in diagnostics

2020-05-10 Thread hyd-dev via Phabricator via cfe-commits
hyd-dev added a comment.

> Would a test case be needed?

`clang::tidy::clangTidyMain()` shows that clang-tidy reports all diagnostics by 
 `clang::tidy::handleErrors()`, which constructs a `clang::tidy::(anonymous 
namespace)::ErrorReporter`, no matter where they come from, so I think a test 
case is not required.

> Not a fan of this test case as it only demonstrates the color behaviour of 
> the process running the check not the actual option itself

What does "option itself" mean?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79477/new/

https://reviews.llvm.org/D79477



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79477: [clang-tidy] Add --use-color command line option and UseColor option to control colors in diagnostics

2020-05-10 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment.

In D79477#2028618 , @hyd-dev wrote:

> > Not a fan of this test case as it only demonstrates the color behaviour of 
> > the process running the check not the actual option itself
>
> What does "option itself" mean?


What I mean to say is, if the behaviour of the testing environment changes to 
pipe the result to a terminal that supports color, it could cause this test 
case to also fail.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79477/new/

https://reviews.llvm.org/D79477



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79691: [clangd] Have suppression comments take precedence over warning-as-error

2020-05-10 Thread Nathan Ridge via Phabricator via cfe-commits
nridge created this revision.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, 
MaskRay, ilya-biryukov.
Herald added a project: clang.

This matches the clang-tidy behaviour.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79691

Files:
  clang-tools-extra/clangd/ParsedAST.cpp
  clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp


Index: clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
===
--- clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
+++ clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
@@ -374,7 +374,7 @@
   Fix(Source.range(), "ident", "change 'ide\\…' to 
'ident'";
 }
 
-TEST(DiagnosticTest, ClangTidyWarningAsErrorTrumpsSuppressionComment) {
+TEST(DiagnosticTest, ClangTidySuppressionCommentTrumpsWarningAsError) {
   Annotations Main(R"cpp(
 int main() {
   int i = 3;
@@ -384,13 +384,7 @@
   TestTU TU = TestTU::withCode(Main.code());
   TU.ClangTidyChecks = "bugprone-integer-division";
   TU.ClangTidyWarningsAsErrors = "bugprone-integer-division";
-  EXPECT_THAT(
-  TU.build().getDiagnostics(),
-  UnorderedElementsAre(::testing::AllOf(
-  Diag(Main.range(), "result of integer division used in a floating "
- "point context; possible loss of precision"),
-  DiagSource(Diag::ClangTidy), DiagName("bugprone-integer-division"),
-  DiagSeverity(DiagnosticsEngine::Error;
+  EXPECT_THAT(TU.build().getDiagnostics(), UnorderedElementsAre());
 }
 
 TEST(DiagnosticsTest, Preprocessor) {
Index: clang-tools-extra/clangd/ParsedAST.cpp
===
--- clang-tools-extra/clangd/ParsedAST.cpp
+++ clang-tools-extra/clangd/ParsedAST.cpp
@@ -314,18 +314,12 @@
 std::string CheckName = CTContext->getCheckName(Info.getID());
 bool IsClangTidyDiag = !CheckName.empty();
 if (IsClangTidyDiag) {
-  // Check for warning-as-error.
-  // We deliberately let this take precedence over suppression comments
-  // to match clang-tidy's behaviour.
-  if (DiagLevel == DiagnosticsEngine::Warning &&
-  CTContext->treatAsError(CheckName)) {
-return DiagnosticsEngine::Error;
-  }
-
   // Check for suppression comment. Skip the check for diagnostics not
   // in the main file, because we don't want that function to query the
   // source buffer for preamble files. For the same reason, we ask
   // shouldSuppressDiagnostic to avoid I/O.
+  // We let suppression comments take precedence over warning-as-error
+  // to match clang-tidy's behaviour.
   bool IsInsideMainFile =
   Info.hasSourceManager() &&
   isInsideMainFile(Info.getLocation(), Info.getSourceManager());
@@ -334,6 +328,12 @@
  /*AllowIO=*/false)) {
 return DiagnosticsEngine::Ignored;
   }
+
+  // Check for warning-as-error.
+  if (DiagLevel == DiagnosticsEngine::Warning &&
+  CTContext->treatAsError(CheckName)) {
+return DiagnosticsEngine::Error;
+  }
 }
   }
   return DiagLevel;


Index: clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
===
--- clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
+++ clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
@@ -374,7 +374,7 @@
   Fix(Source.range(), "ident", "change 'ide\\…' to 'ident'";
 }
 
-TEST(DiagnosticTest, ClangTidyWarningAsErrorTrumpsSuppressionComment) {
+TEST(DiagnosticTest, ClangTidySuppressionCommentTrumpsWarningAsError) {
   Annotations Main(R"cpp(
 int main() {
   int i = 3;
@@ -384,13 +384,7 @@
   TestTU TU = TestTU::withCode(Main.code());
   TU.ClangTidyChecks = "bugprone-integer-division";
   TU.ClangTidyWarningsAsErrors = "bugprone-integer-division";
-  EXPECT_THAT(
-  TU.build().getDiagnostics(),
-  UnorderedElementsAre(::testing::AllOf(
-  Diag(Main.range(), "result of integer division used in a floating "
- "point context; possible loss of precision"),
-  DiagSource(Diag::ClangTidy), DiagName("bugprone-integer-division"),
-  DiagSeverity(DiagnosticsEngine::Error;
+  EXPECT_THAT(TU.build().getDiagnostics(), UnorderedElementsAre());
 }
 
 TEST(DiagnosticsTest, Preprocessor) {
Index: clang-tools-extra/clangd/ParsedAST.cpp
===
--- clang-tools-extra/clangd/ParsedAST.cpp
+++ clang-tools-extra/clangd/ParsedAST.cpp
@@ -314,18 +314,12 @@
 std::string CheckName = CTContext->getCheckName(Info.getID());
 bool IsClangTidyDiag = !CheckName.empty();
 if (IsClangTidyDiag) {
-  // Check for warning-

[PATCH] D78129: Add Marvell ThunderX3T110 support

2020-05-10 Thread Wei Zhao via Phabricator via cfe-commits
wxz2020 updated this revision to Diff 263079.
wxz2020 added a comment.

Fix the format issue in TargetParserTest.cpp


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78129/new/

https://reviews.llvm.org/D78129

Files:
  llvm/include/llvm/Support/AArch64TargetParser.def
  llvm/lib/Target/AArch64/AArch64.td
  llvm/lib/Target/AArch64/AArch64SchedA53.td
  llvm/lib/Target/AArch64/AArch64SchedA57.td
  llvm/lib/Target/AArch64/AArch64SchedCyclone.td
  llvm/lib/Target/AArch64/AArch64SchedExynosM3.td
  llvm/lib/Target/AArch64/AArch64SchedExynosM4.td
  llvm/lib/Target/AArch64/AArch64SchedExynosM5.td
  llvm/lib/Target/AArch64/AArch64SchedFalkor.td
  llvm/lib/Target/AArch64/AArch64SchedKryo.td
  llvm/lib/Target/AArch64/AArch64SchedThunderX.td
  llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td
  llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td
  llvm/lib/Target/AArch64/AArch64Subtarget.cpp
  llvm/lib/Target/AArch64/AArch64Subtarget.h
  llvm/test/CodeGen/AArch64/aarch64-combine-fmul-fsub.mir
  llvm/test/CodeGen/AArch64/cpus.ll
  llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
  llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
  llvm/test/CodeGen/AArch64/remat.ll
  llvm/unittests/Support/TargetParserTest.cpp

Index: llvm/unittests/Support/TargetParserTest.cpp
===
--- llvm/unittests/Support/TargetParserTest.cpp
+++ llvm/unittests/Support/TargetParserTest.cpp
@@ -942,6 +942,12 @@
   "thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
   AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_LSE |
   AArch64::AEK_RDM | AArch64::AEK_FP | AArch64::AEK_SIMD, "8.1-A"));
+  EXPECT_TRUE(testAArch64CPU(
+  "thunderx3t100", "armv8.3-a", "crypto-neon-fp-armv8",
+  AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_LSE |
+  AArch64::AEK_RDM | AArch64::AEK_FP | AArch64::AEK_SIMD |
+  AArch64::AEK_PROFILE | AArch64::AEK_RAS,
+  "8.3-A"));
   EXPECT_TRUE(testAArch64CPU(
   "thunderx", "armv8-a", "crypto-neon-fp-armv8",
   AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD |
@@ -983,7 +989,7 @@
   "8.2-A"));
 }
 
-static constexpr unsigned NumAArch64CPUArchs = 38;
+static constexpr unsigned NumAArch64CPUArchs = 39;
 
 TEST(TargetParserTest, testAArch64CPUArchList) {
   SmallVector List;
Index: llvm/test/CodeGen/AArch64/remat.ll
===
--- llvm/test/CodeGen/AArch64/remat.ll
+++ llvm/test/CodeGen/AArch64/remat.ll
@@ -19,6 +19,7 @@
 ; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=thunderx2t99 -o - %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=tsv110 -o - %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnuabi -mattr=+custom-cheap-as-move -o - %s | FileCheck %s
+; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=thunderx3t110 -o - %s | FileCheck %s
 
 %X = type { i64, i64, i64 }
 declare void @f(%X*)
Index: llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
===
--- llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
+++ llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
@@ -19,6 +19,7 @@
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderxt83 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderxt88 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderx2t99 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
+; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderx3t110 < %s | FileCheck --check-prefixes=ALIGN4,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=exynos-m3 < %s | FileCheck --check-prefixes=ALIGN5,CHECK %s
 
 define void @test() {
Index: llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
===
--- llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
+++ llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
@@ -6,6 +6,7 @@
 ; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=exynos-m3  < %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=kryo   < %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=thunderx2t99 < %s | FileCheck %s
+; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=thunderx3t110 < %s | FileCheck %s
 
 ; Make sure that inst-combine fuses the multiply add in the addressing mode of
 ; the load.
Index: llvm/test/CodeGen/AArch64/cpus.ll
===
--- llvm/test/CodeGen/AArch64/cpus.ll
+++ llvm/test/CodeGen/AArch64/cpus.ll
@@ -24,6 +24,7 @@
 ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=saphira 2>&1 | FileCheck %s
 ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=kryo 2>&1 | FileCheck %s
 ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=thunderx2t99 2>&1 | FileCheck %s
+; RUN: llc < %s -mtriple=arm64-unknown-unknown -mc

[clang] 13a633b - [gcov] Delete CC1 option -coverage-no-function-names-in-data

2020-05-10 Thread Fangrui Song via cfe-commits

Author: Fangrui Song
Date: 2020-05-10T12:37:44-07:00
New Revision: 13a633b438b6500ecad9e4f936ebadf3411d0f44

URL: 
https://github.com/llvm/llvm-project/commit/13a633b438b6500ecad9e4f936ebadf3411d0f44
DIFF: 
https://github.com/llvm/llvm-project/commit/13a633b438b6500ecad9e4f936ebadf3411d0f44.diff

LOG: [gcov] Delete CC1 option -coverage-no-function-names-in-data

rL144865 incorrectly wrote function names for GCOV_TAG_FUNCTION
(this might be part of the reasons the header says
"We emit files in a corrupt version of GCOV's "gcda" file format").

rL176173 and rL177475 realized the problem and introduced 
-coverage-no-function-names-in-data
to work around the issue. (However, the description is wrong.
libgcov never writes function names, even before GCC 4.2).

In reality, the linker command line has to look like:

clang --coverage -Xclang -coverage-version='407*' -Xclang 
-coverage-cfg-checksum -Xclang -coverage-no-function-names-in-data

Failing to pass -coverage-no-function-names-in-data can make gcov 4.7~7
either produce wrong results (for one gcov-4.9 program, I see "No executable 
lines")
or segfault (gcov-7).
(gcov-8 uses an incompatible format.)

This patch deletes -coverage-no-function-names-in-data and the related
function names support from libclang_rt.profile

Added: 


Modified: 
clang/include/clang/Basic/CodeGenOptions.def
clang/include/clang/Driver/CC1Options.td
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/code-coverage.c
compiler-rt/lib/profile/GCDAProfiling.c
llvm/include/llvm/Transforms/Instrumentation.h
llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
llvm/test/Transforms/GCOVProfiling/function-numbering.ll

Removed: 




diff  --git a/clang/include/clang/Basic/CodeGenOptions.def 
b/clang/include/clang/Basic/CodeGenOptions.def
index 5c7fbf43ce46..caf652ad7bbb 100644
--- a/clang/include/clang/Basic/CodeGenOptions.def
+++ b/clang/include/clang/Basic/CodeGenOptions.def
@@ -40,7 +40,6 @@ CODEGENOPT(Backchain , 1, 0) ///< -mbackchain
 CODEGENOPT(ControlFlowGuardNoChecks  , 1, 0) ///< -cfguard-no-checks
 CODEGENOPT(ControlFlowGuard  , 1, 0) ///< -cfguard
 CODEGENOPT(CoverageExtraChecksum, 1, 0) ///< Whether we need a second checksum 
for functions in GCNO files.
-CODEGENOPT(CoverageNoFunctionNamesInData, 1, 0) ///< Do not include function 
names in GCDA files.
 CODEGENOPT(CoverageExitBlockBeforeBody, 1, 0) ///< Whether to emit the exit 
block before the body blocks in GCNO files.
 CODEGENOPT(CXAAtExit , 1, 1) ///< Use __cxa_atexit for calling 
destructors.
 CODEGENOPT(RegisterGlobalDtorsWithAtExit, 1, 1) ///< Use atexit or 
__cxa_atexit to register global destructors.

diff  --git a/clang/include/clang/Driver/CC1Options.td 
b/clang/include/clang/Driver/CC1Options.td
index e7912dd27ea6..7d04d80eda81 100644
--- a/clang/include/clang/Driver/CC1Options.td
+++ b/clang/include/clang/Driver/CC1Options.td
@@ -264,8 +264,6 @@ def coverage_notes_file_EQ : Joined<["-"], 
"coverage-notes-file=">,
   Alias;
 def coverage_cfg_checksum : Flag<["-"], "coverage-cfg-checksum">,
   HelpText<"Emit CFG checksum for functions in .gcno files.">;
-def coverage_no_function_names_in_data : Flag<["-"], 
"coverage-no-function-names-in-data">,
-  HelpText<"Emit function names in .gcda files.">;
 def coverage_exit_block_before_body : Flag<["-"], 
"coverage-exit-block-before-body">,
   HelpText<"Emit the exit block before the body blocks in .gcno files.">;
 def coverage_version_EQ : Joined<["-"], "coverage-version=">,

diff  --git a/clang/lib/CodeGen/BackendUtil.cpp 
b/clang/lib/CodeGen/BackendUtil.cpp
index 3a42ca641e96..0c31bc026ab2 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -532,7 +532,6 @@ static Optional getGCOVOptions(const 
CodeGenOptions &CodeGenOpts) {
   llvm::copy(CodeGenOpts.CoverageVersion, std::begin(Options.Version));
   Options.UseCfgChecksum = CodeGenOpts.CoverageExtraChecksum;
   Options.NoRedZone = CodeGenOpts.DisableRedZone;
-  Options.FunctionNamesInData = !CodeGenOpts.CoverageNoFunctionNamesInData;
   Options.Filter = CodeGenOpts.ProfileFilterFiles;
   Options.Exclude = CodeGenOpts.ProfileExcludeFiles;
   Options.ExitBlockBeforeBody = CodeGenOpts.CoverageExitBlockBeforeBody;

diff  --git a/clang/lib/Frontend/CompilerInvocation.cpp 
b/clang/lib/Frontend/CompilerInvocation.cpp
index 01f06731dd6e..6a358f235d8a 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1018,8 +1018,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, 
ArgList &Args, InputKind IK,
 Opts.CoverageNotesFile =
 std::string(Args.getLastArgValue(OPT_coverage_notes_file));
 Opts.CoverageExtraChecksum = Args.hasArg(OPT_coverage_cfg_checksum);
-Opts.CoverageNoFunctionNamesInData =
-Args.hasArg(OPT_coverage_no_function_name

[PATCH] D78129: Add Marvell ThunderX3T110 support

2020-05-10 Thread Wei Zhao via Phabricator via cfe-commits
wxz2020 updated this revision to Diff 263081.
wxz2020 added a comment.

fix a typo, thunderx3t110, not thunderx3t100 in TargetParserTest.cpp


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78129/new/

https://reviews.llvm.org/D78129

Files:
  llvm/include/llvm/Support/AArch64TargetParser.def
  llvm/lib/Target/AArch64/AArch64.td
  llvm/lib/Target/AArch64/AArch64SchedA53.td
  llvm/lib/Target/AArch64/AArch64SchedA57.td
  llvm/lib/Target/AArch64/AArch64SchedCyclone.td
  llvm/lib/Target/AArch64/AArch64SchedExynosM3.td
  llvm/lib/Target/AArch64/AArch64SchedExynosM4.td
  llvm/lib/Target/AArch64/AArch64SchedExynosM5.td
  llvm/lib/Target/AArch64/AArch64SchedFalkor.td
  llvm/lib/Target/AArch64/AArch64SchedKryo.td
  llvm/lib/Target/AArch64/AArch64SchedThunderX.td
  llvm/lib/Target/AArch64/AArch64SchedThunderX2T99.td
  llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td
  llvm/lib/Target/AArch64/AArch64Subtarget.cpp
  llvm/lib/Target/AArch64/AArch64Subtarget.h
  llvm/test/CodeGen/AArch64/aarch64-combine-fmul-fsub.mir
  llvm/test/CodeGen/AArch64/cpus.ll
  llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
  llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
  llvm/test/CodeGen/AArch64/remat.ll
  llvm/unittests/Support/TargetParserTest.cpp

Index: llvm/unittests/Support/TargetParserTest.cpp
===
--- llvm/unittests/Support/TargetParserTest.cpp
+++ llvm/unittests/Support/TargetParserTest.cpp
@@ -942,6 +942,12 @@
   "thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
   AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_LSE |
   AArch64::AEK_RDM | AArch64::AEK_FP | AArch64::AEK_SIMD, "8.1-A"));
+  EXPECT_TRUE(testAArch64CPU(
+  "thunderx3t110", "armv8.3-a", "crypto-neon-fp-armv8",
+  AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_LSE |
+  AArch64::AEK_RDM | AArch64::AEK_FP | AArch64::AEK_SIMD |
+  AArch64::AEK_PROFILE | AArch64::AEK_RAS,
+  "8.3-A"));
   EXPECT_TRUE(testAArch64CPU(
   "thunderx", "armv8-a", "crypto-neon-fp-armv8",
   AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD |
@@ -983,7 +989,7 @@
   "8.2-A"));
 }
 
-static constexpr unsigned NumAArch64CPUArchs = 38;
+static constexpr unsigned NumAArch64CPUArchs = 39;
 
 TEST(TargetParserTest, testAArch64CPUArchList) {
   SmallVector List;
Index: llvm/test/CodeGen/AArch64/remat.ll
===
--- llvm/test/CodeGen/AArch64/remat.ll
+++ llvm/test/CodeGen/AArch64/remat.ll
@@ -19,6 +19,7 @@
 ; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=thunderx2t99 -o - %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=tsv110 -o - %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnuabi -mattr=+custom-cheap-as-move -o - %s | FileCheck %s
+; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=thunderx3t110 -o - %s | FileCheck %s
 
 %X = type { i64, i64, i64 }
 declare void @f(%X*)
Index: llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
===
--- llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
+++ llvm/test/CodeGen/AArch64/preferred-function-alignment.ll
@@ -19,6 +19,7 @@
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderxt83 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderxt88 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderx2t99 < %s | FileCheck --check-prefixes=ALIGN3,CHECK %s
+; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=thunderx3t110 < %s | FileCheck --check-prefixes=ALIGN4,CHECK %s
 ; RUN: llc -mtriple=aarch64-unknown-linux -mcpu=exynos-m3 < %s | FileCheck --check-prefixes=ALIGN5,CHECK %s
 
 define void @test() {
Index: llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
===
--- llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
+++ llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
@@ -6,6 +6,7 @@
 ; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=exynos-m3  < %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=kryo   < %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=thunderx2t99 < %s | FileCheck %s
+; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=thunderx3t110 < %s | FileCheck %s
 
 ; Make sure that inst-combine fuses the multiply add in the addressing mode of
 ; the load.
Index: llvm/test/CodeGen/AArch64/cpus.ll
===
--- llvm/test/CodeGen/AArch64/cpus.ll
+++ llvm/test/CodeGen/AArch64/cpus.ll
@@ -24,6 +24,7 @@
 ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=saphira 2>&1 | FileCheck %s
 ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=kryo 2>&1 | FileCheck %s
 ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=thunderx2t99 2>&1 | FileCheck %s
+; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=thunderx3t11

[clang] d6425e2 - Properly implement 'enum class' parsing.

2020-05-10 Thread Richard Smith via cfe-commits

Author: Richard Smith
Date: 2020-05-10T13:21:04-07:00
New Revision: d6425e2c14370ecb5e2a4be4cfdef65f8ae69bd0

URL: 
https://github.com/llvm/llvm-project/commit/d6425e2c14370ecb5e2a4be4cfdef65f8ae69bd0
DIFF: 
https://github.com/llvm/llvm-project/commit/d6425e2c14370ecb5e2a4be4cfdef65f8ae69bd0.diff

LOG: Properly implement 'enum class' parsing.

The 'class' or 'struct' keyword is only permitted as part of either an
enum definition or a standalone opaque-enum-declaration, not as part of
an elaborated type specifier. We previously failed to diagnose this, and
generally didn't properly implement the restrictions on elaborated type
specifiers for enumeration types.

In passing, also fixed incorrect parsing for enum-bases, which we
previously parsed as a type-name, but are actually a type-specifier-seq.
This matters for cases like 'enum E : int *p;', which is valid as a
Microsoft extension.

Plus some minor parse diagnostic improvements.

Bumped the recently-added ExtWarn for 'enum E : int x;' to be
DefaultError; this is not an intentional extension, so producing an
error by default seems appropriate, but the warning flag to disable it
may still be useful for code written against old Clang. The same
treatment is given here to the diagnostic for 'enum class E x;', which
we similarly have incorrectly accepted for many years. These diagnostics
continue to be suppressed under -fms-extensions and when compiling
Objective-C code. We will need to decide separately whether Objective-C
should follow the C++ rules or the (older) MSVC rules.

Added: 


Modified: 
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Parse/Parser.h
clang/lib/Parse/ParseDecl.cpp
clang/lib/Parse/ParseTentative.cpp
clang/lib/Sema/SemaDecl.cpp
clang/test/Parser/MicrosoftExtensions.cpp
clang/test/Parser/cxx0x-ambig.cpp
clang/test/Parser/cxx0x-decl.cpp
clang/test/SemaCXX/enum-scoped.cpp
clang/test/SemaObjC/enum-fixed-type.m
clang/test/SemaTemplate/instantiate-local-class.cpp

Removed: 




diff  --git a/clang/include/clang/Basic/DiagnosticParseKinds.td 
b/clang/include/clang/Basic/DiagnosticParseKinds.td
index 04014780615b..ac5b9a605589 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -108,7 +108,18 @@ def warn_cxx98_compat_enum_fixed_underlying_type : Warning<
 def ext_enum_base_in_type_specifier : ExtWarn<
   "non-defining declaration of enumeration with a fixed underlying type is "
   "only permitted as a standalone declaration"
-  "%select{|; missing list of enumerators?}0">, 
InGroup>;
+  "%select{|; missing list of enumerators?}0">,
+  InGroup>, DefaultError;
+def ext_elaborated_enum_class : ExtWarn<
+  "reference to enumeration must use 'enum' not 'enum 
%select{struct|class}0'">,
+  InGroup>, DefaultError;
+def err_scoped_enum_missing_identifier : Error<
+  "scoped enumeration requires a name">;
+def ext_scoped_enum : ExtWarn<
+  "scoped enumerations are a C++11 extension">, InGroup;
+def warn_cxx98_compat_scoped_enum : Warning<
+  "scoped enumerations are incompatible with C++98">,
+  InGroup, DefaultIgnore;
 def err_anonymous_enum_bitfield : Error<
   "ISO C++ only allows ':' in member enumeration declaration to introduce "
   "a fixed underlying type, not an anonymous bit-field">;
@@ -893,14 +904,6 @@ def err_access_specifier_interface : Error<
 def err_duplicate_virt_specifier : Error<
   "class member already marked '%0'">;
 
-def err_scoped_enum_missing_identifier : Error<
-  "scoped enumeration requires a name">;
-def ext_scoped_enum : ExtWarn<
-  "scoped enumerations are a C++11 extension">, InGroup;
-def warn_cxx98_compat_scoped_enum : Warning<
-  "scoped enumerations are incompatible with C++98">,
-  InGroup, DefaultIgnore;
-
 def err_expected_parameter_pack : Error<
   "expected the name of a parameter pack">;
 def err_paren_sizeof_parameter_pack : Error<

diff  --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td 
b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 5ca0982ce5c3..fb2d8e48fa70 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -2387,9 +2387,6 @@ def err_enum_redeclare_fixed_mismatch : Error<
   "enumeration previously declared with %select{non|}0fixed underlying type">;
 def err_enum_redeclare_scoped_mismatch : Error<
   "enumeration previously declared as %select{un|}0scoped">;
-def err_enum_class_reference : Error<
-  "reference to %select{|scoped }0enumeration must use 'enum' "
-  "not 'enum class'">;
 def err_only_enums_have_underlying_types : Error<
   "only enumeration types have underlying types">;
 def err_underlying_type_of_incomplete_enum : Error<

diff  --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index cbdf9fede665..b6b

[clang] 2d3f5a6 - Fix typo in enum-base disambiguation.

2020-05-10 Thread Richard Smith via cfe-commits

Author: Richard Smith
Date: 2020-05-10T13:39:49-07:00
New Revision: 2d3f5a62de8e5d2cc25aaa49d0a00d31ed32544a

URL: 
https://github.com/llvm/llvm-project/commit/2d3f5a62de8e5d2cc25aaa49d0a00d31ed32544a
DIFF: 
https://github.com/llvm/llvm-project/commit/2d3f5a62de8e5d2cc25aaa49d0a00d31ed32544a.diff

LOG: Fix typo in enum-base disambiguation.

Added: 
clang/test/Parser/cxx98-enum.cpp
clang/test/Parser/objcxx-enum.mm

Modified: 
clang/lib/Parse/ParseTentative.cpp
clang/test/Parser/cxx0x-ambig.cpp

Removed: 




diff  --git a/clang/lib/Parse/ParseTentative.cpp 
b/clang/lib/Parse/ParseTentative.cpp
index fd868b81fd09..ff941cfc441d 100644
--- a/clang/lib/Parse/ParseTentative.cpp
+++ b/clang/lib/Parse/ParseTentative.cpp
@@ -450,7 +450,7 @@ bool Parser::isEnumBase(bool AllowSemi) {
 
 // If we get to the end of the enum-base, we hit either a '{' or a ';'.
 // Don't bother checking the enumerator-list.
-if (Tok.is(tok::colon) || (AllowSemi && Tok.is(tok::semi)))
+if (Tok.is(tok::l_brace) || (AllowSemi && Tok.is(tok::semi)))
   return true;
 
 // A second decl-specifier unambiguously indicatges an enum-base.

diff  --git a/clang/test/Parser/cxx0x-ambig.cpp 
b/clang/test/Parser/cxx0x-ambig.cpp
index b4f066b04a5f..2dd53dd6daab 100644
--- a/clang/test/Parser/cxx0x-ambig.cpp
+++ b/clang/test/Parser/cxx0x-ambig.cpp
@@ -86,6 +86,8 @@ namespace bitfield {
   // be ill-formed. It cannot be an elaborated-type-specifier.
   struct S {
 enum : undeclared_type { v = 0 }; // expected-error {{unknown type name 
'undeclared_type'}}
+enum E : undeclared_type { w = 0 }; // expected-error {{unknown type name 
'undeclared_type'}}
+enum X : undeclared_type { x = 0 }; // expected-error {{unknown type name 
'undeclared_type'}}
   };
 }
 

diff  --git a/clang/test/Parser/cxx98-enum.cpp 
b/clang/test/Parser/cxx98-enum.cpp
new file mode 100644
index ..ed85adea3c6e
--- /dev/null
+++ b/clang/test/Parser/cxx98-enum.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -std=c++98 -verify %s
+
+enum E {};
+enum F {};
+
+struct A {
+  // OK, this is an enumeration bit-field.
+  enum E : int(0);
+  enum F : int{0}; // expected-error {{expected '(' for function-style cast}}
+};

diff  --git a/clang/test/Parser/objcxx-enum.mm 
b/clang/test/Parser/objcxx-enum.mm
new file mode 100644
index ..2d68aa047a8a
--- /dev/null
+++ b/clang/test/Parser/objcxx-enum.mm
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -verify -std=c++98 %s
+// expected-no-diagnostics
+
+// Objective-C allows C++11 enumerations in C++98 mode. We disambiguate in
+// order to make this a backwards-compatible extension.
+struct A {
+  enum E : int{a}; // OK, enum definition
+  enum E : int(a); // OK, bit-field declaration
+};
+_Static_assert(A::a == 0, "");



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 8fc12b8 - Enforce the C++11 anonymous enum bitfields check even for

2020-05-10 Thread Richard Smith via cfe-commits

Author: Richard Smith
Date: 2020-05-10T14:03:50-07:00
New Revision: 8fc12b86985a088b2abd62a0684742c8e771d6ae

URL: 
https://github.com/llvm/llvm-project/commit/8fc12b86985a088b2abd62a0684742c8e771d6ae
DIFF: 
https://github.com/llvm/llvm-project/commit/8fc12b86985a088b2abd62a0684742c8e771d6ae.diff

LOG: Enforce the C++11 anonymous enum bitfields check even for
Objective-C++11 and under MS extensions.

This matches the MSVC behavior, and means that Objective-C behaves as a
set of extensions to the base language, rather than replacing the base
language rule with a different one.

Added: 


Modified: 
clang/lib/Parse/ParseDecl.cpp
clang/test/Parser/MicrosoftExtensions.cpp
clang/test/Parser/objcxx-enum.mm
clang/test/SemaCXX/MicrosoftExtensions.cpp

Removed: 




diff  --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 8a0d63f486c3..d5d499360a39 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -4543,8 +4543,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, 
DeclSpec &DS,
 if (CanBeBitfield && !isEnumBase(CanBeOpaqueEnumDeclaration)) {
   // Outside C++11, do not interpret the tokens as an enum-base if they do
   // not make sense as one. In C++11, it's an error if this happens.
-  if (getLangOpts().CPlusPlus11 && !getLangOpts().ObjC &&
-  !getLangOpts().MicrosoftExt)
+  if (getLangOpts().CPlusPlus11)
 Diag(Tok.getLocation(), diag::err_anonymous_enum_bitfield);
 } else if (CanHaveEnumBase || !ColonIsSacred) {
   SourceLocation ColonLoc = ConsumeToken();

diff  --git a/clang/test/Parser/MicrosoftExtensions.cpp 
b/clang/test/Parser/MicrosoftExtensions.cpp
index 10eb13a56b00..ddbe5aaef779 100644
--- a/clang/test/Parser/MicrosoftExtensions.cpp
+++ b/clang/test/Parser/MicrosoftExtensions.cpp
@@ -455,4 +455,17 @@ namespace enum_class {
   auto f4() -> enum class E4 { return {}; }
   auto f5() -> enum E5 : int { return {}; } // FIXME: MSVC rejects this and 
crashes if the body is {}.
   auto f6() -> enum E6 { return {}; } // expected-warning {{Microsoft 
extension}}
+
+  // MSVC does not perform disambiguation for a colon that could introduce an
+  // enum-base or a bit-field.
+  enum E {};
+  struct S {
+enum E : int(1); // expected-error {{anonymous bit-field}}
+enum E : int : 1; // OK, bit-field
+enum F : int a = {}; // OK, default member initializer
+// MSVC produces a "C4353 constant 0 as function expression" for this,
+// considering the final {} to be part of the bit-width. We follow P0683R1
+// and treat it as a default member initializer.
+enum E : int : int{}{}; // expected-error {{anonymous bit-field cannot 
have a default member initializer}} expected-warning {{C++20 extension}}
+  };
 }

diff  --git a/clang/test/Parser/objcxx-enum.mm 
b/clang/test/Parser/objcxx-enum.mm
index 2d68aa047a8a..a86c420f9fbe 100644
--- a/clang/test/Parser/objcxx-enum.mm
+++ b/clang/test/Parser/objcxx-enum.mm
@@ -1,10 +1,14 @@
 // RUN: %clang_cc1 -verify -std=c++98 %s
+// RUN: %clang_cc1 -verify=cxx11 -std=c++11 %s
+
+#if __cplusplus < 201103L
 // expected-no-diagnostics
+#endif
 
 // Objective-C allows C++11 enumerations in C++98 mode. We disambiguate in
 // order to make this a backwards-compatible extension.
 struct A {
   enum E : int{a}; // OK, enum definition
-  enum E : int(a); // OK, bit-field declaration
+  enum E : int(a); // OK, bit-field declaration cxx11-error{{anonymous 
bit-field}}
 };
 _Static_assert(A::a == 0, "");

diff  --git a/clang/test/SemaCXX/MicrosoftExtensions.cpp 
b/clang/test/SemaCXX/MicrosoftExtensions.cpp
index c9703828366c..b1f8cd96d505 100644
--- a/clang/test/SemaCXX/MicrosoftExtensions.cpp
+++ b/clang/test/SemaCXX/MicrosoftExtensions.cpp
@@ -154,6 +154,9 @@ struct X0 {
 #endif
 
   enum E1 : seventeen;
+#if __cplusplus >= 201103L
+  // expected-error@-2 {{bit-field}}
+#endif
 };
 
 #if __cplusplus <= 199711L



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] c7ebf00 - Fix clangd test that depended on a diagnostic removed in Clang.

2020-05-10 Thread Richard Smith via cfe-commits

Author: Richard Smith
Date: 2020-05-10T14:13:25-07:00
New Revision: c7ebf0067014dd66acc2f9ec91e2426340791369

URL: 
https://github.com/llvm/llvm-project/commit/c7ebf0067014dd66acc2f9ec91e2426340791369
DIFF: 
https://github.com/llvm/llvm-project/commit/c7ebf0067014dd66acc2f9ec91e2426340791369.diff

LOG: Fix clangd test that depended on a diagnostic removed in Clang.

Added: 


Modified: 
clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp

Removed: 




diff  --git a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp 
b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
index 90d3621286db..b94de7412ce3 100644
--- a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
+++ b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
@@ -502,8 +502,8 @@ TEST(DiagnosticsTest, ToLSP) {
   URIForFile::canonicalize(testPath("foo/bar/header.h"), "");
 
   clangd::Diag D;
-  D.ID = clang::diag::err_enum_class_reference;
-  D.Name = "enum_class_reference";
+  D.ID = clang::diag::err_undeclared_var_use;
+  D.Name = "undeclared_var_use";
   D.Source = clangd::Diag::Clang;
   D.Message = "something terrible happened";
   D.Range = {pos(1, 2), pos(3, 4)};
@@ -539,7 +539,7 @@ TEST(DiagnosticsTest, ToLSP) {
   clangd::Diagnostic MainLSP;
   MainLSP.range = D.Range;
   MainLSP.severity = getSeverity(DiagnosticsEngine::Error);
-  MainLSP.code = "enum_class_reference";
+  MainLSP.code = "undeclared_var_use";
   MainLSP.source = "clang";
   MainLSP.message =
   R"(Something terrible happened (fix available)
@@ -570,7 +570,7 @@ main.cpp:2:3: error: something terrible happened)";
   LSPDiags,
   ElementsAre(Pair(EqualToLSPDiag(MainLSP), ElementsAre(EqualToFix(F))),
   Pair(EqualToLSPDiag(NoteInMainLSP), IsEmpty(;
-  EXPECT_EQ(LSPDiags[0].first.code, "enum_class_reference");
+  EXPECT_EQ(LSPDiags[0].first.code, "undeclared_var_use");
   EXPECT_EQ(LSPDiags[0].first.source, "clang");
   EXPECT_EQ(LSPDiags[1].first.code, "");
   EXPECT_EQ(LSPDiags[1].first.source, "");



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79692: [clangd] Make version in PublishDiagnosticsParams optional

2020-05-10 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision.
kadircet added a reviewer: sammccall.
Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, 
ilya-biryukov.
Herald added a project: clang.

We were serializing it no matter what, which was against the spec


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79692

Files:
  clang-tools-extra/clangd/Protocol.cpp
  clang-tools-extra/clangd/test/diagnostics-no-tidy.test
  clang-tools-extra/clangd/test/diagnostics.test


Index: clang-tools-extra/clangd/test/diagnostics.test
===
--- clang-tools-extra/clangd/test/diagnostics.test
+++ clang-tools-extra/clangd/test/diagnostics.test
@@ -48,8 +48,7 @@
 #  CHECK:  "method": "textDocument/publishDiagnostics",
 # CHECK-NEXT:  "params": {
 # CHECK-NEXT:"diagnostics": [],
-# CHECK-NEXT:"uri": "file://{{.*}}/foo.c",
-# CHECK-NEXT:"version": null
+# CHECK-NEXT:"uri": "file://{{.*}}/foo.c"
 # CHECK-NEXT:  }
 ---
 {"jsonrpc":"2.0","id":5,"method":"shutdown"}
Index: clang-tools-extra/clangd/test/diagnostics-no-tidy.test
===
--- clang-tools-extra/clangd/test/diagnostics-no-tidy.test
+++ clang-tools-extra/clangd/test/diagnostics-no-tidy.test
@@ -32,8 +32,7 @@
 #  CHECK:  "method": "textDocument/publishDiagnostics",
 # CHECK-NEXT:  "params": {
 # CHECK-NEXT:"diagnostics": [],
-# CHECK-NEXT:"uri": "file://{{.*}}/foo.c",
-# CHECK-NEXT:"version": null
+# CHECK-NEXT:"uri": "file://{{.*}}/foo.c"
 # CHECK-NEXT:  }
 ---
 {"jsonrpc":"2.0","id":5,"method":"shutdown"}
Index: clang-tools-extra/clangd/Protocol.cpp
===
--- clang-tools-extra/clangd/Protocol.cpp
+++ clang-tools-extra/clangd/Protocol.cpp
@@ -560,11 +560,14 @@
 }
 
 llvm::json::Value toJSON(const PublishDiagnosticsParams &PDP) {
-  return llvm::json::Object{
+  llvm::json::Object Result{
   {"uri", PDP.uri},
   {"diagnostics", PDP.diagnostics},
-  {"version", PDP.version},
   };
+  if (PDP.version)
+Result["version"] = PDP.version;
+  // FIXME: workaround for older gcc/clang
+  return std::move(Result);
 }
 
 bool fromJSON(const llvm::json::Value &Params, CodeActionContext &R) {


Index: clang-tools-extra/clangd/test/diagnostics.test
===
--- clang-tools-extra/clangd/test/diagnostics.test
+++ clang-tools-extra/clangd/test/diagnostics.test
@@ -48,8 +48,7 @@
 #  CHECK:  "method": "textDocument/publishDiagnostics",
 # CHECK-NEXT:  "params": {
 # CHECK-NEXT:"diagnostics": [],
-# CHECK-NEXT:"uri": "file://{{.*}}/foo.c",
-# CHECK-NEXT:"version": null
+# CHECK-NEXT:"uri": "file://{{.*}}/foo.c"
 # CHECK-NEXT:  }
 ---
 {"jsonrpc":"2.0","id":5,"method":"shutdown"}
Index: clang-tools-extra/clangd/test/diagnostics-no-tidy.test
===
--- clang-tools-extra/clangd/test/diagnostics-no-tidy.test
+++ clang-tools-extra/clangd/test/diagnostics-no-tidy.test
@@ -32,8 +32,7 @@
 #  CHECK:  "method": "textDocument/publishDiagnostics",
 # CHECK-NEXT:  "params": {
 # CHECK-NEXT:"diagnostics": [],
-# CHECK-NEXT:"uri": "file://{{.*}}/foo.c",
-# CHECK-NEXT:"version": null
+# CHECK-NEXT:"uri": "file://{{.*}}/foo.c"
 # CHECK-NEXT:  }
 ---
 {"jsonrpc":"2.0","id":5,"method":"shutdown"}
Index: clang-tools-extra/clangd/Protocol.cpp
===
--- clang-tools-extra/clangd/Protocol.cpp
+++ clang-tools-extra/clangd/Protocol.cpp
@@ -560,11 +560,14 @@
 }
 
 llvm::json::Value toJSON(const PublishDiagnosticsParams &PDP) {
-  return llvm::json::Object{
+  llvm::json::Object Result{
   {"uri", PDP.uri},
   {"diagnostics", PDP.diagnostics},
-  {"version", PDP.version},
   };
+  if (PDP.version)
+Result["version"] = PDP.version;
+  // FIXME: workaround for older gcc/clang
+  return std::move(Result);
 }
 
 bool fromJSON(const llvm::json::Value &Params, CodeActionContext &R) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D60193: [OpenCL] Added addrspace_cast operator

2020-05-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia marked 3 inline comments as done.
Anastasia added inline comments.



Comment at: clang/test/SemaOpenCLCXX/addrspace_cast.cl:19-24
+template 
+void test_temp(__global int *par) {
+  T *var1 = addrspace_cast(par);
+  __private T *var2 = addrspace_cast<__private T *>(par);
+  T var3 = addrspace_cast(par);
+}

mantognini wrote:
> Does this test anything since it's not instantiated?
It tests AST creation and Sema  but not after the TreeTransforms. I have now 
enhanced it.



Comment at: lib/Sema/SemaCast.cpp:285
+return Op.complete(CXXAddrspaceCastExpr::Create(Context, Op.ResultType,
+Op.ValueKind, Op.SrcExpr.get(),
+  DestTInfo,

mantognini wrote:
> Anastasia wrote:
> > mantognini wrote:
> > > The formatting looks a bit funny here.
> > I agree, I just matched the style of the old code to keep it coherent. 
> > Although perhaps I should rather adhere to the current style?
> I don't have a strong opinion on what's best.
I looked at the other review and I think the preference is to stay with the 
coding style for the new added code.



Comment at: lib/Sema/SemaCast.cpp:2338
   auto DestPointeeType = DestPtrType->getPointeeType();
   if (SrcPointeeType.getAddressSpace() == DestPointeeType.getAddressSpace())
 return TC_NotApplicable;

mantognini wrote:
> Anastasia wrote:
> > mantognini wrote:
> > > Wouldn't this limit usage of the cast unnecessarily? I'm thinking this 
> > > could be transformed to a NOP, which could be beneficial to make 
> > > (template) code simpler to write.
> > I am not sure what you mean. I have added the test for templates and it 
> > caught a bug in lib/AST/Expr.cpp with assert condition.
> > 
> > However, now that I think about this more, I believe we should allow 
> > compiling this?
> > 
> > ```
> > __private int* i;
> > addrspace_cast(i);
> > ```
> > 
> > Currently it outputs an error.
> Yes, that's what I meant. (Although I see it's not part of this review so I'm 
> not saying this should be changed now.)
It was an easy change so I have updated the patch. :)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60193/new/

https://reviews.llvm.org/D60193



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79378: PR34581: Don't remove an 'if (p)' guarding a call to 'operator delete(p)' under -Oz.

2020-05-10 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith marked an inline comment as done.
rsmith added a comment.

In D79378#2019336 , @rjmccall wrote:

> Is it reasonable to figure out ahead of time that we can skip the null check 
> completely?  It'd be kindof nice to also take advantage of this at -O0 
> whenever we don't have real work to do.


In simple cases, we could get a win at `-O0` (deleting an object or array with 
a trivial (and therefore non-virtual) destructor + non-destroying operator 
delete + no array cookie). Perhaps in those cases we could sidestep the whole 
process and just generate a direct call to `operator delete`. That's a 
different optimization from the one I'm suggesting here (which in turn is 
trying to be the non-miscompiling subset of the original LLVM-side 
optimization), though there's lots of overlap. If we don't care about the `-Oz` 
cases where the destructor is non-trivial before optimization but can be 
removed by the optimizer, then we could do that instead of this change. If we 
decide we care about both situations (removing the branch at `-O0` for trivial 
deletes and removing the branch at `-Oz` for deletes that optimize into being 
trivial deletes), then I think we need both something like this *and* that 
check.

What do you think? I'm somewhat inclined to prefer special-casing deletes that 
the frontend can see are trivial, rather than making the delete unconditional 
under `-Oz`. That means we might see a code size regression in some cases for 
`-Oz`, but I suspect that's mostly a theoretical risk.

If we do special-case trivial deletes, should we still insert the branch for 
them at `-O1` and above? In order for that to be profitable, I think the branch 
would need to be both well-predicted and usually null, which seems like it 
could happen but is unlikely to be the common case. I suspect the best answer 
may be to do this regardless of optimization level.




Comment at: clang/lib/CodeGen/CGExprCXX.cpp:2042-2049
   // Null check the pointer.
   llvm::BasicBlock *DeleteNotNull = createBasicBlock("delete.notnull");
   llvm::BasicBlock *DeleteEnd = createBasicBlock("delete.end");
 
   llvm::Value *IsNull = Builder.CreateIsNull(Ptr.getPointer(), "isnull");
 
   Builder.CreateCondBr(IsNull, DeleteEnd, DeleteNotNull);

dnsampaio wrote:
> Unless I missed something, isn't it better to just avoid emitting this check 
> and basic blocks all together if we are optimizing for size and when we know 
> that Ptr is never null?
> I would consider in doing something alike:
>  ```
>   const bool emitNullCheck = CGM.getCodeGenOpts().OptimizeSize <= 1;
>   llvm::BasicBlock *DeleteNotNull;
>   llvm::BasicBlock *DeleteEnd;
>   if (emitNullCheck){
> // Null check the pointer.
> DeleteNotNull = createBasicBlock("delete.notnull");
> DeleteEnd = createBasicBlock("delete.end");
> 
> llvm::Value *IsNull = Builder.CreateIsNull(Ptr.getPointer(), "isnull");
> 
> Builder.CreateCondBr(IsNull, DeleteEnd, DeleteNotNull);
> EmitBlock(DeleteNotNull);
>   }
> ```
> 
> and we use the same emitNullCheck to avoid EmitBlocks below.
I don't think we can reasonably do this. There are a lot of different ways that 
`delete` emission can be performed, and many of them (for example, calling a 
virtual deleting destructor, destroying operator delete, or array delete with 
cookie) require the null check to be performed in advance for correctness. It 
would be brittle to duplicate all of those checks here.

We *could* sink the null checks into the various paths through 
`EmitArrayDelete` and `EmitObjectDelete`, but I think that makes the code 
significantly more poorly factored.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79378/new/

https://reviews.llvm.org/D79378



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D60193: [OpenCL] Added addrspace_cast operator

2020-05-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 263085.
Anastasia added a comment.

- Improved behavior by allowing casting between equivalent types.
- Improved formatting.
- Improved tests.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60193/new/

https://reviews.llvm.org/D60193

Files:
  clang/include/clang-c/Index.h
  clang/include/clang/AST/ExprCXX.h
  clang/include/clang/AST/RecursiveASTVisitor.h
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Basic/StmtNodes.td
  clang/include/clang/Basic/TokenKinds.def
  clang/include/clang/Sema/Sema.h
  clang/include/clang/Serialization/ASTBitCodes.h
  clang/lib/AST/Expr.cpp
  clang/lib/AST/ExprCXX.cpp
  clang/lib/AST/ExprClassification.cpp
  clang/lib/AST/ExprConstant.cpp
  clang/lib/AST/ItaniumMangle.cpp
  clang/lib/AST/StmtPrinter.cpp
  clang/lib/AST/StmtProfile.cpp
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/Parse/ParseExpr.cpp
  clang/lib/Parse/ParseExprCXX.cpp
  clang/lib/Sema/SemaCast.cpp
  clang/lib/Sema/SemaExceptionSpec.cpp
  clang/lib/Sema/TreeTransform.h
  clang/lib/Serialization/ASTReaderStmt.cpp
  clang/lib/Serialization/ASTWriter.cpp
  clang/lib/Serialization/ASTWriterStmt.cpp
  clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
  clang/test/CodeGenOpenCLCXX/addrspace_cast.cl
  clang/test/Index/cxx.cl
  clang/test/SemaOpenCLCXX/addrspace_cast.cl
  clang/test/SemaOpenCLCXX/addrspace_cast_ast_dump.cl
  clang/tools/libclang/CIndex.cpp
  clang/tools/libclang/CXCursor.cpp

Index: clang/tools/libclang/CXCursor.cpp
===
--- clang/tools/libclang/CXCursor.cpp
+++ clang/tools/libclang/CXCursor.cpp
@@ -491,6 +491,10 @@
 K = CXCursor_CXXFunctionalCastExpr;
 break;
 
+  case Stmt::CXXAddrspaceCastExprClass:
+K = CXCursor_CXXAddrspaceCastExpr;
+break;
+
   case Stmt::CXXTypeidExprClass:
 K = CXCursor_CXXTypeidExpr;
 break;
Index: clang/tools/libclang/CIndex.cpp
===
--- clang/tools/libclang/CIndex.cpp
+++ clang/tools/libclang/CIndex.cpp
@@ -5237,6 +5237,8 @@
 return cxstring::createRef("CXXConstCastExpr");
   case CXCursor_CXXFunctionalCastExpr:
 return cxstring::createRef("CXXFunctionalCastExpr");
+  case CXCursor_CXXAddrspaceCastExpr:
+return cxstring::createRef("CXXAddrspaceCastExpr");
   case CXCursor_CXXTypeidExpr:
 return cxstring::createRef("CXXTypeidExpr");
   case CXCursor_CXXBoolLiteralExpr:
Index: clang/test/SemaOpenCLCXX/addrspace_cast_ast_dump.cl
===
--- /dev/null
+++ clang/test/SemaOpenCLCXX/addrspace_cast_ast_dump.cl
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -pedantic -verify -ast-dump | FileCheck %s
+
+// expected-no-diagnostics
+
+//CHECK:`-FunctionDecl {{.*}} bar 'void (__global int *__private)'
+//CHECK:  |-ParmVarDecl {{.*}} used gl '__global int *__private'
+//CHECK:  `-VarDecl {{.*}} gen '__generic int *__private' cinit
+//CHECK:`-CXXAddrspaceCastExpr {{.*}} '__generic int *' addrspace_cast<__generic int *> 
+//CHECK:  `-DeclRefExpr {{.*}} '__global int *__private' lvalue ParmVar {{.*}} 'gl' '__global int *__private'
+
+void bar(global int *gl) {
+  int *gen = addrspace_cast(gl);
+}
Index: clang/test/SemaOpenCLCXX/addrspace_cast.cl
===
--- /dev/null
+++ clang/test/SemaOpenCLCXX/addrspace_cast.cl
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -pedantic -verify -fsyntax-only
+
+void foo(global int *gl, const global int *gl_const, global int &gl_ref) {
+  //FIXME: Diagnostics can be improved to be more specific in some cases.
+  float *gen_fl = addrspace_cast(gl); //expected-error{{addrspace_cast from '__global int *__private' to '__generic float *' is not allowed}}
+
+  int i = addrspace_cast(gl); //expected-error{{addrspace_cast from '__global int *__private' to 'int' is not allowed}}
+
+  int *gen = addrspace_cast(*gl); //expected-error{{addrspace_cast from '__global int' to '__generic int *' is not allowed}}
+
+  local int *loc = addrspace_cast(gl); //expected-error{{addrspace_cast from '__global int *__private' to '__local int *' converts between mismatching address spaces}}
+
+  int *gen2 = addrspace_cast(gl_const); //expected-error{{addrspace_cast from 'const __global int *__private' to '__generic int *' is not allowed}}
+
+  //FIXME: Do we expect this behavior? This will get cast successfully as reinterpret_cast.
+  int &gen_ref = addrspace_cast(gl_ref); //expected-error{{addrspace_cast from '__global int' to '__generic int &' is not allowed}}
+
+  __private int *priv = addrspace_cast<__private int *>(&i);
+}
+
+template 
+void test_temp(__global int *par) {
+  T *var1 = addrspace_cast(par); //expected-error{{addrspace_cast from '__global int *__private' to '__private int *' converts

[PATCH] D79693: [test][ARM][CMSE] Use -ffreestanding for arm_cmse.h tests

2020-05-10 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast created this revision.
hubert.reinterpretcast added reviewers: chill, dmgreen.
Herald added subscribers: danielkiss, kristof.beyls.
Herald added a project: clang.

The `arm_cmse.h` header includes standard headers, but some tests that include 
this header explicitly specify a target. The standard headers found via the 
standard include paths need not be compatible with the explicitly-specified 
target from the tests. In order to avoid test failures caused by such 
incompatibility, this patch adds `-ffreestanding` to the tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79693

Files:
  clang/test/CodeGen/arm-cmse-nonsecure.c
  clang/test/CodeGen/arm-cmse-secure.c


Index: clang/test/CodeGen/arm-cmse-secure.c
===
--- clang/test/CodeGen/arm-cmse-secure.c
+++ clang/test/CodeGen/arm-cmse-secure.c
@@ -1,5 +1,5 @@
-// RUN: %clang -mlittle-endian -mcmse -target thumbv8m.base-eabi -emit-llvm -S 
-o - %s | FileCheck %s
-// RUN: %clang -mbig-endian-mcmse -target thumbv8m.base-eabi -emit-llvm -S 
-o - %s | FileCheck %s
+// RUN: %clang -ffreestanding -mlittle-endian -mcmse -target 
thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
+// RUN: %clang -ffreestanding -mbig-endian-mcmse -target 
thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
 
 #include 
 
Index: clang/test/CodeGen/arm-cmse-nonsecure.c
===
--- clang/test/CodeGen/arm-cmse-nonsecure.c
+++ clang/test/CodeGen/arm-cmse-nonsecure.c
@@ -1,5 +1,5 @@
-// RUN: %clang  -mlittle-endian -target thumbv8m.base-eabi  -emit-llvm -S -o - 
%s | FileCheck %s
-// RUN: %clang  -mbig-endian-target thumbv8m.base-eabi  -emit-llvm -S -o - 
%s | FileCheck %s
+// RUN: %clang -ffreestanding -mlittle-endian -target thumbv8m.base-eabi 
-emit-llvm -S -o - %s | FileCheck %s
+// RUN: %clang -ffreestanding -mbig-endian-target thumbv8m.base-eabi 
-emit-llvm -S -o - %s | FileCheck %s
 
 #include 
 


Index: clang/test/CodeGen/arm-cmse-secure.c
===
--- clang/test/CodeGen/arm-cmse-secure.c
+++ clang/test/CodeGen/arm-cmse-secure.c
@@ -1,5 +1,5 @@
-// RUN: %clang -mlittle-endian -mcmse -target thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
-// RUN: %clang -mbig-endian-mcmse -target thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
+// RUN: %clang -ffreestanding -mlittle-endian -mcmse -target thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
+// RUN: %clang -ffreestanding -mbig-endian-mcmse -target thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
 
 #include 
 
Index: clang/test/CodeGen/arm-cmse-nonsecure.c
===
--- clang/test/CodeGen/arm-cmse-nonsecure.c
+++ clang/test/CodeGen/arm-cmse-nonsecure.c
@@ -1,5 +1,5 @@
-// RUN: %clang  -mlittle-endian -target thumbv8m.base-eabi  -emit-llvm -S -o - %s | FileCheck %s
-// RUN: %clang  -mbig-endian-target thumbv8m.base-eabi  -emit-llvm -S -o - %s | FileCheck %s
+// RUN: %clang -ffreestanding -mlittle-endian -target thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
+// RUN: %clang -ffreestanding -mbig-endian-target thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
 
 #include 
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 25544ce - [gcov] Default coverage version to '407*' and delete CC1 option -coverage-cfg-checksum

2020-05-10 Thread Fangrui Song via cfe-commits

Author: Fangrui Song
Date: 2020-05-10T16:14:07-07:00
New Revision: 25544ce2df0daa4304c07e64b9c8b0f7df60c11d

URL: 
https://github.com/llvm/llvm-project/commit/25544ce2df0daa4304c07e64b9c8b0f7df60c11d
DIFF: 
https://github.com/llvm/llvm-project/commit/25544ce2df0daa4304c07e64b9c8b0f7df60c11d.diff

LOG: [gcov] Default coverage version to '407*' and delete CC1 option 
-coverage-cfg-checksum

Defaulting to -Xclang -coverage-version='407*' makes .gcno/.gcda
compatible with gcov [4.7,8)

In addition, delete clang::CodeGenOptionsBase::CoverageExtraChecksum and 
GCOVOptions::UseCfgChecksum.
We can infer the information from the version.

With this change, .gcda files produced by `clang --coverage a.o` linked 
executable can be read by gcov 4.7~7.
We don't need other -Xclang -coverage* options.
There may be a mismatching version warning, though.

(Note, GCC r173147 "split checksum into cfg checksum and line checksum"
 made gcov 4.7 incompatible with previous versions.)

Added: 


Modified: 
clang/include/clang/Basic/CodeGenOptions.def
clang/include/clang/Driver/CC1Options.td
clang/lib/Basic/CodeGenOptions.cpp
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/code-coverage.c
compiler-rt/lib/profile/GCDAProfiling.c
llvm/include/llvm/Transforms/Instrumentation.h
llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
llvm/test/Transforms/GCOVProfiling/function-numbering.ll
llvm/test/Transforms/GCOVProfiling/version.ll

Removed: 




diff  --git a/clang/include/clang/Basic/CodeGenOptions.def 
b/clang/include/clang/Basic/CodeGenOptions.def
index caf652ad7bbb..61982da889ed 100644
--- a/clang/include/clang/Basic/CodeGenOptions.def
+++ b/clang/include/clang/Basic/CodeGenOptions.def
@@ -39,7 +39,6 @@ CODEGENOPT(ObjCAutoRefCountExceptions , 1, 0) ///< Whether 
ARC should be EH-safe
 CODEGENOPT(Backchain , 1, 0) ///< -mbackchain
 CODEGENOPT(ControlFlowGuardNoChecks  , 1, 0) ///< -cfguard-no-checks
 CODEGENOPT(ControlFlowGuard  , 1, 0) ///< -cfguard
-CODEGENOPT(CoverageExtraChecksum, 1, 0) ///< Whether we need a second checksum 
for functions in GCNO files.
 CODEGENOPT(CoverageExitBlockBeforeBody, 1, 0) ///< Whether to emit the exit 
block before the body blocks in GCNO files.
 CODEGENOPT(CXAAtExit , 1, 1) ///< Use __cxa_atexit for calling 
destructors.
 CODEGENOPT(RegisterGlobalDtorsWithAtExit, 1, 1) ///< Use atexit or 
__cxa_atexit to register global destructors.

diff  --git a/clang/include/clang/Driver/CC1Options.td 
b/clang/include/clang/Driver/CC1Options.td
index 7d04d80eda81..85407ce7eee3 100644
--- a/clang/include/clang/Driver/CC1Options.td
+++ b/clang/include/clang/Driver/CC1Options.td
@@ -262,8 +262,6 @@ def coverage_notes_file : Separate<["-"], 
"coverage-notes-file">,
   HelpText<"Emit coverage notes to this filename.">;
 def coverage_notes_file_EQ : Joined<["-"], "coverage-notes-file=">,
   Alias;
-def coverage_cfg_checksum : Flag<["-"], "coverage-cfg-checksum">,
-  HelpText<"Emit CFG checksum for functions in .gcno files.">;
 def coverage_exit_block_before_body : Flag<["-"], 
"coverage-exit-block-before-body">,
   HelpText<"Emit the exit block before the body blocks in .gcno files.">;
 def coverage_version_EQ : Joined<["-"], "coverage-version=">,

diff  --git a/clang/lib/Basic/CodeGenOptions.cpp 
b/clang/lib/Basic/CodeGenOptions.cpp
index fa186380f109..8d3aeda1b91f 100644
--- a/clang/lib/Basic/CodeGenOptions.cpp
+++ b/clang/lib/Basic/CodeGenOptions.cpp
@@ -17,7 +17,7 @@ CodeGenOptions::CodeGenOptions() {
 #include "clang/Basic/CodeGenOptions.def"
 
   RelocationModel = llvm::Reloc::PIC_;
-  memcpy(CoverageVersion, "402*", 4);
+  memcpy(CoverageVersion, "407*", 4);
 }
 
 bool CodeGenOptions::isNoBuiltinFunc(const char *Name) const {

diff  --git a/clang/lib/CodeGen/BackendUtil.cpp 
b/clang/lib/CodeGen/BackendUtil.cpp
index 0c31bc026ab2..ba4b48d8bd5f 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -530,7 +530,6 @@ static Optional getGCOVOptions(const 
CodeGenOptions &CodeGenOpts) {
   Options.EmitNotes = CodeGenOpts.EmitGcovNotes;
   Options.EmitData = CodeGenOpts.EmitGcovArcs;
   llvm::copy(CodeGenOpts.CoverageVersion, std::begin(Options.Version));
-  Options.UseCfgChecksum = CodeGenOpts.CoverageExtraChecksum;
   Options.NoRedZone = CodeGenOpts.DisableRedZone;
   Options.Filter = CodeGenOpts.ProfileFilterFiles;
   Options.Exclude = CodeGenOpts.ProfileExcludeFiles;

diff  --git a/clang/lib/Frontend/CompilerInvocation.cpp 
b/clang/lib/Frontend/CompilerInvocation.cpp
index 6a358f235d8a..e3a57d654207 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1017,7 +1017,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, 
ArgList &Args, InputKind IK,
 std::string(Args.getLastArgValue(OPT_coverage_data_file));
 Opts.CoverageN

[PATCH] D79694: [tests][Driver] Set `--sysroot=""` to allow `DEFAULT_SYSROOT` build

2020-05-10 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast created this revision.
hubert.reinterpretcast added reviewers: broadwaylamb, sepavloff, jyknight, 
mstorsjo.
Herald added a project: clang.

If `DEFAULT_SYSROOT` is configured to some path, some tests would fail. This 
patch overrides `sysroot` to be the empty string in the style of D66834 
 so that the tests will pass even when the 
build is configured with a `DEFAULT_SYSROOT`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79694

Files:
  clang/test/Driver/darwin-header-search-libcxx.cpp
  clang/test/Driver/darwin-header-search-system.cpp
  clang/test/Driver/mingw-sysroot.cpp


Index: clang/test/Driver/mingw-sysroot.cpp
===
--- clang/test/Driver/mingw-sysroot.cpp
+++ clang/test/Driver/mingw-sysroot.cpp
@@ -17,7 +17,7 @@
 // If we find a gcc in the path with the right triplet prefix, pick that as
 // sysroot:
 
-// RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" %clang -target 
x86_64-w64-mingw32 -rtlib=platform -stdlib=libstdc++ -c -### %s 2>&1 | 
FileCheck -check-prefix=CHECK_TESTROOT_GCC %s
+// RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" %clang -target 
x86_64-w64-mingw32 -rtlib=platform -stdlib=libstdc++ --sysroot="" -c -### %s 
2>&1 | FileCheck -check-prefix=CHECK_TESTROOT_GCC %s
 // CHECK_TESTROOT_GCC: 
"{{.*}}/testroot-gcc{{/|}}lib{{/|}}gcc{{/|}}x86_64-w64-mingw32{{/|}}5.3-posix{{/|}}include{{/|}}c++"
 // CHECK_TESTROOT_GCC: 
"{{.*}}/testroot-gcc{{/|}}lib{{/|}}gcc{{/|}}x86_64-w64-mingw32{{/|}}5.3-posix{{/|}}include{{/|}}c++{{/|}}x86_64-w64-mingw32"
 // CHECK_TESTROOT_GCC: 
"{{.*}}/testroot-gcc{{/|}}lib{{/|}}gcc{{/|}}x86_64-w64-mingw32{{/|}}5.3-posix{{/|}}include{{/|}}c++{{/|}}backward"
@@ -27,7 +27,7 @@
 // If there's a matching sysroot next to the clang binary itself, prefer that
 // over a gcc in the path:
 
-// RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" 
%T/testroot-clang/bin/x86_64-w64-mingw32-clang -target x86_64-w64-mingw32 
-rtlib=compiler-rt -stdlib=libstdc++ -c -### %s 2>&1 | FileCheck 
-check-prefix=CHECK_TESTROOT_CLANG %s
+// RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" 
%T/testroot-clang/bin/x86_64-w64-mingw32-clang -target x86_64-w64-mingw32 
-rtlib=compiler-rt -stdlib=libstdc++ --sysroot="" -c -### %s 2>&1 | FileCheck 
-check-prefix=CHECK_TESTROOT_CLANG %s
 // CHECK_TESTROOT_CLANG: 
"{{.*}}/testroot-clang{{/|}}x86_64-w64-mingw32{{/|}}include"
 
 
@@ -35,4 +35,4 @@
 // happens to be in the same directory as gcc, make sure we still can pick up
 // the libgcc directory:
 
-// RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" 
%T/testroot-gcc/bin/x86_64-w64-mingw32-clang -target x86_64-w64-mingw32 
-rtlib=platform -stdlib=libstdc++ -c -### %s 2>&1 | FileCheck 
-check-prefix=CHECK_TESTROOT_GCC %s
+// RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" 
%T/testroot-gcc/bin/x86_64-w64-mingw32-clang -target x86_64-w64-mingw32 
-rtlib=platform -stdlib=libstdc++ --sysroot="" -c -### %s 2>&1 | FileCheck 
-check-prefix=CHECK_TESTROOT_GCC %s
Index: clang/test/Driver/darwin-header-search-system.cpp
===
--- clang/test/Driver/darwin-header-search-system.cpp
+++ clang/test/Driver/darwin-header-search-system.cpp
@@ -95,6 +95,7 @@
 // RUN: -target x86_64-apple-darwin \
 // RUN: -ccc-install-dir 
%S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
 // RUN: -resource-dir=%S/Inputs/resource_dir \
+// RUN: --sysroot="" \
 // RUN:   | FileCheck -DRESOURCE=%S/Inputs/resource_dir \
 // RUN:   --check-prefix=CHECK-NOSYSROOT %s
 // CHECK-NOSYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
Index: clang/test/Driver/darwin-header-search-libcxx.cpp
===
--- clang/test/Driver/darwin-header-search-libcxx.cpp
+++ clang/test/Driver/darwin-header-search-libcxx.cpp
@@ -20,6 +20,7 @@
 // RUN: -target x86_64-apple-darwin \
 // RUN: -stdlib=libc++ \
 // RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin \
+// RUN: --sysroot="" \
 // RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain 
--check-prefix=CHECK-LIBCXX-TOOLCHAIN-1 %s
 // CHECK-LIBCXX-TOOLCHAIN-1: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
 // CHECK-LIBCXX-TOOLCHAIN-1: "-internal-isystem" 
"[[TOOLCHAIN]]/usr/bin/../include/c++/v1"


Index: clang/test/Driver/mingw-sysroot.cpp
===
--- clang/test/Driver/mingw-sysroot.cpp
+++ clang/test/Driver/mingw-sysroot.cpp
@@ -17,7 +17,7 @@
 // If we find a gcc in the path with the right triplet prefix, pick that as
 // sysroot:
 
-// RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" %clang -target x86_64-w64-mingw32 -rtlib=platform -stdlib=libstdc++ -c -### %s 2>&1 | FileCheck -check-prefix=CHECK_TESTROOT_GCC %s
+// RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" %clang -target x86_64-w64-mingw32 -rtlib=p

[PATCH] D79698: Run Coverage pass before other *San passes under new pass manager

2020-05-10 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks created this revision.
aeubanks added reviewers: vitalybuka, leonardchan.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This fixes compiler-rt/test/msan/coverage-levels.cpp under the new pass manager 
(final check-msan test!).
Under the old pass manager, the coverage pass would run before the MSan pass. 
The opposite happened under the new pass manager. The MSan pass adds extra 
basic blocks, changing the number of coverage callbacks.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79698

Files:
  clang/lib/CodeGen/BackendUtil.cpp


Index: clang/lib/CodeGen/BackendUtil.cpp
===
--- clang/lib/CodeGen/BackendUtil.cpp
+++ clang/lib/CodeGen/BackendUtil.cpp
@@ -1004,6 +1004,15 @@
   const Triple &TargetTriple,
   const LangOptions &LangOpts,
   const CodeGenOptions &CodeGenOpts) {
+  if (CodeGenOpts.SanitizeCoverageType ||
+  CodeGenOpts.SanitizeCoverageIndirectCalls ||
+  CodeGenOpts.SanitizeCoverageTraceCmp) {
+auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
+MPM.addPass(ModuleSanitizerCoveragePass(
+SancovOpts, CodeGenOpts.SanitizeCoverageWhitelistFiles,
+CodeGenOpts.SanitizeCoverageBlacklistFiles));
+  }
+
   auto ASanPass = [&](SanitizerMask Mask, bool CompileKernel) {
 MPM.addPass(RequireAnalysisPass());
 bool Recover = CodeGenOpts.SanitizeRecover.has(Mask);
@@ -1244,6 +1253,17 @@
 EntryExitInstrumenterPass(/*PostInlining=*/false)));
   });
 
+  if (CodeGenOpts.SanitizeCoverageType ||
+  CodeGenOpts.SanitizeCoverageIndirectCalls ||
+  CodeGenOpts.SanitizeCoverageTraceCmp) {
+PB.registerPipelineStartEPCallback([&](ModulePassManager &MPM) {
+  auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
+  MPM.addPass(ModuleSanitizerCoveragePass(
+  SancovOpts, CodeGenOpts.SanitizeCoverageWhitelistFiles,
+  CodeGenOpts.SanitizeCoverageBlacklistFiles));
+});
+  }
+
   // Register callbacks to schedule sanitizer passes at the appropriate 
part of
   // the pipeline.
   // FIXME: either handle asan/the remaining sanitizers or error out
@@ -1328,15 +1348,6 @@
   }
 }
 
-if (CodeGenOpts.SanitizeCoverageType ||
-CodeGenOpts.SanitizeCoverageIndirectCalls ||
-CodeGenOpts.SanitizeCoverageTraceCmp) {
-  auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
-  MPM.addPass(ModuleSanitizerCoveragePass(
-  SancovOpts, CodeGenOpts.SanitizeCoverageWhitelistFiles,
-  CodeGenOpts.SanitizeCoverageBlacklistFiles));
-}
-
 if (LangOpts.Sanitize.has(SanitizerKind::HWAddress)) {
   bool Recover = CodeGenOpts.SanitizeRecover.has(SanitizerKind::HWAddress);
   MPM.addPass(HWAddressSanitizerPass(


Index: clang/lib/CodeGen/BackendUtil.cpp
===
--- clang/lib/CodeGen/BackendUtil.cpp
+++ clang/lib/CodeGen/BackendUtil.cpp
@@ -1004,6 +1004,15 @@
   const Triple &TargetTriple,
   const LangOptions &LangOpts,
   const CodeGenOptions &CodeGenOpts) {
+  if (CodeGenOpts.SanitizeCoverageType ||
+  CodeGenOpts.SanitizeCoverageIndirectCalls ||
+  CodeGenOpts.SanitizeCoverageTraceCmp) {
+auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
+MPM.addPass(ModuleSanitizerCoveragePass(
+SancovOpts, CodeGenOpts.SanitizeCoverageWhitelistFiles,
+CodeGenOpts.SanitizeCoverageBlacklistFiles));
+  }
+
   auto ASanPass = [&](SanitizerMask Mask, bool CompileKernel) {
 MPM.addPass(RequireAnalysisPass());
 bool Recover = CodeGenOpts.SanitizeRecover.has(Mask);
@@ -1244,6 +1253,17 @@
 EntryExitInstrumenterPass(/*PostInlining=*/false)));
   });
 
+  if (CodeGenOpts.SanitizeCoverageType ||
+  CodeGenOpts.SanitizeCoverageIndirectCalls ||
+  CodeGenOpts.SanitizeCoverageTraceCmp) {
+PB.registerPipelineStartEPCallback([&](ModulePassManager &MPM) {
+  auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
+  MPM.addPass(ModuleSanitizerCoveragePass(
+  SancovOpts, CodeGenOpts.SanitizeCoverageWhitelistFiles,
+  CodeGenOpts.SanitizeCoverageBlacklistFiles));
+});
+  }
+
   // Register callbacks to schedule sanitizer passes at the appropriate part of
   // the pipeline.
   // FIXME: either handle asan/the remaining sanitizers or error out
@@ -1328,15 +1348,6 @@
   }
 }
 
-if (CodeGenOpts.SanitizeCoverageType ||
-CodeGenOpts.SanitizeCoverageIndirectCalls ||
-CodeGenOpts.SanitizeCoverageTraceCmp) {
-  auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
-  MPM.addPass(ModuleSanitizerCoveragePass(
-  SancovOpts, CodeGenOpts.San

[PATCH] D72841: Add support for pragma float_control, to control precision and exception behavior at the source level

2020-05-10 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment.

In D72841#2027740 , @plotfi wrote:

> Hi @rjmccall, I am also seeing similar failures. It is failing on apple's 
> master (and the swift branches as well) because ParseLangArgs and 
> ParseCodeGenArgs are getting called in the opposite order in apple/master 
> from the order they are called in llvm/master. I posted a PR to fix those 
> failures here: https://github.com/apple/llvm-project/pull/1202
>
> but I don't know if this is the most correct approach.


Oh, thank you for figuring that out.  Yeah, it's reasonable for code-gen option 
parsing to depend on language-option parsing, which means that this patch is 
wrong.  The right fix is that we need to stop parsing these as code-gen 
options, which is reasonable since they have direct language-semantics impact.  
If we still need the code-gen option flags, we should be able to recreate them 
from the language options, I think.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72841/new/

https://reviews.llvm.org/D72841



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D72841: Add support for pragma float_control, to control precision and exception behavior at the source level

2020-05-10 Thread Puyan Lotfi via Phabricator via cfe-commits
plotfi added a comment.

@rjmccall @mibintc Can we revert this patch for now then, and re-land when this 
patch is reworked? It would be good to get those bots passing. @rjmccall are 
the bots that you see failing on your end public?

In D72841#2028834 , @rjmccall wrote:

> In D72841#2027740 , @plotfi wrote:
>
> > Hi @rjmccall, I am also seeing similar failures. It is failing on apple's 
> > master (and the swift branches as well) because ParseLangArgs and 
> > ParseCodeGenArgs are getting called in the opposite order in apple/master 
> > from the order they are called in llvm/master. I posted a PR to fix those 
> > failures here: https://github.com/apple/llvm-project/pull/1202
> >
> > but I don't know if this is the most correct approach.
>
>
> Oh, thank you for figuring that out.  Yeah, it's reasonable for code-gen 
> option parsing to depend on language-option parsing, which means that this 
> patch is wrong.  The right fix is that we need to stop parsing these as 
> code-gen options, which is reasonable since they have direct 
> language-semantics impact.  If we still need the code-gen option flags, we 
> should be able to recreate them from the language options, I think.





Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72841/new/

https://reviews.llvm.org/D72841



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79477: [clang-tidy] Add --use-color command line option and UseColor option to control colors in diagnostics

2020-05-10 Thread hyd-dev via Phabricator via cfe-commits
hyd-dev added a comment.

In D79477#2028637 , @njames93 wrote:

> What I mean to say is, if the behaviour of the testing environment changes to 
> pipe the result to a terminal that supports color, it could cause this test 
> case to also fail.


The standard output is always piped to `FileCheck`'s standard input. It will 
never become "a terminal that supports color".
Standard error is not redirected explicitly, but it is not used to detect color 
support.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79477/new/

https://reviews.llvm.org/D79477



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79526: [CUDA][HIP] Workaround for resolving host device function against wrong-sided function

2020-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment.

In D79526#2027552 , @tra wrote:

> In D79526#2027470 , @yaxunl wrote:
>
> > For implicit host device functions, since they are not guaranteed to work 
> > in device compilation, we can only resolve them as if they are host 
> > functions. This causes asymmetry but implicit host device functions are 
> > originally host functions so it is biased toward host compilation in the 
> > beginning.
>
>
> I don't think that the assertion that `implicit host device functions are 
> originally host functions` is always true. While in practice most such 
> functions may indeed come from the existing host code (e.g. the standard 
> library), I don't see any inherent reason why they can't come from the code 
> written for GPU. E.g. thrust is likely to have some implicitly HD functions 
> in the code that was not intended for CPUs and your assumption will be wrong. 
> Even if such case may not exist now, it would not be unreasonable for users 
> to have such code on device. 
>  This overload resolution difference is observable and it will likely create 
> new corner cases in convoluted enough C++ code.


I agree currently it is possible to force a device function to be implicitly 
host device by pragma. However it is arguable whether we should have special 
handling of overload resolution in this case. We do special handling of 
overload resolution because we can not modify some system headers which are 
intended for host originally. If a function was originally device function, it 
is CUDA/HIP code and it should follow normal overloading resolution rule and 
should be fixed if issues occur when it is marked as a host device function.

> I think we need something more principled than "happens to work for existing 
> code".
> 
>> Only the original resolution guarantees no other issues.  For example, in 
>> the failed compilation in TF, some ctor of std::atomic becomes implicit host 
>> device function because it is constexpr. We should treated as wrong-sided in 
>> device compilation, but we should treated as same-sided in host compilation, 
>> otherwise it changes the resolution in host compilation and causes other 
>> issues.
> 
> It may be true for atomic, where we do need to have GPU-specific 
> implementation. However, I can also see classes with constexpr constructors 
> that are prefectly usable on both sides and do not have to be treated as the 
> wrong-side.

Before this patch (together with the reverted commit), the device host 
candidates are always treated with the same preference as wrong-sided 
candidates in device compilation, so a wrong-sided candidate may hide a viable 
host device candidate. This patch fixes that for most cases, including: 1. host 
compilation 2. explicit host device caller 3. explicit host device callee. Only 
in device compilation when an implicit host device caller calls an implicit 
host device callee we apply the special 'incorrect' overloading resolution 
rule. If the special handling causes undesirable effect on users code, users 
can either mark the caller or callee to be explicit host device to bypass the 
special handling.

> TBH, I do not see any reasonable way to deal with this with the current 
> implementation of how HD functions are treated. This patch and its base do 
> improve things somewhat, but it all comes at the cost of further complexity 
> and potentially paints us even deeper into a corner. Current behavior is 
> already rather hard to explain.
> 
> Some time back @wash from NVIDIA was asking about improving HD function 
> handling. Maybe it's time for all interested parties to figure out whether 
> it's time to come up with a better solution. Not in this patch, obviously.

This patch is trying to fix the incorrect overloading resolution rule about 
host device callee in host device caller. It should be favored over wrong-sided 
callee but currently it is not.

If we reject this patch, we have to bear with the incorrect overloading rule 
until a better fix is implemented.

The complexity introduced by this patch is that it needs to have special rule 
for implicit host device caller and implicit host device callee in device 
compilation, where implicit host device callee is not favored over wrong-sided 
callee to preserve the overloading resolution result as if they are both host 
callees. This is to allow some functions in system headers becoming implicitly 
host device functions without causing undeferrable diagnostics.

The complexity introduced in the compiler code is not significant: a new 
function Sema::IsCUDAImplicitHostDeviceFunction is introduced and used in 
isBetterOverloadCandidate to detect the special situation that needs special 
handling. The code for special handling is trivial.

The complexity introduced in the overloading resolution rule is somehow 
concerning.

Before this patch, the rule is: same sided candidates are favored over wrong 

[PATCH] D78900: [HIP][AMDGPU] Enable structurizer workarounds

2020-05-10 Thread Sameer Sahasrabuddhe via Phabricator via cfe-commits
sameerds marked an inline comment as done.
sameerds added inline comments.



Comment at: clang/lib/Driver/ToolChains/HIP.cpp:158
   Args.MakeArgString(Twine("-filetype=") + (OutputIsAsm ? "asm" : "obj")));
+  LlcArgs.push_back("--amdgpu-enable-structurizer-workarounds");
 

sameerds wrote:
> arsenm wrote:
> > We should just flip this in the backend. llc flags are not intended for 
> > frontends to set options
> Admittedly, this is a broken workflow. I am not even sure if Clang should be 
> invoking llc at all. Ideally, we would want to eliminate this flag entirely. 
> But flipping it is okay too if graphics workloads are sensitive to it. The 
> priority right now is to enable the workarounds officially only for HIP and 
> this seems to be most concise way to do it. We can flip the flag once other 
> users of the AMDGPU are on board.
To clarify, we can flip it in the backend if graphcis workloads are **not** 
sensitive to it. But HIP needs this earlier.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78900/new/

https://reviews.llvm.org/D78900



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79694: [tests][Driver] Set `--sysroot=""` to allow `DEFAULT_SYSROOT` build

2020-05-10 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo accepted this revision.
mstorsjo added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79694/new/

https://reviews.llvm.org/D79694



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79692: [clangd] Make version in PublishDiagnosticsParams optional

2020-05-10 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.



Comment at: clang-tools-extra/clangd/Protocol.cpp:569
+Result["version"] = PDP.version;
+  // FIXME: workaround for older gcc/clang
+  return std::move(Result);

nit: I'm not sure it's actually worth having these comments everywhere. The 
move is harmless apart from readability, and the readability of drawing 
attention to them seems worse.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79692/new/

https://reviews.llvm.org/D79692



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79587: [CodeGen][SVE] Legalisation of extends with scalable types

2020-05-10 Thread David Sherwood via Phabricator via cfe-commits
david-arm added a comment.

Hi Kerry, I think we do already have some suitable test files where perhaps you 
could add your tests instead of creating new files? For example, there are:

CodeGen/AArch64/sve-int-arith.ll (perhaps integer divides and shifts could live 
there?)
CodeGen/AArch64/sve-int-div-pred.ll (some divides already in here)
CodeGen/AArch64/sve-sext-zext.ll (extend tests recently added)

Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79587/new/

https://reviews.llvm.org/D79587



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79587: [CodeGen][SVE] Legalisation of extends with scalable types

2020-05-10 Thread David Sherwood via Phabricator via cfe-commits
david-arm added a comment.

Hi @efriedma, is there a target-independent equivalent of SUNPKHI? From a quick 
glance at the codebase where X86 uses ISD::SIGN_EXTEND_VECTOR_INREG it seems 
vector shuffles are still required for the Hi part, which is fine for fixed 
length vectors I guess.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79587/new/

https://reviews.llvm.org/D79587



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D78598: [clangd] Remove vscode plugin: now https://github.com/clangd/vscode-clangd

2020-05-10 Thread Nathan Ridge via Phabricator via cfe-commits
nridge added a comment.

Also, does this mean that patches to vscode-clangd should now be submitted as a 
Github PR rather than via Phabricator?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78598/new/

https://reviews.llvm.org/D78598



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits