From: Argyrios Kyrtzidis Date: Wed, 7 Jul 2010 12:24:14 +0000 (+0000) Subject: Simplify code and remove comment that is no longer relevant. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=082a625c98588aa3e6f825c58e56ad13bd3d6de6;p=clang Simplify code and remove comment that is no longer relevant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107772 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Checker/PathDiagnostic.cpp b/lib/Checker/PathDiagnostic.cpp index 6e6c7496f1..cf05a7df67 100644 --- a/lib/Checker/PathDiagnostic.cpp +++ b/lib/Checker/PathDiagnostic.cpp @@ -181,15 +181,8 @@ PathDiagnosticRange PathDiagnosticLocation::asRange() const { if (const ObjCMethodDecl *MD = dyn_cast(D)) return MD->getSourceRange(); if (const FunctionDecl *FD = dyn_cast(D)) { - // FIXME: We would like to always get the function body, even - // when it needs to be de-serialized, but getting the - // ASTContext here requires significant changes. - if (Stmt *Body = FD->getBody()) { - if (CompoundStmt *CS = dyn_cast(Body)) - return CS->getSourceRange(); - else - return cast(Body)->getSourceRange(); - } + if (Stmt *Body = FD->getBody()) + return Body->getSourceRange(); } else { SourceLocation L = D->getLocation();