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