[clang-tools-extra] f9201c7 - [clangd] NFC: Use more idiomatic way of checking for definition
Kirill Bobyrev via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 28 03:26:25 PDT 2021
Author: Kirill Bobyrev
Date: 2021-10-28T12:25:12+02:00
New Revision: f9201c70ad082a1c1d13b24f1c9cadab8b470e38
URL: https://github.com/llvm/llvm-project/commit/f9201c70ad082a1c1d13b24f1c9cadab8b470e38
DIFF: https://github.com/llvm/llvm-project/commit/f9201c70ad082a1c1d13b24f1c9cadab8b470e38.diff
LOG: [clangd] NFC: Use more idiomatic way of checking for definition
Added:
Modified:
clang-tools-extra/clangd/IncludeCleaner.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/IncludeCleaner.cpp b/clang-tools-extra/clangd/IncludeCleaner.cpp
index 6dfc5256feff..26ae356e243e 100644
--- a/clang-tools-extra/clangd/IncludeCleaner.cpp
+++ b/clang-tools-extra/clangd/IncludeCleaner.cpp
@@ -48,7 +48,7 @@ class ReferencedLocationCrawler
bool VisitFunctionDecl(FunctionDecl *FD) {
// Function definition will require redeclarations to be included.
- if (FD == FD->getDefinition())
+ if (FD->isThisDeclarationADefinition())
add(FD);
return true;
}
More information about the cfe-commits
mailing list