// Get the source range of the specified Stmt. SrcRange getStmtRange(const clang::Stmt *S, const clang::SourceManager& sm, const clang::LangOptions& options) { clang::SourceLocation SLoc = sm.getExpansionLoc(S->getLocStart()); clang::SourceLocation ELoc = sm.getExpansionLoc(S->getLocEnd()); // This is necessary to get the correct range of function-like macros. if (SLoc == ELoc && S->getLocEnd().isMacroID()) ELoc = sm.getExpansionRange(S->getLocEnd()).second; return constructSrcRange(sm, options, SLoc, ELoc); }