[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

Christian Kandeler via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 20 02:17:56 PST 2024


================
@@ -2346,11 +2346,11 @@ outgoingCalls(const CallHierarchyItem &Item, const SymbolIndex *Index) {
     // Filter references to only keep function calls
     using SK = index::SymbolKind;
     auto Kind = Callee.SymInfo.Kind;
-    if (Kind != SK::Function && Kind != SK::InstanceMethod &&
-        Kind != SK::ClassMethod && Kind != SK::StaticMethod &&
-        Kind != SK::Constructor && Kind != SK::Destructor &&
-        Kind != SK::ConversionFunction)
-      return;
+    bool NotCall = (Kind != SK::Function && Kind != SK::InstanceMethod &&
+                    Kind != SK::ClassMethod && Kind != SK::StaticMethod &&
+                    Kind != SK::Constructor && Kind != SK::Destructor &&
+                    Kind != SK::ConversionFunction);
+    assert(!NotCall);
----------------
ckandeler wrote:

Can we get rid of the double negation? It just seems to obfuscate the logic for no particular reason.

https://github.com/llvm/llvm-project/pull/77556


More information about the cfe-commits mailing list