]> granicus.if.org Git - clang/commitdiff
Simplify code and remove comment that is no longer relevant.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 7 Jul 2010 12:24:14 +0000 (12:24 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 7 Jul 2010 12:24:14 +0000 (12:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107772 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/PathDiagnostic.cpp

index 6e6c7496f1d2a9789b5c9682ca11c20862389b28..cf05a7df67f342ce925729b45616ecd8f37284e1 100644 (file)
@@ -181,15 +181,8 @@ PathDiagnosticRange PathDiagnosticLocation::asRange() const {
       if (const ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D))
         return MD->getSourceRange();
       if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(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<CompoundStmt>(Body))
-            return CS->getSourceRange();
-          else
-            return cast<CXXTryStmt>(Body)->getSourceRange();
-        }
+        if (Stmt *Body = FD->getBody())
+          return Body->getSourceRange();
       }
       else {
         SourceLocation L = D->getLocation();