diff options
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/PathDiagnostic.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Analysis/PathDiagnostic.cpp b/lib/Analysis/PathDiagnostic.cpp index 1a4af471f5..ec96329852 100644 --- a/lib/Analysis/PathDiagnostic.cpp +++ b/lib/Analysis/PathDiagnostic.cpp @@ -173,6 +173,15 @@ PathDiagnosticRange PathDiagnosticLocation::asRange() const { switch (S->getStmtClass()) { default: break; + case Stmt::DeclStmtClass: { + const DeclStmt *DS = cast<DeclStmt>(S); + if (DS->isSingleDecl()) { + // Should always be the case, but we'll be defensive. + return SourceRange(DS->getLocStart(), + DS->getSingleDecl()->getLocation()); + } + break; + } // FIXME: Provide better range information for different // terminators. case Stmt::IfStmtClass: |