We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4cebe5 commit 381c221Copy full SHA for 381c221
clang/lib/AST/Expr.cpp
@@ -1544,7 +1544,16 @@ unsigned CallExpr::offsetToTrailingObjects(StmtClass SC) {
1544
}
1545
1546
Decl *Expr::getReferencedDeclOfCallee() {
1547
- Expr *CEE = IgnoreParenImpCasts();
+
1548
+ // Optimize for the common case first
1549
+ // (simple function or member function call)
1550
+ // then try more exotic possibilities
1551
+ Expr *CEE = IgnoreImpCasts();
1552
+ if (auto *DRE = dyn_cast<DeclRefExpr>(CEE))
1553
+ return DRE->getDecl();
1554
1555
+ if (auto *ME = dyn_cast<MemberExpr>(CEE))
1556
+ return ME->getMemberDecl();
1557
1558
while (auto *NTTP = dyn_cast<SubstNonTypeTemplateParmExpr>(CEE))
1559
CEE = NTTP->getReplacement()->IgnoreParenImpCasts();
0 commit comments