[PATCH] D66384: [clang-format] Fix a bug that joins template closer and =

2019-08-18 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision.
MyDeveloperDay added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rC Clang

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

https://reviews.llvm.org/D66384



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


[PATCH] D61256: [clang-format][docs] Fix the Google C++ and Chromium style guide URLs

2019-08-18 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment.

This patch is needs rebasing


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61256



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


r369206 - [Diagnostics] Improve -Wsizeof-pointer-div

2019-08-18 Thread David Bolvansky via cfe-commits
Author: xbolva00
Date: Sun Aug 18 03:10:09 2019
New Revision: 369206

URL: http://llvm.org/viewvc/llvm-project?rev=369206&view=rev
Log:
[Diagnostics] Improve -Wsizeof-pointer-div

Emit diag note with a location of pointer declaration.
Revisited/added tests.


Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/Sema/div-sizeof-ptr.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=369206&r1=369205&r2=369206&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sun Aug 18 03:10:09 
2019
@@ -3346,6 +3346,8 @@ def warn_address_of_reference_null_compa
   InGroup;
 def note_reference_is_return_value : Note<"%0 returns a reference">;
 
+def note_pointer_declared_here : Note<
+  "pointer %0 declared here">;
 def warn_division_sizeof_ptr : Warning<
   "'%0' will return the size of the pointer, not the array itself">,
   InGroup>;

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=369206&r1=369205&r2=369206&view=diff
==
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Sun Aug 18 03:10:09 2019
@@ -9075,7 +9075,8 @@ static void DiagnoseDivisionSizeofPointe
   RUE->getKind() != UETT_SizeOf)
 return;
 
-  QualType LHSTy = LUE->getArgumentExpr()->IgnoreParens()->getType();
+  const Expr *LHSArg = LUE->getArgumentExpr()->IgnoreParens();
+  QualType LHSTy = LHSArg->getType();
   QualType RHSTy;
 
   if (RUE->isArgumentType())
@@ -9085,10 +9086,15 @@ static void DiagnoseDivisionSizeofPointe
 
   if (!LHSTy->isPointerType() || RHSTy->isPointerType())
 return;
-  if (LHSTy->getPointeeType() != RHSTy)
+  if (LHSTy->getPointeeType().getCanonicalType() != RHSTy.getCanonicalType())
 return;
 
   S.Diag(Loc, diag::warn_division_sizeof_ptr) << LHS << LHS->getSourceRange();
+  if (const auto *DRE = dyn_cast(LHSArg)) {
+if (const ValueDecl *LHSArgDecl = DRE->getDecl())
+  S.Diag(LHSArgDecl->getLocation(), diag::note_pointer_declared_here)
+  << LHSArgDecl;
+  }
 }
 
 static void DiagnoseBadDivideOrRemainderValues(Sema& S, ExprResult &LHS,

Modified: cfe/trunk/test/Sema/div-sizeof-ptr.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/div-sizeof-ptr.cpp?rev=369206&r1=369205&r2=369206&view=diff
==
--- cfe/trunk/test/Sema/div-sizeof-ptr.cpp (original)
+++ cfe/trunk/test/Sema/div-sizeof-ptr.cpp Sun Aug 18 03:10:09 2019
@@ -5,12 +5,20 @@ int f(Ty (&Array)[N]) {
   return sizeof(Array) / sizeof(Ty); // Should not warn
 }
 
-void test(int *p, int **q) {
+typedef int int32;
+
+void test(int *p, int **q) { // expected-note 5 {{pointer 'p' declared 
here}}
   int a1 = sizeof(p) / sizeof(*p);   // expected-warning {{'sizeof (p)' will 
return the size of the pointer, not the array itself}}
   int a2 = sizeof p / sizeof *p; // expected-warning {{'sizeof p' will 
return the size of the pointer, not the array itself}}
-  int a3 = sizeof(*q) / sizeof(**q); // expected-warning {{'sizeof (*q)' will 
return the size of the pointer, not the array itself}}
-  int a4 = sizeof(p) / sizeof(int);  // expected-warning {{'sizeof (p)' will 
return the size of the pointer, not the array itself}}
-  int a5 = sizeof(p) / sizeof(p[0]); // expected-warning {{'sizeof (p)' will 
return the size of the pointer, not the array itself}}
+  int a3 = sizeof(p) / sizeof(int);  // expected-warning {{'sizeof (p)' will 
return the size of the pointer, not the array itself}}
+  int a4 = sizeof(p) / sizeof(p[0]); // expected-warning {{'sizeof (p)' will 
return the size of the pointer, not the array itself}}
+  int a5 = sizeof(p) / sizeof(int32); // expected-warning {{'sizeof (p)' will 
return the size of the pointer, not the array itself}}
+
+  int32 *d;   // expected-note 2 {{pointer 'd' 
declared here}}
+  int a6 = sizeof(d) / sizeof(int32); // expected-warning {{'sizeof (d)' will 
return the size of the pointer, not the array itself}}
+  int a7 = sizeof(d) / sizeof(int);  // expected-warning {{'sizeof (d)' will 
return the size of the pointer, not the array itself}}
+
+  int a8 = sizeof(*q) / sizeof(**q); // expected-warning {{'sizeof (*q)' will 
return the size of the pointer, not the array itself}}
 
   // Should not warn
   int b1 = sizeof(int *) / sizeof(int);
@@ -19,10 +27,10 @@ void test(int *p, int **q) {
   int b4 = sizeof(p) / sizeof(char);
 
   int arr[10];
-  int b5 = sizeof(arr) / sizeof(*arr);
-  int b6 = sizeof(arr) / sizeof(arr[0]);
-  int b7 = sizeof(arr) / sizeof(int);
+  int c1 = sizeof(

[PATCH] D66348: [ASTImporter] Do not look up lambda classes

2019-08-18 Thread Aleksei Sidorin via Phabricator via cfe-commits
a_sidorin added a comment.

Hello Gabor!
I think it's a correct solution for the analyzer: usually, we cannot import a 
lambda until we have to import some enclosing expression - which means that the 
lambdas are actually not the same. But I'm not so sure about how it can affect 
the LLDB logic. @shafik Shafik, could you please take a look?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66348



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


[PATCH] D66384: [clang-format] Fix a bug that joins template closer and =

2019-08-18 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment.

LGTM too, although I would still question whether 
`Style.SpaceBeforeAssignmentOperators` is providing anyone any benefit at all.


Repository:
  rC Clang

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

https://reviews.llvm.org/D66384



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


[PATCH] D66384: [clang-format] Fix a bug that joins template closer and =

2019-08-18 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment.

LGTM too, although I would still question whether 
`Style.SpaceBeforeAssignmentOperators` is providing anyone any benefit at all.




Comment at: clang/unittests/Format/FormatTest.cpp:6631
+  verifyFormat("a = 1;", Style);
+  verifyFormat("a >>= 1;", Style);
 

Actually, could you add a test case specifically for the troublesome 
`enable_if_t` pattern? Just in case any future option treats 
default-template-arguments any differently from assignment-statements, 
whitespace-wise.

verifyformat("template = 0>");



Repository:
  rC Clang

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

https://reviews.llvm.org/D66384



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


[PATCH] D53666: [Tests] Updated tests for D53342

2019-08-18 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment.

Will be handled as NFC commit after D53342  
lands.


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

https://reviews.llvm.org/D53666



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


[PATCH] D66336: [ASTImporter] Add development internals docs

2019-08-18 Thread Aleksei Sidorin via Phabricator via cfe-commits
a_sidorin added a comment.

Hello Gabor,
This doc will become extremely useful for new developers. Thank you for dumping 
this sacred knowledge!




Comment at: clang/docs/InternalsManual.rst:1470
+*templated* class (the ``CXXRecordDecl``) of a ``ClassTemplateDecl`` with
+``ClassTemplateDecl::getTemplatedDec()``. And we can get back a pointer of the
+"described" class template from the *templated* class:

TemplatedDec_l_?



Comment at: clang/docs/InternalsManual.rst:1528
+
+When we compare two classes or enums and one of them is incomplete or has
+unloaded external lexical declarations then we cannot descend to compare their

I think we can extend this to point that import of all named declarations is 
preceded by name lookup.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66336



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


[PATCH] D66393: Set version for libclang

2019-08-18 Thread Isuru Fernando via Phabricator via cfe-commits
isuruf created this revision.
Herald added subscribers: cfe-commits, mgorny.
Herald added a project: clang.
isuruf added a reviewer: clang.
isuruf updated this revision to Diff 215782.

This sets the compatibility version to major version
and current version to the full version and also creates
symlinks so that different library versions can be installed
side by side as in linux


https://reviews.llvm.org/D66393

Files:
  tools/libclang/CMakeLists.txt


Index: tools/libclang/CMakeLists.txt
===
--- tools/libclang/CMakeLists.txt
+++ tools/libclang/CMakeLists.txt
@@ -115,9 +115,10 @@
   VERSION ${LIBCLANG_LIBRARY_VERSION}
   DEFINE_SYMBOL _CINDEX_LIB_)
   elseif(APPLE)
-set(LIBCLANG_LINK_FLAGS " -Wl,-compatibility_version -Wl,1")
-set(LIBCLANG_LINK_FLAGS "${LIBCLANG_LINK_FLAGS} -Wl,-current_version 
-Wl,${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
-
+set_target_properties(libclang
+  PROPERTIES
+  VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}
+  SOVERSION ${LIBCLANG_LIBRARY_VERSION})
 set_property(TARGET libclang APPEND_STRING PROPERTY
  LINK_FLAGS ${LIBCLANG_LINK_FLAGS})
   else()


Index: tools/libclang/CMakeLists.txt
===
--- tools/libclang/CMakeLists.txt
+++ tools/libclang/CMakeLists.txt
@@ -115,9 +115,10 @@
   VERSION ${LIBCLANG_LIBRARY_VERSION}
   DEFINE_SYMBOL _CINDEX_LIB_)
   elseif(APPLE)
-set(LIBCLANG_LINK_FLAGS " -Wl,-compatibility_version -Wl,1")
-set(LIBCLANG_LINK_FLAGS "${LIBCLANG_LINK_FLAGS} -Wl,-current_version -Wl,${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
-
+set_target_properties(libclang
+  PROPERTIES
+  VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}
+  SOVERSION ${LIBCLANG_LIBRARY_VERSION})
 set_property(TARGET libclang APPEND_STRING PROPERTY
  LINK_FLAGS ${LIBCLANG_LINK_FLAGS})
   else()
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66393: Set version for libclang

2019-08-18 Thread Isuru Fernando via Phabricator via cfe-commits
isuruf updated this revision to Diff 215782.

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

https://reviews.llvm.org/D66393

Files:
  tools/libclang/CMakeLists.txt


Index: tools/libclang/CMakeLists.txt
===
--- tools/libclang/CMakeLists.txt
+++ tools/libclang/CMakeLists.txt
@@ -115,9 +115,10 @@
   VERSION ${LIBCLANG_LIBRARY_VERSION}
   DEFINE_SYMBOL _CINDEX_LIB_)
   elseif(APPLE)
-set(LIBCLANG_LINK_FLAGS " -Wl,-compatibility_version -Wl,1")
-set(LIBCLANG_LINK_FLAGS "${LIBCLANG_LINK_FLAGS} -Wl,-current_version 
-Wl,${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
-
+set_target_properties(libclang
+  PROPERTIES
+  VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}
+  SOVERSION ${LIBCLANG_LIBRARY_VERSION})
 set_property(TARGET libclang APPEND_STRING PROPERTY
  LINK_FLAGS ${LIBCLANG_LINK_FLAGS})
   else()


Index: tools/libclang/CMakeLists.txt
===
--- tools/libclang/CMakeLists.txt
+++ tools/libclang/CMakeLists.txt
@@ -115,9 +115,10 @@
   VERSION ${LIBCLANG_LIBRARY_VERSION}
   DEFINE_SYMBOL _CINDEX_LIB_)
   elseif(APPLE)
-set(LIBCLANG_LINK_FLAGS " -Wl,-compatibility_version -Wl,1")
-set(LIBCLANG_LINK_FLAGS "${LIBCLANG_LINK_FLAGS} -Wl,-current_version -Wl,${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
-
+set_target_properties(libclang
+  PROPERTIES
+  VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}
+  SOVERSION ${LIBCLANG_LIBRARY_VERSION})
 set_property(TARGET libclang APPEND_STRING PROPERTY
  LINK_FLAGS ${LIBCLANG_LINK_FLAGS})
   else()
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66384: [clang-format] Fix a bug that joins template closer and =

2019-08-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment.

In D66384#1634405 , @Quuxplusone wrote:

> although I would still question whether 
> `Style.SpaceBeforeAssignmentOperators` is providing anyone any benefit at all.


See here  
for the patch. I don't know why the option was added but think it's probably 
outdated and should be deprecated.


Repository:
  rC Clang

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

https://reviews.llvm.org/D66384



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


[PATCH] D66394: clang-cl: Enable /Zc:twoPhase by default if targeting MSVC 2017 update 3 or newer

2019-08-18 Thread Nico Weber via Phabricator via cfe-commits
thakis created this revision.
thakis added a reviewer: hans.

MSVC 2017 update 3 (_MSC_VER 1911) enables /Zc:twoPhase by default, and
so should clang-cl:
https://docs.microsoft.com/en-us/cpp/build/reference/zc-twophase

clang-cl takes the MSVC version it emulates from the -fmsc-version flag,
or if that's not passed it tries to check what the installed version of
MSVC is and uses that, and failing that it uses a default version that's
currently 1911. So this changes the default if no -fmsc-version flag is
passed and no installed MSVC is detected. (It also changes the default
if -fmsc-version is passed or MSVC is detected, and either indicates
_MSC_VER >= 1911.)

As mentioned in the MSDN article, the Windows SDK header files in
version 10.0.15063.0 (Creators Update or Redstone 2) and earlier
versions do not work correctly with /Zc:twoPhase. If you need to use
these old SDKs with a new clang-cl, explicitly pass /Zc:twoPhase- to get
the old behavior.

Fixes PR43032.


https://reviews.llvm.org/D66394

Files:
  clang/include/clang/Driver/CLCompatOptions.td
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/cl-options.c


Index: clang/test/Driver/cl-options.c
===
--- clang/test/Driver/cl-options.c
+++ clang/test/Driver/cl-options.c
@@ -316,13 +316,19 @@
 
 // We recognize -f[no-]delayed-template-parsing.
 // /Zc:twoPhase[-] has the opposite meaning.
-// RUN: %clang_cl -c -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDDEFAULT 
%s
-// DELAYEDDEFAULT: "-fdelayed-template-parsing"
-// RUN: %clang_cl -c -fdelayed-template-parsing -### -- %s 2>&1 | FileCheck 
-check-prefix=DELAYEDON %s
-// RUN: %clang_cl -c /Zc:twoPhase- -### -- %s 2>&1 | FileCheck 
-check-prefix=DELAYEDON %s
+// RUN: %clang_cl -c -fmsc-version=1910 -### -- %s 2>&1 | FileCheck 
-check-prefix=OLDDELAYEDDEFAULT %s
+// OLDDELAYEDDEFAULT: "-fdelayed-template-parsing"
+// RUN: %clang_cl -fmsc-version=1911 -c -### -- %s 2>&1 | FileCheck 
-check-prefix=NEWDELAYEDDEFAULT %s
+// NEWDELAYEDDEFAULT-NOT: "-fdelayed-template-parsing"
+// RUN: %clang_cl -c -fmsc-version=1910 -fdelayed-template-parsing -### -- %s 
2>&1 | FileCheck -check-prefix=DELAYEDON %s
+// RUN: %clang_cl -c -fmsc-version=1911 -fdelayed-template-parsing -### -- %s 
2>&1 | FileCheck -check-prefix=DELAYEDON %s
+// RUN: %clang_cl -c -fmsc-version=1910 /Zc:twoPhase- -### -- %s 2>&1 | 
FileCheck -check-prefix=DELAYEDON %s
+// RUN: %clang_cl -c -fmsc-version=1911 /Zc:twoPhase- -### -- %s 2>&1 | 
FileCheck -check-prefix=DELAYEDON %s
 // DELAYEDON: "-fdelayed-template-parsing"
-// RUN: %clang_cl -c -fno-delayed-template-parsing -### -- %s 2>&1 | FileCheck 
-check-prefix=DELAYEDOFF %s
-// RUN: %clang_cl -c /Zc:twoPhase -### -- %s 2>&1 | FileCheck 
-check-prefix=DELAYEDOFF %s
+// RUN: %clang_cl -c -fmsc-version=1910 -fno-delayed-template-parsing -### -- 
%s 2>&1 | FileCheck -check-prefix=DELAYEDOFF %s
+// RUN: %clang_cl -c -fmsc-version=1911 -fno-delayed-template-parsing -### -- 
%s 2>&1 | FileCheck -check-prefix=DELAYEDOFF %s
+// RUN: %clang_cl -c -fmsc-version=1910 /Zc:twoPhase -### -- %s 2>&1 | 
FileCheck -check-prefix=DELAYEDOFF %s
+// RUN: %clang_cl -c -fmsc-version=1911 /Zc:twoPhase -### -- %s 2>&1 | 
FileCheck -check-prefix=DELAYEDOFF %s
 // DELAYEDOFF-NOT: "-fdelayed-template-parsing"
 
 // RUN: %clang_cl -c -### /std:c++latest -- %s 2>&1 | FileCheck -check-prefix 
CHECK-LATEST-CHAR8_T %s
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4883,12 +4883,14 @@
 !IsWindowsMSVC || IsMSVC2015Compatible))
 CmdArgs.push_back("-fno-threadsafe-statics");
 
-  // -fno-delayed-template-parsing is default, except when targeting MSVC.
-  // Many old Windows SDK versions require this to parse.
-  // FIXME: MSVC introduced /Zc:twoPhase- to disable this behavior in their
-  // compiler. We should be able to disable this by default at some point.
+  // -fno-delayed-template-parsing is default, except when targeting MSVC
+  // earlier than MSVC 2017 15.3 (_MSC_VER 1911).  Windows SDK versions
+  // 10.0.15063.0 (Creators Update or Redstone 2) and earlier require this to
+  // parse.
+  bool IsMSVCBefore2017Update3 = !MSVT.empty() && MSVT < VersionTuple(19, 11);
   if (Args.hasFlag(options::OPT_fdelayed_template_parsing,
-   options::OPT_fno_delayed_template_parsing, IsWindowsMSVC))
+   options::OPT_fno_delayed_template_parsing,
+   IsMSVCBefore2017Update3))
 CmdArgs.push_back("-fdelayed-template-parsing");
 
   // -fgnu-keywords default varies depending on language; only pass if
Index: clang/include/clang/Driver/CLCompatOptions.td
===
--- clang/include/clang/Driver/CLCompatOptions.td
+++ clang/include/clang/Driver/CLCompatOptions.td
@@ -235,10 +235,10 @@
 de

[PATCH] D65182: [analyzer] Add fix-it hint support.

2019-08-18 Thread Aleksei Sidorin via Phabricator via cfe-commits
a_sidorin added a comment.

Hi Artem!
The patch looks very promising for CSA, thanks for working on this!




Comment at: 
clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:343
+  /// to produce a good fix-it hint for most path-sensitive warnings.
+  void addFixItHint(FixItHint F) {
+Fixits.push_back(F);

As I see, FixItHint is a pretty expensive class to copy. Should we consider 
const ref/move?



Comment at: clang/lib/StaticAnalyzer/Core/BugReporter.cpp:3100
+R->addRange(SR);
+  for (auto FH : Fixits)
+R->addFixItHint(FH);

const auto&/auto&&?



Comment at: clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:741
+  o << "  \n";
+  for (auto Hint : D->getFixits()) {
+assert(!Hint.isNull());

const auto&?


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

https://reviews.llvm.org/D65182



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


[PATCH] D66384: [clang-format] Fix a bug that joins template closer and =

2019-08-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked an inline comment as done.
owenpan added inline comments.



Comment at: clang/unittests/Format/FormatTest.cpp:6631
+  verifyFormat("a = 1;", Style);
+  verifyFormat("a >>= 1;", Style);
 

Quuxplusone wrote:
> Actually, could you add a test case specifically for the troublesome 
> `enable_if_t` pattern? Just in case any future option treats 
> default-template-arguments any differently from assignment-statements, 
> whitespace-wise.
> 
> verifyformat("template = 0>");
> 
I think it duplicates `a = 1;` on Line 6630 because they both test the 
insertion of a space between a template closer `>` and an assignment operator 
`=` that follows.


Repository:
  rC Clang

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

https://reviews.llvm.org/D66384



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


r369214 - [clang-format] Fix a bug that joins template closer and =

2019-08-18 Thread Owen Pan via cfe-commits
Author: owenpan
Date: Sun Aug 18 11:51:39 2019
New Revision: 369214

URL: http://llvm.org/viewvc/llvm-project?rev=369214&view=rev
Log:
[clang-format] Fix a bug that joins template closer and =

Also fixes the documentation for SpaceBeforeAssignmentOperators.

See discussions at https://reviews.llvm.org/D66332

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

Modified:
cfe/trunk/docs/ClangFormatStyleOptions.rst
cfe/trunk/include/clang/Format/Format.h
cfe/trunk/lib/Format/TokenAnnotator.cpp
cfe/trunk/unittests/Format/FormatTest.cpp

Modified: cfe/trunk/docs/ClangFormatStyleOptions.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangFormatStyleOptions.rst?rev=369214&r1=369213&r2=369214&view=diff
==
--- cfe/trunk/docs/ClangFormatStyleOptions.rst (original)
+++ cfe/trunk/docs/ClangFormatStyleOptions.rst Sun Aug 18 11:51:39 2019
@@ -2050,8 +2050,8 @@ the configuration (without a prefix: ``A
   .. code-block:: c++
 
  true:  false:
- int a = 5; vs. int a=5;
- a += 42a+=42;
+ int a = 5; vs. int a= 5;
+ a += 42;   a+= 42;
 
 **SpaceBeforeCpp11BracedList** (``bool``)
   If ``true``, a space will be inserted before a C++11 braced list

Modified: cfe/trunk/include/clang/Format/Format.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=369214&r1=369213&r2=369214&view=diff
==
--- cfe/trunk/include/clang/Format/Format.h (original)
+++ cfe/trunk/include/clang/Format/Format.h Sun Aug 18 11:51:39 2019
@@ -1738,8 +1738,8 @@ struct FormatStyle {
   /// If ``false``, spaces will be removed before assignment operators.
   /// \code
   ///true:  false:
-  ///int a = 5; vs. int a=5;
-  ///a += 42a+=42;
+  ///int a = 5; vs. int a= 5;
+  ///a += 42;   a+= 42;
   /// \endcode
   bool SpaceBeforeAssignmentOperators;
 

Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=369214&r1=369213&r2=369214&view=diff
==
--- cfe/trunk/lib/Format/TokenAnnotator.cpp (original)
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp Sun Aug 18 11:51:39 2019
@@ -2870,7 +2870,7 @@ bool TokenAnnotator::spaceRequiredBefore
   Left.isOneOf(tok::arrow, tok::period, tok::arrowstar, tok::periodstar) ||
   (Right.is(tok::period) && Right.isNot(TT_DesignatedInitializerPeriod)))
 return false;
-  if (!Style.SpaceBeforeAssignmentOperators &&
+  if (!Style.SpaceBeforeAssignmentOperators && Left.isNot(TT_TemplateCloser) &&
   Right.getPrecedence() == prec::Assignment)
 return false;
   if (Style.Language == FormatStyle::LK_Java && Right.is(tok::coloncolon) &&

Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=369214&r1=369213&r2=369214&view=diff
==
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Sun Aug 18 11:51:39 2019
@@ -6620,8 +6620,15 @@ TEST_F(FormatTest, UnderstandsTemplatePa
 
   verifyFormat("A> a;", getChromiumStyle(FormatStyle::LK_Cpp));
 
-  verifyFormat("int i = a<1> >> 1;");
+  // template closer followed by a token that starts with > or =
   verifyFormat("bool b = a<1> > 1;");
+  verifyFormat("bool b = a<1> >= 1;");
+  verifyFormat("int i = a<1> >> 1;");
+  FormatStyle Style = getLLVMStyle();
+  Style.SpaceBeforeAssignmentOperators = false;
+  verifyFormat("bool b= a<1> == 1;", Style);
+  verifyFormat("a = 1;", Style);
+  verifyFormat("a >>= 1;", Style);
 
   verifyFormat("test >> a >> b;");
   verifyFormat("test << a >> b;");


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


[PATCH] D66384: [clang-format] Fix a bug that joins template closer and =

2019-08-18 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL369214: [clang-format] Fix a bug that joins template closer 
and = (authored by owenpan, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66384?vs=215763&id=215788#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66384

Files:
  cfe/trunk/docs/ClangFormatStyleOptions.rst
  cfe/trunk/include/clang/Format/Format.h
  cfe/trunk/lib/Format/TokenAnnotator.cpp
  cfe/trunk/unittests/Format/FormatTest.cpp


Index: cfe/trunk/lib/Format/TokenAnnotator.cpp
===
--- cfe/trunk/lib/Format/TokenAnnotator.cpp
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp
@@ -2870,7 +2870,7 @@
   Left.isOneOf(tok::arrow, tok::period, tok::arrowstar, tok::periodstar) ||
   (Right.is(tok::period) && Right.isNot(TT_DesignatedInitializerPeriod)))
 return false;
-  if (!Style.SpaceBeforeAssignmentOperators &&
+  if (!Style.SpaceBeforeAssignmentOperators && Left.isNot(TT_TemplateCloser) &&
   Right.getPrecedence() == prec::Assignment)
 return false;
   if (Style.Language == FormatStyle::LK_Java && Right.is(tok::coloncolon) &&
Index: cfe/trunk/unittests/Format/FormatTest.cpp
===
--- cfe/trunk/unittests/Format/FormatTest.cpp
+++ cfe/trunk/unittests/Format/FormatTest.cpp
@@ -6620,8 +6620,15 @@
 
   verifyFormat("A> a;", getChromiumStyle(FormatStyle::LK_Cpp));
 
-  verifyFormat("int i = a<1> >> 1;");
+  // template closer followed by a token that starts with > or =
   verifyFormat("bool b = a<1> > 1;");
+  verifyFormat("bool b = a<1> >= 1;");
+  verifyFormat("int i = a<1> >> 1;");
+  FormatStyle Style = getLLVMStyle();
+  Style.SpaceBeforeAssignmentOperators = false;
+  verifyFormat("bool b= a<1> == 1;", Style);
+  verifyFormat("a = 1;", Style);
+  verifyFormat("a >>= 1;", Style);
 
   verifyFormat("test >> a >> b;");
   verifyFormat("test << a >> b;");
Index: cfe/trunk/docs/ClangFormatStyleOptions.rst
===
--- cfe/trunk/docs/ClangFormatStyleOptions.rst
+++ cfe/trunk/docs/ClangFormatStyleOptions.rst
@@ -2050,8 +2050,8 @@
   .. code-block:: c++
 
  true:  false:
- int a = 5; vs. int a=5;
- a += 42a+=42;
+ int a = 5; vs. int a= 5;
+ a += 42;   a+= 42;
 
 **SpaceBeforeCpp11BracedList** (``bool``)
   If ``true``, a space will be inserted before a C++11 braced list
Index: cfe/trunk/include/clang/Format/Format.h
===
--- cfe/trunk/include/clang/Format/Format.h
+++ cfe/trunk/include/clang/Format/Format.h
@@ -1738,8 +1738,8 @@
   /// If ``false``, spaces will be removed before assignment operators.
   /// \code
   ///true:  false:
-  ///int a = 5; vs. int a=5;
-  ///a += 42a+=42;
+  ///int a = 5; vs. int a= 5;
+  ///a += 42;   a+= 42;
   /// \endcode
   bool SpaceBeforeAssignmentOperators;
 


Index: cfe/trunk/lib/Format/TokenAnnotator.cpp
===
--- cfe/trunk/lib/Format/TokenAnnotator.cpp
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp
@@ -2870,7 +2870,7 @@
   Left.isOneOf(tok::arrow, tok::period, tok::arrowstar, tok::periodstar) ||
   (Right.is(tok::period) && Right.isNot(TT_DesignatedInitializerPeriod)))
 return false;
-  if (!Style.SpaceBeforeAssignmentOperators &&
+  if (!Style.SpaceBeforeAssignmentOperators && Left.isNot(TT_TemplateCloser) &&
   Right.getPrecedence() == prec::Assignment)
 return false;
   if (Style.Language == FormatStyle::LK_Java && Right.is(tok::coloncolon) &&
Index: cfe/trunk/unittests/Format/FormatTest.cpp
===
--- cfe/trunk/unittests/Format/FormatTest.cpp
+++ cfe/trunk/unittests/Format/FormatTest.cpp
@@ -6620,8 +6620,15 @@
 
   verifyFormat("A> a;", getChromiumStyle(FormatStyle::LK_Cpp));
 
-  verifyFormat("int i = a<1> >> 1;");
+  // template closer followed by a token that starts with > or =
   verifyFormat("bool b = a<1> > 1;");
+  verifyFormat("bool b = a<1> >= 1;");
+  verifyFormat("int i = a<1> >> 1;");
+  FormatStyle Style = getLLVMStyle();
+  Style.SpaceBeforeAssignmentOperators = false;
+  verifyFormat("bool b= a<1> == 1;", Style);
+  verifyFormat("a = 1;", Style);
+  verifyFormat("a >>= 1;", Style);
 
   verifyFormat("test >> a >> b;");
   verifyFormat("test << a >> b;");
Index: cfe/trunk/docs/ClangFormatStyleOptions.rst

r369217 - [Diagnostics] Diagnose misused xor as pow

2019-08-18 Thread David Bolvansky via cfe-commits
Author: xbolva00
Date: Sun Aug 18 12:14:14 2019
New Revision: 369217

URL: http://llvm.org/viewvc/llvm-project?rev=369217&view=rev
Log:
[Diagnostics] Diagnose misused xor as pow

Summary:
Motivation:
https://twitter.com/jfbastien/status/1139298419988549632
https://twitter.com/mikemx7f/status/1139335901790625793
https://codesearch.isocpp.org/cgi-bin/cgi_ppsearch?q=10+%5E&search=Search

Reviewers: jfb, rsmith, regehr, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: lebedev.ri, Quuxplusone, erik.pilkington, riccibruno, dexonsmith, 
cfe-commits

Tags: #clang

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

Added:
cfe/trunk/test/SemaCXX/warn-xor-as-pow.cpp
Modified:
cfe/trunk/include/clang/Basic/DiagnosticGroups.td
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=369217&r1=369216&r2=369217&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Sun Aug 18 12:14:14 2019
@@ -512,6 +512,7 @@ def CompareDistinctPointerType : DiagGro
 def GNUUnionCast : DiagGroup<"gnu-union-cast">;
 def GNUVariableSizedTypeNotAtEnd : 
DiagGroup<"gnu-variable-sized-type-not-at-end">;
 def Varargs : DiagGroup<"varargs">;
+def XorUsedAsPow : DiagGroup<"xor-used-as-pow">;
 
 def Unsequenced : DiagGroup<"unsequenced">;
 // GCC name for -Wunsequenced

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=369217&r1=369216&r2=369217&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sun Aug 18 12:14:14 
2019
@@ -3326,6 +3326,15 @@ def warn_address_of_reference_bool_conve
   "code; pointer may be assumed to always convert to true">,
   InGroup;
 
+def warn_xor_used_as_pow_base_extra : Warning<
+  "result of '%0' is %1; did you mean '%2' (%3)?">,
+  InGroup;
+def warn_xor_used_as_pow_base : Warning<
+  "result of '%0' is %1; did you mean '%2'?">,
+  InGroup;
+def note_xor_used_as_pow_silence : Note<
+  "replace expression with '%0' to silence this warning">;
+
 def warn_null_pointer_compare : Warning<
 "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
 "equal to a null pointer is always %select{true|false}2">,

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=369217&r1=369216&r2=369217&view=diff
==
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Sun Aug 18 12:14:14 2019
@@ -11011,6 +11011,107 @@ QualType Sema::CheckVectorCompareOperand
   return GetSignedVectorType(vType);
 }
 
+static void diagnoseXorMisusedAsPow(Sema &S, ExprResult &LHS, ExprResult &RHS,
+SourceLocation Loc) {
+  // Do not diagnose macros.
+  if (Loc.isMacroID())
+return;
+
+  bool Negative = false;
+  const auto *LHSInt = dyn_cast(LHS.get());
+  const auto *RHSInt = dyn_cast(RHS.get());
+
+  if (!LHSInt)
+return;
+  if (!RHSInt) {
+// Check negative literals.
+if (const auto *UO = dyn_cast(RHS.get())) {
+  if (UO->getOpcode() != UO_Minus)
+return;
+  RHSInt = dyn_cast(UO->getSubExpr());
+  if (!RHSInt)
+return;
+  Negative = true;
+} else {
+  return;
+}
+  }
+
+  if (LHSInt->getValue().getBitWidth() != RHSInt->getValue().getBitWidth())
+return;
+
+  CharSourceRange ExprRange = CharSourceRange::getCharRange(
+  LHSInt->getBeginLoc(), S.getLocForEndOfToken(RHSInt->getLocation()));
+  llvm::StringRef ExprStr =
+  Lexer::getSourceText(ExprRange, S.getSourceManager(), S.getLangOpts());
+
+  CharSourceRange XorRange =
+  CharSourceRange::getCharRange(Loc, S.getLocForEndOfToken(Loc));
+  llvm::StringRef XorStr =
+  Lexer::getSourceText(XorRange, S.getSourceManager(), S.getLangOpts());
+  // Do not diagnose if xor keyword/macro is used.
+  if (XorStr == "xor")
+return;
+
+  const llvm::APInt &LeftSideValue = LHSInt->getValue();
+  const llvm::APInt &RightSideValue = RHSInt->getValue();
+  const llvm::APInt XorValue = LeftSideValue ^ RightSideValue;
+
+  std::string LHSStr = Lexer::getSourceText(
+  CharSourceRange::getTokenRange(LHSInt->getSourceRange()),
+  S.getSourceManager(), S.getLangOpts());
+  std::string RHSStr = Lexer::getSourceText(
+  CharSourceRange::getTokenRange(RHSInt->getSourceRange()),
+  S.getSourceManager(), S.getLangOpts());
+
+  int64_t RightSideIntValue = RightSideValue.getSExtVal

[PATCH] D63423: [Diagnostics] Diagnose misused xor as pow

2019-08-18 Thread Dávid Bolvanský via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL369217: [Diagnostics] Diagnose misused xor as pow (authored 
by xbolva00, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D63423?vs=215693&id=215790#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D63423

Files:
  cfe/trunk/include/clang/Basic/DiagnosticGroups.td
  cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
  cfe/trunk/lib/Sema/SemaExpr.cpp
  cfe/trunk/test/SemaCXX/warn-xor-as-pow.cpp

Index: cfe/trunk/lib/Sema/SemaExpr.cpp
===
--- cfe/trunk/lib/Sema/SemaExpr.cpp
+++ cfe/trunk/lib/Sema/SemaExpr.cpp
@@ -11011,6 +11011,107 @@
   return GetSignedVectorType(vType);
 }
 
+static void diagnoseXorMisusedAsPow(Sema &S, ExprResult &LHS, ExprResult &RHS,
+SourceLocation Loc) {
+  // Do not diagnose macros.
+  if (Loc.isMacroID())
+return;
+
+  bool Negative = false;
+  const auto *LHSInt = dyn_cast(LHS.get());
+  const auto *RHSInt = dyn_cast(RHS.get());
+
+  if (!LHSInt)
+return;
+  if (!RHSInt) {
+// Check negative literals.
+if (const auto *UO = dyn_cast(RHS.get())) {
+  if (UO->getOpcode() != UO_Minus)
+return;
+  RHSInt = dyn_cast(UO->getSubExpr());
+  if (!RHSInt)
+return;
+  Negative = true;
+} else {
+  return;
+}
+  }
+
+  if (LHSInt->getValue().getBitWidth() != RHSInt->getValue().getBitWidth())
+return;
+
+  CharSourceRange ExprRange = CharSourceRange::getCharRange(
+  LHSInt->getBeginLoc(), S.getLocForEndOfToken(RHSInt->getLocation()));
+  llvm::StringRef ExprStr =
+  Lexer::getSourceText(ExprRange, S.getSourceManager(), S.getLangOpts());
+
+  CharSourceRange XorRange =
+  CharSourceRange::getCharRange(Loc, S.getLocForEndOfToken(Loc));
+  llvm::StringRef XorStr =
+  Lexer::getSourceText(XorRange, S.getSourceManager(), S.getLangOpts());
+  // Do not diagnose if xor keyword/macro is used.
+  if (XorStr == "xor")
+return;
+
+  const llvm::APInt &LeftSideValue = LHSInt->getValue();
+  const llvm::APInt &RightSideValue = RHSInt->getValue();
+  const llvm::APInt XorValue = LeftSideValue ^ RightSideValue;
+
+  std::string LHSStr = Lexer::getSourceText(
+  CharSourceRange::getTokenRange(LHSInt->getSourceRange()),
+  S.getSourceManager(), S.getLangOpts());
+  std::string RHSStr = Lexer::getSourceText(
+  CharSourceRange::getTokenRange(RHSInt->getSourceRange()),
+  S.getSourceManager(), S.getLangOpts());
+
+  int64_t RightSideIntValue = RightSideValue.getSExtValue();
+  if (Negative) {
+RightSideIntValue = -RightSideIntValue;
+RHSStr = "-" + RHSStr;
+  }
+
+  StringRef LHSStrRef = LHSStr;
+  StringRef RHSStrRef = RHSStr;
+  // Do not diagnose binary, hexadecimal, octal literals.
+  if (LHSStrRef.startswith("0b") || LHSStrRef.startswith("0B") ||
+  RHSStrRef.startswith("0b") || RHSStrRef.startswith("0B") ||
+  LHSStrRef.startswith("0x") || LHSStrRef.startswith("0X") ||
+  RHSStrRef.startswith("0x") || RHSStrRef.startswith("0X") ||
+  (LHSStrRef.size() > 1 && LHSStrRef.startswith("0")) ||
+  (RHSStrRef.size() > 1 && RHSStrRef.startswith("0")))
+return;
+
+  if (LeftSideValue == 2 && RightSideIntValue >= 0) {
+std::string SuggestedExpr = "1 << " + RHSStr;
+bool Overflow = false;
+llvm::APInt One = (LeftSideValue - 1);
+llvm::APInt PowValue = One.sshl_ov(RightSideValue, Overflow);
+if (Overflow) {
+  if (RightSideIntValue < 64)
+S.Diag(Loc, diag::warn_xor_used_as_pow_base)
+<< ExprStr << XorValue.toString(10, true) << ("1LL << " + RHSStr)
+<< FixItHint::CreateReplacement(ExprRange, "1LL << " + RHSStr);
+  else
+ // TODO: 2 ^ 64 - 1
+return;
+} else {
+  S.Diag(Loc, diag::warn_xor_used_as_pow_base_extra)
+  << ExprStr << XorValue.toString(10, true) << SuggestedExpr
+  << PowValue.toString(10, true)
+  << FixItHint::CreateReplacement(
+ ExprRange, (RightSideIntValue == 0) ? "1" : SuggestedExpr);
+}
+
+S.Diag(Loc, diag::note_xor_used_as_pow_silence) << ("0x2 ^ " + RHSStr);
+  } else if (LeftSideValue == 10) {
+std::string SuggestedValue = "1e" + std::to_string(RightSideIntValue);
+S.Diag(Loc, diag::warn_xor_used_as_pow_base)
+<< ExprStr << XorValue.toString(10, true) << SuggestedValue
+<< FixItHint::CreateReplacement(ExprRange, SuggestedValue);
+S.Diag(Loc, diag::note_xor_used_as_pow_silence) << ("0xA ^ " + RHSStr);
+  }
+}
+
 QualType Sema::CheckVectorLogicalOperands(ExprResult &LHS, ExprResult &RHS,
   SourceLocation Loc) {
   // Ensure that either both operands are of the same vector type, or
@@ -11054,6 +11155,9 @@
   if (Opc == BO_A

[PATCH] D66397: [Diagnostics] Improve -Wxor-used-as-pow

2019-08-18 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 created this revision.
xbolva00 added a reviewer: aaron.ballman.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Handle specific case

(2 ^ 64) - 1


Repository:
  rC Clang

https://reviews.llvm.org/D66397

Files:
  lib/Sema/SemaExpr.cpp
  test/SemaCXX/warn-xor-as-pow.cpp

Index: test/SemaCXX/warn-xor-as-pow.cpp
===
--- test/SemaCXX/warn-xor-as-pow.cpp
+++ test/SemaCXX/warn-xor-as-pow.cpp
@@ -70,7 +70,20 @@
   res = 2 ^ 32; // expected-warning {{result of '2 ^ 32' is 34; did you mean '1LL << 32'?}}
   // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:15}:"1LL << 32"
   // expected-note@-2 {{replace expression with '0x2 ^ 32' to silence this warning}}
-  res = 2 ^ 64;
+  res = (2 ^ 64) - 1; // expected-warning {{result of '2 ^ 64' is 66; did you mean '-1LL'?}}
+  // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:21}:"-1LL"
+  // expected-note@-2 {{replace expression with '0x2 ^ 64' to silence this warning}}
+#define ULLONG_MAX 18446744073709551615ULL
+  res = (2 ^ 64) - 1; // expected-warning {{result of '2 ^ 64' is 66; did you mean 'ULLONG_MAX'?}}
+  // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:21}:"ULLONG_MAX"
+  // expected-note@-2 {{replace expression with '0x2 ^ 64' to silence this warning}}
+  res = (2 ^ 64) - 2;
+  res = (2 ^ 65) - 1;
+  res = (2 + 64) - 1;
+  res = (3 ^ 64) - 1;
+  res = (2 ^ 8) - 1; // expected-warning {{result of '2 ^ 8' is 10; did you mean '1 << 8' (256)?}}
+  // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:15}:"1 << 8"
+  // expected-note@-2 {{replace expression with '0x2 ^ 8' to silence this warning}}
 
   res = EPSILON;
   res = 10 ^ 0; // expected-warning {{result of '10 ^ 0' is 10; did you mean '1e0'?}}
Index: lib/Sema/SemaExpr.cpp
===
--- lib/Sema/SemaExpr.cpp
+++ lib/Sema/SemaExpr.cpp
@@ -9422,6 +9422,129 @@
 << RHSExpr->getSourceRange();
 }
 
+static void diagnoseXorMisusedAsPow(Sema &S, const ExprResult &LHS,
+const ExprResult &RHS,
+const SourceLocation Loc,
+const Expr *SubLHS = nullptr,
+const Expr *SubRHS = nullptr) {
+  // Do not diagnose macros.
+  if (Loc.isMacroID())
+return;
+
+  bool Negative = false;
+  const auto *LHSInt = dyn_cast(LHS.get());
+  const auto *RHSInt = dyn_cast(RHS.get());
+
+  if (!LHSInt)
+return;
+  if (!RHSInt) {
+// Check negative literals.
+if (const auto *UO = dyn_cast(RHS.get())) {
+  if (UO->getOpcode() != UO_Minus)
+return;
+  RHSInt = dyn_cast(UO->getSubExpr());
+  if (!RHSInt)
+return;
+  Negative = true;
+} else {
+  return;
+}
+  }
+
+  if (LHSInt->getValue().getBitWidth() != RHSInt->getValue().getBitWidth())
+return;
+
+  CharSourceRange ExprRange = CharSourceRange::getCharRange(
+  LHSInt->getBeginLoc(), S.getLocForEndOfToken(RHSInt->getLocation()));
+  llvm::StringRef ExprStr =
+  Lexer::getSourceText(ExprRange, S.getSourceManager(), S.getLangOpts());
+
+  CharSourceRange XorRange =
+  CharSourceRange::getCharRange(Loc, S.getLocForEndOfToken(Loc));
+  llvm::StringRef XorStr =
+  Lexer::getSourceText(XorRange, S.getSourceManager(), S.getLangOpts());
+  // Do not diagnose if xor keyword/macro is used.
+  if (XorStr == "xor")
+return;
+
+  const llvm::APInt &LeftSideValue = LHSInt->getValue();
+  const llvm::APInt &RightSideValue = RHSInt->getValue();
+  const llvm::APInt XorValue = LeftSideValue ^ RightSideValue;
+
+  std::string LHSStr = Lexer::getSourceText(
+  CharSourceRange::getTokenRange(LHSInt->getSourceRange()),
+  S.getSourceManager(), S.getLangOpts());
+  std::string RHSStr = Lexer::getSourceText(
+  CharSourceRange::getTokenRange(RHSInt->getSourceRange()),
+  S.getSourceManager(), S.getLangOpts());
+
+  int64_t RightSideIntValue = RightSideValue.getSExtValue();
+  if (Negative) {
+RightSideIntValue = -RightSideIntValue;
+RHSStr = "-" + RHSStr;
+  }
+
+  StringRef LHSStrRef = LHSStr;
+  StringRef RHSStrRef = RHSStr;
+  // Do not diagnose binary, hexadecimal, octal literals.
+  if (LHSStrRef.startswith("0b") || LHSStrRef.startswith("0B") ||
+  RHSStrRef.startswith("0b") || RHSStrRef.startswith("0B") ||
+  LHSStrRef.startswith("0x") || LHSStrRef.startswith("0X") ||
+  RHSStrRef.startswith("0x") || RHSStrRef.startswith("0X") ||
+  (LHSStrRef.size() > 1 && LHSStrRef.startswith("0")) ||
+  (RHSStrRef.size() > 1 && RHSStrRef.startswith("0")))
+return;
+
+  if (SubLHS && SubRHS && (LeftSideValue != 2 || RightSideIntValue != 64))
+return;
+
+  if (LeftSideValue == 2 && RightSideIntValue >= 0) {
+std::string SuggestedExpr = "1 << " + RHSStr;
+bool Overflow = false;
+llvm::APInt One = (LeftSideValue - 1);
+llvm::APInt PowValue = One.sshl_ov(RightSideValue, O

[PATCH] D66067: Push lambda scope earlier when transforming lambda expression

2019-08-18 Thread Nicholas Allegra via Phabricator via cfe-commits
comex marked an inline comment as done.
comex added inline comments.



Comment at: clang/test/SemaTemplate/default-arguments-cxx0x.cpp:1
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++14 -verify %s
 // expected-no-diagnostics

Mordante wrote:
> Wouldn't it be better to keep the original C++11 test and add a second `RUN:` 
> for the C++14 test?
> Then guard the new test with `#if __cplusplus >= 201402L`
Perhaps, but most tests aren't run multiple times with different -std options, 
and I didn't see any reason this test in particular needed that.  Maybe it 
should just be renamed to default-arguments-cxx14.cpp.


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

https://reviews.llvm.org/D66067



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


[PATCH] D64274: [analyzer] VirtualCallChecker overhaul.

2019-08-18 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus accepted this revision.
Szelethus added a comment.

Thank you, and sorry for dragging you through this! At the very least, we got 
to learn a lot from it :)




Comment at: clang/include/clang/StaticAnalyzer/Core/CheckerManager.h:93-96
 // This wrapper is used to ensure that only StringRefs originating from the
 // CheckerRegistry are used as check names. We want to make sure all check
 // name strings have a lifetime that keeps them alive at least until the path
 // diagnostics have been processed.

Yea, so this comment isn't incorrect, but it isn't obvious the reason behind 
this: `CheckerRegistry` gets destructed almost immediately after loading the 
checkers to `CheckerManager`, the thing we should emphasize here is that those 
checker names are actually generated as string literals with the inclusion of 
`Checkers.inc`, which is why their lifetime is long enough (practically 
infinite).



Comment at: clang/include/clang/StaticAnalyzer/Core/CheckerManager.h:97
 // diagnostics have been processed.
 class CheckName {
   friend class ::clang::ento::CheckerRegistry;

G, this has been bugging me for far too long. We should totally rename this 
to `CheckerName` eventually.



Comment at: clang/lib/StaticAnalyzer/Core/CommonBugCategories.cpp:14-20
 const char * const CoreFoundationObjectiveC = "Core Foundation/Objective-C";
 const char * const LogicError = "Logic error";
 const char * const MemoryRefCount =
   "Memory (Core Foundation/Objective-C/OSObject)";
 const char * const MemoryError = "Memory error";
 const char * const UnixAPI = "Unix API";
+const char * const CXXObjectLifecycle = "C++ object lifecycle";

`static constexpr StringLiteral`? Why is there a need to have a header and a 
cpp file for this? Not that it matters much (definitely not in the context of 
this patch), but compile-time stuff is cool.


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

https://reviews.llvm.org/D64274



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


[PATCH] D66404: [CFG] Make destructor calls more accurate

2019-08-18 Thread Nicholas Allegra via Phabricator via cfe-commits
comex created this revision.
comex added reviewers: dergachev.a, Szelethus, dcoughlin.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Note: I don't have commit access.

Various changes to reduce discrepancies in destructor calls between the
generated CFG and the actual codegen, along with a new test file.

In particular:

- Respect C++17 copy elision; previously it would generate destructor calls for 
elided temporaries, including in initialization and return statements.

- Don't generate duplicate destructor calls for statement expressions.

- Fix initialization lists.

- Fix comma operator.

- Change printing of implicit destructors to print the type instead of the 
class name directly, matching the code for temporary object destructors.  The 
class name was blank for lambdas.

Also update some existing tests which were broken by the changed formatting
and/or the fixed behavior.

Implementation notes:

- Rename BindToTemporary to ExternallyDestructed, which more accurately 
reflects what the parameter does and matches the naming in CodeGen.

- Change VisitChildrenForTemporaryDtors to take an ExternallyDestructed 
parameter, for the sake of InitListExprs, which have an arbitrary number of 
children and may or may not be externally destructed.

- Add a function VisitExternallyDestructed with the right behavior for return 
statements and statement expressions.

The new test file also includes tests for some preexisting buggy cases which
this patch does *not* fix.  What a mess...


Repository:
  rC Clang

https://reviews.llvm.org/D66404

Files:
  lib/Analysis/CFG.cpp
  test/Analysis/cfg-rich-constructors.cpp
  test/Analysis/cfg-rich-constructors.mm
  test/Analysis/cfg.cpp
  test/Analysis/missing-bind-temporary.cpp
  test/Analysis/more-dtors-cfg-output.cpp
  test/Analysis/temporaries.cpp

Index: test/Analysis/temporaries.cpp
===
--- test/Analysis/temporaries.cpp
+++ test/Analysis/temporaries.cpp
@@ -830,12 +830,7 @@
   // On each branch the variable is constructed directly.
   if (coin) {
 clang_analyzer_eval(x == 1); // expected-warning{{TRUE}}
-#if __cplusplus < 201703L
 clang_analyzer_eval(y == 1); // expected-warning{{TRUE}}
-#else
-// FIXME: Destructor called twice in C++17?
-clang_analyzer_eval(y == 2); // expected-warning{{TRUE}}
-#endif
 clang_analyzer_eval(z == 0); // expected-warning{{TRUE}}
 clang_analyzer_eval(w == 0); // expected-warning{{TRUE}}
 
@@ -843,12 +838,7 @@
 clang_analyzer_eval(x == 0); // expected-warning{{TRUE}}
 clang_analyzer_eval(y == 0); // expected-warning{{TRUE}}
 clang_analyzer_eval(z == 1); // expected-warning{{TRUE}}
-#if __cplusplus < 201703L
 clang_analyzer_eval(w == 1); // expected-warning{{TRUE}}
-#else
-// FIXME: Destructor called twice in C++17?
-clang_analyzer_eval(w == 2); // expected-warning{{TRUE}}
-#endif
   }
 }
 } // namespace test_match_constructors_and_destructors
@@ -1055,16 +1045,11 @@
 #endif
 
   bar2(S(2));
-  // FIXME: Why are we losing information in C++17?
   clang_analyzer_eval(glob == 2);
 #ifdef TEMPORARY_DTORS
-#if __cplusplus < 201703L
-  // expected-warning@-3{{TRUE}}
-#else
-  // expected-warning@-5{{UNKNOWN}}
-#endif
+  // expected-warning@-2{{TRUE}}
 #else
-  // expected-warning@-8{{UNKNOWN}}
+  // expected-warning@-4{{UNKNOWN}}
 #endif
 
   C *c = new D();
Index: test/Analysis/more-dtors-cfg-output.cpp
===
--- /dev/null
+++ test/Analysis/more-dtors-cfg-output.cpp
@@ -0,0 +1,311 @@
+// RUN: rm -f %t.14 %t.17
+// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -std=c++14 -DCXX2A=0 -fblocks -Wall -Wno-unused -Werror %s > %t.14 2>&1
+// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -std=c++2a -DCXX2A=1 -fblocks -Wall -Wno-unused -Werror %s > %t.17 2>&1
+// RUN: FileCheck --input-file=%t.14 -check-prefixes=CHECK,CXX14 -implicit-check-not=destructor %s
+// RUN: FileCheck --input-file=%t.17 -check-prefixes=CHECK,CXX2A -implicit-check-not=destructor %s
+
+int puts(const char *);
+
+struct Foo {
+  Foo() = delete;
+#if CXX2A
+  // Guarantee that the elided examples are actually elided by deleting the
+  // copy constructor.
+  Foo(const Foo &) = delete;
+#else
+  // No elision support, so we need a copy constructor.
+  Foo(const Foo &);
+#endif
+  ~Foo();
+};
+
+struct TwoFoos {
+  Foo foo1, foo2;
+  ~TwoFoos();
+};
+
+Foo get_foo();
+
+struct Bar {
+  Bar();
+  Bar(const Bar &);
+  ~Bar();
+  Bar &operator=(const Bar &);
+};
+
+Bar get_bar();
+
+struct TwoBars {
+  Bar foo1, foo2;
+  ~TwoBars();
+};
+
+// Start of tests:
+
+void elided_assign() {
+  Foo x = get_foo();
+}
+// CHECK: void elided_assign()
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: ~Foo() (Implicit destructor)
+
+void nonelided_assign() {
+  Bar x = (const Bar &)get_bar();
+}
+// CHECK: void nonelided_assign()

[PATCH] D62899: [analyzer][UninitializedObjectChecker] Mark uninitialized regions as interesting.

2019-08-18 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment.

In D62899#1551312 , @NoQ wrote:

> In D62899#1549715 , @Szelethus wrote:
>
> > Added a proper testfile. The only downside of it is that it doesn't test 
> > anything.
>
>
> Use creduce!


I would, but I'm not even sure what to look for, really.

Okay, I have a far better understanding of interestingness, so here's the deal: 
Visitors, like `ConditionBRVisitor`, will mark its diagnostics non-prunable if 
it describes an interesting entity. The problem is, for an uninitialized 
variable, everything that is worth explaining is probably unexplored by the 
analyzer, leaving only to the note "Declaring 'x' without an initial value", 
which we don't emit for C++ constructors.

That said, I'd like `ReturnVisitor` to step up and place the notes it usually 
does. Even better, I'd like to use `trackRegionValue()` to add our beloved 
selection of visitors, so its a real shame it doesn't exist :^) Since we mark 
tracked values as interesting anyways, that would be a better solution then 
this.


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

https://reviews.llvm.org/D62899



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


[PATCH] D65373: [clangd] Update features table in the docs with links to LSP extension proposals

2019-08-18 Thread Nathan Ridge via Phabricator via cfe-commits
nridge updated this revision to Diff 215815.
nridge added a comment.

Address review comments


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65373

Files:
  clang-tools-extra/docs/clangd/Features.rst

Index: clang-tools-extra/docs/clangd/Features.rst
===
--- clang-tools-extra/docs/clangd/Features.rst
+++ clang-tools-extra/docs/clangd/Features.rst
@@ -214,54 +214,58 @@
 part of the Language Server Protocol; those features might be eventually
 developed outside clangd or become clangd extensions to LSP.
 
-+-++--+
-| C/C++ Editor feature|  LSP   |  Clangd  |
-+=++==+
-| Formatting  | Yes|   Yes|
-+-++--+
-| Completion  | Yes|   Yes|
-+-++--+
-| Diagnostics | Yes|   Yes|
-+-++--+
-| Fix-its | Yes|   Yes|
-+-++--+
-| Go to Definition| Yes|   Yes|
-+-++--+
-| Signature Help  | Yes|   Yes|
-+-++--+
-| Document Highlights | Yes|   Yes|
-+-++--+
-| Rename  | Yes|   Yes|
-+-++--+
-| Source hover| Yes|   Yes|
-+-++--+
-| Find References | Yes|   Yes|
-+-++--+
-| Document Symbols| Yes|   Yes|
-+-++--+
-| Workspace Symbols   | Yes|   Yes|
-+-++--+
-| Code Lens   | Yes|   No |
-+-++--+
-| Code folding| Yes|   No |
-+-++--+
-| Extract Local Variable  | Yes|   No |
-+-++--+
-| Extract Function/Method | Yes|   No |
-+-++--+
-| Quick Assist| Yes|   No |
-+-++--+
-| Hide Method | Yes|   No |
-+-++--+
-| Implement Method| Yes|   No |
-+-++--+
-| Gen. Getters/Setters| Yes|   No |
-+-++--+
-| Syntax and Semantic Coloring| No |   No |
-+-++--+
-| Call hierarchy  | No |   No |
-+-++--+
-| Type hierarchy  | No |   Yes|
-+-++--+
-| Organize Includes   | No |   No |
-+-++--+
++-+-+--+
+| C/C++ Editor feature|  LSP|  Clangd  |
++=+=+==+
+| Formatting  | Yes |   Yes|
++-+-+--+
+| Completion  | Yes |   Yes|
++-+-+--+
+| Diagnostics | Yes |   Yes|
++-+-+--+
+| Fix-its | Yes |   Yes|
++-+-+--+
+| Go to Definition| Yes |   Yes|
++-+-+--+
+| Signature Help  | Yes |   Yes|
++-+-+--+
+| Document Highlights 

[PATCH] D65373: [clangd] Update features table in the docs with links to LSP extension proposals

2019-08-18 Thread Nathan Ridge via Phabricator via cfe-commits
nridge marked 2 inline comments as done.
nridge added inline comments.



Comment at: clang-tools-extra/docs/clangd/Features.rst:260
 +-++--+
-| Syntax and Semantic Coloring| No |   No |
+| Syntax and Semantic Coloring|`Proposed`__|   No |
 +-++--+

ilya-biryukov wrote:
> Could you mention that semantic coloring is implemented in clangd? (with a 
> footnote that it only works in `Theia` atm)
Updated. I didn't add a footnote, because it doesn't seem any different than 
e.g. type hierarchy which I think is also only supported by Theia at the moment 
-- clangd implements the extension as proposed, and it will work with any 
client that does as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65373



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


[clang-tools-extra] r369229 - [clangd] Update features table in the docs with links to LSP extension proposals

2019-08-18 Thread Nathan Ridge via cfe-commits
Author: nridge
Date: Sun Aug 18 22:11:15 2019
New Revision: 369229

URL: http://llvm.org/viewvc/llvm-project?rev=369229&view=rev
Log:
[clangd] Update features table in the docs with links to LSP extension proposals

Also update the semantic coloring entry to reflect it being supported in
clangd now.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

Modified:
clang-tools-extra/trunk/docs/clangd/Features.rst

Modified: clang-tools-extra/trunk/docs/clangd/Features.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clangd/Features.rst?rev=369229&r1=369228&r2=369229&view=diff
==
--- clang-tools-extra/trunk/docs/clangd/Features.rst (original)
+++ clang-tools-extra/trunk/docs/clangd/Features.rst Sun Aug 18 22:11:15 2019
@@ -214,54 +214,58 @@ It is not clear whether or not some of t
 part of the Language Server Protocol; those features might be eventually
 developed outside clangd or become clangd extensions to LSP.
 
-+-++--+
-| C/C++ Editor feature|  LSP   |  Clangd  |
-+=++==+
-| Formatting  | Yes|   Yes|
-+-++--+
-| Completion  | Yes|   Yes|
-+-++--+
-| Diagnostics | Yes|   Yes|
-+-++--+
-| Fix-its | Yes|   Yes|
-+-++--+
-| Go to Definition| Yes|   Yes|
-+-++--+
-| Signature Help  | Yes|   Yes|
-+-++--+
-| Document Highlights | Yes|   Yes|
-+-++--+
-| Rename  | Yes|   Yes|
-+-++--+
-| Source hover| Yes|   Yes|
-+-++--+
-| Find References | Yes|   Yes|
-+-++--+
-| Document Symbols| Yes|   Yes|
-+-++--+
-| Workspace Symbols   | Yes|   Yes|
-+-++--+
-| Code Lens   | Yes|   No |
-+-++--+
-| Code folding| Yes|   No |
-+-++--+
-| Extract Local Variable  | Yes|   No |
-+-++--+
-| Extract Function/Method | Yes|   No |
-+-++--+
-| Quick Assist| Yes|   No |
-+-++--+
-| Hide Method | Yes|   No |
-+-++--+
-| Implement Method| Yes|   No |
-+-++--+
-| Gen. Getters/Setters| Yes|   No |
-+-++--+
-| Syntax and Semantic Coloring| No |   No |
-+-++--+
-| Call hierarchy  | No |   No |
-+-++--+
-| Type hierarchy  | No |   Yes|
-+-++--+
-| Organize Includes   | No |   No |
-+-++--+
++-+-+--+
+| C/C++ Editor feature|  LSP|  Clangd  |
++=+=+==+
+| Formatting  | Yes |   Yes|
++-+-+--+
+| Completion  | Yes |   Yes|
++-+-+--+
+| Diagnostics | Yes |   Yes|
++

[PATCH] D65373: [clangd] Update features table in the docs with links to LSP extension proposals

2019-08-18 Thread Nathan Ridge via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL369229: [clangd] Update features table in the docs with 
links to LSP extension proposals (authored by nridge, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65373?vs=215815&id=215818#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65373

Files:
  clang-tools-extra/trunk/docs/clangd/Features.rst

Index: clang-tools-extra/trunk/docs/clangd/Features.rst
===
--- clang-tools-extra/trunk/docs/clangd/Features.rst
+++ clang-tools-extra/trunk/docs/clangd/Features.rst
@@ -214,54 +214,58 @@
 part of the Language Server Protocol; those features might be eventually
 developed outside clangd or become clangd extensions to LSP.
 
-+-++--+
-| C/C++ Editor feature|  LSP   |  Clangd  |
-+=++==+
-| Formatting  | Yes|   Yes|
-+-++--+
-| Completion  | Yes|   Yes|
-+-++--+
-| Diagnostics | Yes|   Yes|
-+-++--+
-| Fix-its | Yes|   Yes|
-+-++--+
-| Go to Definition| Yes|   Yes|
-+-++--+
-| Signature Help  | Yes|   Yes|
-+-++--+
-| Document Highlights | Yes|   Yes|
-+-++--+
-| Rename  | Yes|   Yes|
-+-++--+
-| Source hover| Yes|   Yes|
-+-++--+
-| Find References | Yes|   Yes|
-+-++--+
-| Document Symbols| Yes|   Yes|
-+-++--+
-| Workspace Symbols   | Yes|   Yes|
-+-++--+
-| Code Lens   | Yes|   No |
-+-++--+
-| Code folding| Yes|   No |
-+-++--+
-| Extract Local Variable  | Yes|   No |
-+-++--+
-| Extract Function/Method | Yes|   No |
-+-++--+
-| Quick Assist| Yes|   No |
-+-++--+
-| Hide Method | Yes|   No |
-+-++--+
-| Implement Method| Yes|   No |
-+-++--+
-| Gen. Getters/Setters| Yes|   No |
-+-++--+
-| Syntax and Semantic Coloring| No |   No |
-+-++--+
-| Call hierarchy  | No |   No |
-+-++--+
-| Type hierarchy  | No |   Yes|
-+-++--+
-| Organize Includes   | No |   No |
-+-++--+
++-+-+--+
+| C/C++ Editor feature|  LSP|  Clangd  |
++=+=+==+
+| Formatting  | Yes |   Yes|
++-+-+--+
+| Completion  | Yes |   Yes|
++-+-+--+
+| Diagnostics | Yes |   Yes|
++-+-+--+
+| Fix-its | Yes |   Yes|
++-+-+--+
+| Go to De

[PATCH] D66404: [CFG] Make destructor calls more accurate

2019-08-18 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment.

Whoaaa, at a glance this looks absolutely fantastic. I'll get back to this 
tomorrow to take a more careful look.


Repository:
  rC Clang

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

https://reviews.llvm.org/D66404



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