[PATCH] D83657: [clangd] Add metrics for recovery-expr type propagation.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 13 02:32:07 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG26cf6c1513f9: [clangd] Add metrics for recovery-expr type propagation. (authored by hokein).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83657/new/
https://reviews.llvm.org/D83657
Files:
clang-tools-extra/clangd/Selection.cpp
clang-tools-extra/clangd/unittests/SelectionTests.cpp
Index: clang-tools-extra/clangd/unittests/SelectionTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/SelectionTests.cpp
+++ clang-tools-extra/clangd/unittests/SelectionTests.cpp
@@ -453,6 +453,8 @@
auto T = makeSelectionTree(Code, AST);
EXPECT_THAT(Tracer.takeMetric("selection_recovery"),
testing::ElementsAreArray({1}));
+ EXPECT_THAT(Tracer.takeMetric("selection_recovery_type"),
+ testing::ElementsAreArray({1}));
}
// FIXME: Doesn't select the binary operator node in
Index: clang-tools-extra/clangd/Selection.cpp
===================================================================
--- clang-tools-extra/clangd/Selection.cpp
+++ clang-tools-extra/clangd/Selection.cpp
@@ -41,10 +41,13 @@
void recordMetrics(const SelectionTree &S) {
static constexpr trace::Metric SelectionUsedRecovery(
"selection_recovery", trace::Metric::Distribution);
+ static constexpr trace::Metric RecoveryType("selection_recovery_type",
+ trace::Metric::Distribution);
const auto *Common = S.commonAncestor();
for (const auto *N = Common; N; N = N->Parent) {
- if (N->ASTNode.get<RecoveryExpr>()) {
+ if (const auto *RE = N->ASTNode.get<RecoveryExpr>()) {
SelectionUsedRecovery.record(1); // used recovery ast.
+ RecoveryType.record(RE->isTypeDependent() ? 0 : 1);
return;
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83657.277352.patch
Type: text/x-patch
Size: 1459 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200713/45315623/attachment.bin>
More information about the cfe-commits
mailing list