27 const MatchFinder::MatchResult &Result) {
28 const auto *MatchedStmt =
29 Result.Nodes.getNodeAs<ObjCAtThrowStmt>(
"throwStmt");
30 const auto *MatchedExpr =
31 Result.Nodes.getNodeAs<ObjCMessageExpr>(
"raiseException");
32 auto SourceLoc = MatchedStmt ==
nullptr ? MatchedExpr->getSelectorStartLoc()
33 : MatchedStmt->getThrowLoc();
36 if (SourceLoc.isInvalid())
41 if (SourceLoc.isMacroID()) {
42 const SourceManager &SM = *Result.SourceManager;
43 auto MacroLoc = SM.getImmediateMacroCallerLoc(SourceLoc);
46 if (SM.isInSystemHeader(MacroLoc))
51 "pass in NSError ** instead of throwing exception to indicate "
52 "Objective-C errors");