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 const auto SourceLoc = MatchedStmt ==
nullptr
33 ? MatchedExpr->getSelectorStartLoc()
34 : MatchedStmt->getThrowLoc();
37 if (SourceLoc.isInvalid())
42 if (SourceLoc.isMacroID()) {
43 const SourceManager &SM = *Result.SourceManager;
44 const auto MacroLoc = SM.getImmediateMacroCallerLoc(SourceLoc);
47 if (SM.isInSystemHeader(MacroLoc))
52 "pass in NSError ** instead of throwing exception to indicate "
53 "Objective-C errors");