[llvm-branch-commits] [clang-tools-extra] f0c41f1 - [clangd] Release notes for 11.x

2020-08-10 Thread Sam McCall via llvm-branch-commits

Author: Sam McCall
Date: 2020-08-10T12:38:24+02:00
New Revision: f0c41f1d63627a29055474e6df73f78761ca8213

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

LOG: [clangd] Release notes for 11.x

Added: 


Modified: 
clang-tools-extra/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang-tools-extra/docs/ReleaseNotes.rst 
b/clang-tools-extra/docs/ReleaseNotes.rst
index 0238ef5149b0..9f96d6eab38e 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -47,7 +47,196 @@ Major New Features
 Improvements to clangd
 --
 
-The improvements are...
+Performance
+^^^
+
+- Eliminated long delays after adding/removing includes ("async preambles")
+
+- Faster indexing
+
+- Less memory used to index headers used by open files ("dynamic index")
+
+- Many requests are implicitly cancelled rather than queued when the file is
+  edited, preventing a backlog
+
+- Background indexing can be selectively disabled per-path through config
+
+Selecting and targeting
+^^^
+
+- Improved understanding and selection around broken code ("recovery AST")
+
+- Operations like "go-to-definition" will target things on the left of the
+  cursor, if there is nothing eligible on the right.
+
+- Arguments to ``assert()``-like macros can be properly selected.
+
+Diagnostics
+^^^
+
+- When a header is saved, diagnostics for files that use it are updated.
+
+- Calls ``std::make_unique`` produce diagnostics for the constructor call.
+  (Template functions *in general* are not expanded for performance reasons).
+
+- Diagnostics update more quickly for files that build quickly (no 500ms delay)
+
+- Automatic fixes are offered even when they affect macro arguments.
+
+- Warnings from included headers are not shown (but errors still are).
+
+- A handful of high-quality clang-tidy checks are enabled by default:
+
+  - readability-misleading-indentation,
+
+  - readability-deleted-default,
+
+  - bugprone-integer-division,
+
+  - bugprone-sizeof-expression,
+
+  - bugprone-suspicious-missing-comma,
+
+  - bugprone-unused-raii,
+
+  - bugprone-unused-return-value,
+
+  - misc-unused-using-decls,
+
+  - misc-unused-alias-decls,
+
+  - misc-definitions-in-headers
+
+Refactorings
+
+
+- Rename applies across the project, using the index.
+
+- Accuracy of rename improved in many places.
+
+- New refactoring: add using declaration for qualified name.
+
+- New refactoring: move function definition out-of-line.
+
+Code completion
+^^^
+
+- Function call parentheses are not inserted if they already exist.
+
+- Completion of ``#include`` filenames triggers earlier (after ``<``, ``"``, 
and
+  ``/``) and is less aggressive about replacing existing text.
+
+- Documentation is reflowed in the same way as on hover.
+
+Go-to-definition
+
+
+- Dependent names in templates may be heuristically resolved
+
+- Identifiers in comments may be resolved using other occurrences in the file
+  or in the index.
+
+- Go-to-definition on an ``override`` or ``final`` specifier jumps to the
+  overridden method.
+
+Hover
+^
+
+- Expressions passed as function arguments show parameter name, conversions 
etc.
+
+- Members now include the access specifier in the displayed declaration.
+
+- Classes and fields show memory layout information (size and offset).
+
+- Somewhat improved understanding of formatting in documentation comments.
+
+- Trivial inline getters/setters are implicitly documented as such.
+
+Highlighting
+
+
+- The ``semanticTokens`` protocol from LSP 3.16 is supported.
+  (Only token types are exposed, no modifiers yet).
+
+- The non-standard ``textDocument/semanticHighlighting`` notification is
+  deprecated and will be removed in clangd 12.
+
+- Placing the cursor on a control flow keyword highlights related flow
+  (e.g. ``break`` -> ``for``).
+
+Language support
+
+
+- clangd features now work inside templates on windows.
+  (MSVC-compatible delayed-template-parsing is no longer used).
+
+- Objective-C properties can be targeted and cross-references are indexed.
+
+- Field names in designated initializers (C++20) can be targeted, and code
+  completion works in many cases.
+
+- ``goto`` labels: go-to-defintion, cross-references, and rename all work.
+
+- Concepts (C++20): go-to-definition on concept names, and some limited code
+  completion support for concept members.
+
+System integration
+^^
+
+- The project index is now written to ``$PROJECT/.cache/clangd/index``.
+  ``$PROJECT/.clangd`` is now expected to be a configuration file.
+
+  Old ``$PROJECT/.clangd`` directories can safely be deleted.
+
+  We recommend including both ``.cache/`` and ``.c

[llvm-branch-commits] [clang-tools-extra] a450654 - [clangd] Fix error in release notes

2020-08-10 Thread Sam McCall via llvm-branch-commits

Author: Sam McCall
Date: 2020-08-10T16:45:11+02:00
New Revision: a450654a52874b094c264e0366c31126c03fdf2d

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

LOG: [clangd] Fix error in release notes

Added: 


Modified: 
clang-tools-extra/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang-tools-extra/docs/ReleaseNotes.rst 
b/clang-tools-extra/docs/ReleaseNotes.rst
index 9f96d6eab38e..83ae2c6605fd 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -207,7 +207,7 @@ System integration
 
   - ``%LocalAppData%\clangd\config.yaml`` on Windows
 
-  - ``~/Library/clangd/config.yaml`` on Mac
+  - ``~/Library/Preferences/clangd/config.yaml`` on Mac
 
   - ``$XDG_CONFIG_HOME/clangd/config.yaml`` or ``~/.config/clangd/config.yaml``
 on others



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 8b679fb - base changes

2020-08-10 Thread via llvm-branch-commits

Author: SharmaRithik
Date: 2020-08-10T22:43:54+05:30
New Revision: 8b679fbdd28129fc31d57c75614b83ee8501b4ab

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

LOG: base changes

Added: 


Modified: 
llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp

Removed: 




diff  --git a/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h 
b/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
index 630f936471f22..b313dccdde3bf 100644
--- a/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
@@ -16,6 +16,7 @@
 
 namespace llvm {
 
+class AAResults;
 class BasicBlock;
 class DependenceInfo;
 class DominatorTree;
@@ -40,14 +41,14 @@ bool isControlFlowEquivalent(const BasicBlock &BB0, const 
BasicBlock &BB1,
 bool isSafeToMoveBefore(Instruction &I, Instruction &InsertPoint,
 DominatorTree &DT,
 const PostDominatorTree *PDT = nullptr,
-DependenceInfo *DI = nullptr);
+DependenceInfo *DI = nullptr, AAResults *AA = nullptr);
 
 /// Return true if all instructions (except the terminator) in \p BB can be
 /// safely moved before \p InsertPoint.
 bool isSafeToMoveBefore(BasicBlock &BB, Instruction &InsertPoint,
 DominatorTree &DT,
 const PostDominatorTree *PDT = nullptr,
-DependenceInfo *DI = nullptr);
+DependenceInfo *DI = nullptr, AAResults *AA = nullptr);
 
 /// Move instructions, in an order-preserving manner, from \p FromBB to the
 /// beginning of \p ToBB when proven safe.

diff  --git a/llvm/lib/Transforms/Utils/CodeMoverUtils.cpp 
b/llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
index 08047dc0f96ee..1367baf8e1379 100644
--- a/llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
+++ b/llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
@@ -14,6 +14,7 @@
 #include "llvm/Transforms/Utils/CodeMoverUtils.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/Statistic.h"
+#include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Analysis/DependenceAnalysis.h"
 #include "llvm/Analysis/PostDominators.h"
 #include "llvm/Analysis/ValueTracking.h"
@@ -226,6 +227,82 @@ bool ControlConditions::isInverse(const Value &V1, const 
Value &V2) {
   return false;
 }
 
+/// Checks data dependency between /p I and instructions in /p InstsToCheck
+/// using dependence info.
+static bool isDependenceSafe(Instruction &I, DependenceInfo &DI,
+ SmallPtrSetImpl &InstsToCheck) {
+  return llvm::none_of(InstsToCheck, [&DI, &I](Instruction *CurInst) {
+auto DepResult = DI.depends(&I, CurInst, true);
+return (DepResult && (DepResult->isOutput() || DepResult->isFlow() ||
+  DepResult->isAnti()));
+  });
+}
+
+/// Checks data dependency between /p I and instructions in /p InstsToCheck
+/// using alias analysis.
+static bool isDependenceSafe(Instruction &I, AAResults &AA,
+ SmallPtrSetImpl &InstsToCheck) {
+  if (!I.mayReadOrWriteMemory())
+return true;
+
+  SmallVector MemLocs;
+  if (CallInst *CI = dyn_cast(&I)) {
+for (Value *Op : CI->arg_operands())
+  if (Op->getType()->isPointerTy()) {
+MemLocs.push_back(
+MemoryLocation(Op, LocationSize::unknown(), AAMDNodes()));
+  }
+  } else {
+MemLocs.push_back(MemoryLocation::get(&I));
+  }
+  for (MemoryLocation MemLoc : MemLocs) {
+return llvm::none_of(InstsToCheck, [&AA, &I, &MemLoc](Instruction *Inst) {
+  if (!Inst->mayReadOrWriteMemory())
+return false;
+  /// Get memory location for CallInst can be none and it won't be used for
+  /// CallInst.
+  auto DestMemLoc = MemoryLocation::get(Inst);
+  ModRefInfo Result, DestResult;
+  if (CallBase *CBSrc = dyn_cast(&I)) {
+if (CallBase *CBDest = dyn_cast(Inst)) {
+  Result = DestResult = AA.getModRefInfo(CBSrc, CBDest);
+} else {
+  Result = AA.getModRefInfo(CBSrc, DestMemLoc);
+  DestResult = AA.getModRefInfo(Inst, CBSrc);
+}
+  } else if (CallBase *CBDest = dyn_cast(Inst)) {
+Result = AA.getModRefInfo(&I, CBDest);
+DestResult = AA.getModRefInfo(CBDest, MemLoc);
+  } else {
+Result = AA.getModRefInfo(Inst, MemLoc);
+DestResult = AA.getModRefInfo(&I, DestMemLoc);
+if (AA.isNoAlias(MemLoc, DestMemLoc)) {
+  auto DestMemLoc = MemoryLocation::get(Inst);
+  if (MemLoc.Size.hasValue() && DestMemLoc.Size.hasValue() &&
+  AA.isNoAlias(MemLoc, DestMemLoc))
+return false;
+}
+  }
+  // RAR depe

[llvm-branch-commits] [llvm] 2e59efa - Revert "base changes"

2020-08-10 Thread via llvm-branch-commits

Author: SharmaRithik
Date: 2020-08-10T22:57:07+05:30
New Revision: 2e59efac833cce636feeaaacfadc7f0e5218e5da

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

LOG: Revert "base changes"

This reverts commit 8b679fbdd28129fc31d57c75614b83ee8501b4ab.

Added: 


Modified: 
llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp

Removed: 




diff  --git a/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h 
b/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
index b313dccdde3b..630f936471f2 100644
--- a/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
@@ -16,7 +16,6 @@
 
 namespace llvm {
 
-class AAResults;
 class BasicBlock;
 class DependenceInfo;
 class DominatorTree;
@@ -41,14 +40,14 @@ bool isControlFlowEquivalent(const BasicBlock &BB0, const 
BasicBlock &BB1,
 bool isSafeToMoveBefore(Instruction &I, Instruction &InsertPoint,
 DominatorTree &DT,
 const PostDominatorTree *PDT = nullptr,
-DependenceInfo *DI = nullptr, AAResults *AA = nullptr);
+DependenceInfo *DI = nullptr);
 
 /// Return true if all instructions (except the terminator) in \p BB can be
 /// safely moved before \p InsertPoint.
 bool isSafeToMoveBefore(BasicBlock &BB, Instruction &InsertPoint,
 DominatorTree &DT,
 const PostDominatorTree *PDT = nullptr,
-DependenceInfo *DI = nullptr, AAResults *AA = nullptr);
+DependenceInfo *DI = nullptr);
 
 /// Move instructions, in an order-preserving manner, from \p FromBB to the
 /// beginning of \p ToBB when proven safe.

diff  --git a/llvm/lib/Transforms/Utils/CodeMoverUtils.cpp 
b/llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
index 1367baf8e137..08047dc0f96e 100644
--- a/llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
+++ b/llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
@@ -14,7 +14,6 @@
 #include "llvm/Transforms/Utils/CodeMoverUtils.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/Statistic.h"
-#include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Analysis/DependenceAnalysis.h"
 #include "llvm/Analysis/PostDominators.h"
 #include "llvm/Analysis/ValueTracking.h"
@@ -227,82 +226,6 @@ bool ControlConditions::isInverse(const Value &V1, const 
Value &V2) {
   return false;
 }
 
-/// Checks data dependency between /p I and instructions in /p InstsToCheck
-/// using dependence info.
-static bool isDependenceSafe(Instruction &I, DependenceInfo &DI,
- SmallPtrSetImpl &InstsToCheck) {
-  return llvm::none_of(InstsToCheck, [&DI, &I](Instruction *CurInst) {
-auto DepResult = DI.depends(&I, CurInst, true);
-return (DepResult && (DepResult->isOutput() || DepResult->isFlow() ||
-  DepResult->isAnti()));
-  });
-}
-
-/// Checks data dependency between /p I and instructions in /p InstsToCheck
-/// using alias analysis.
-static bool isDependenceSafe(Instruction &I, AAResults &AA,
- SmallPtrSetImpl &InstsToCheck) {
-  if (!I.mayReadOrWriteMemory())
-return true;
-
-  SmallVector MemLocs;
-  if (CallInst *CI = dyn_cast(&I)) {
-for (Value *Op : CI->arg_operands())
-  if (Op->getType()->isPointerTy()) {
-MemLocs.push_back(
-MemoryLocation(Op, LocationSize::unknown(), AAMDNodes()));
-  }
-  } else {
-MemLocs.push_back(MemoryLocation::get(&I));
-  }
-  for (MemoryLocation MemLoc : MemLocs) {
-return llvm::none_of(InstsToCheck, [&AA, &I, &MemLoc](Instruction *Inst) {
-  if (!Inst->mayReadOrWriteMemory())
-return false;
-  /// Get memory location for CallInst can be none and it won't be used for
-  /// CallInst.
-  auto DestMemLoc = MemoryLocation::get(Inst);
-  ModRefInfo Result, DestResult;
-  if (CallBase *CBSrc = dyn_cast(&I)) {
-if (CallBase *CBDest = dyn_cast(Inst)) {
-  Result = DestResult = AA.getModRefInfo(CBSrc, CBDest);
-} else {
-  Result = AA.getModRefInfo(CBSrc, DestMemLoc);
-  DestResult = AA.getModRefInfo(Inst, CBSrc);
-}
-  } else if (CallBase *CBDest = dyn_cast(Inst)) {
-Result = AA.getModRefInfo(&I, CBDest);
-DestResult = AA.getModRefInfo(CBDest, MemLoc);
-  } else {
-Result = AA.getModRefInfo(Inst, MemLoc);
-DestResult = AA.getModRefInfo(&I, DestMemLoc);
-if (AA.isNoAlias(MemLoc, DestMemLoc)) {
-  auto DestMemLoc = MemoryLocation::get(Inst);
-  if (MemLoc.Size.hasValue() && DestMemLoc.Size.hasValue() &&
-  AA.isNoAlias(MemLoc, DestMemLoc