diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-12-09 03:45:19 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-12-09 03:45:19 +0000 |
commit | 06ba78d07de713070d7f1b21af8f2b7a50c03b3e (patch) | |
tree | fe3f56f96b35f974a5f6d65d4ddf7cdc94d908bf | |
parent | a038825b1c2cbb7f8448f591927a7db76393dd0e (diff) | |
download | bcm5719-llvm-06ba78d07de713070d7f1b21af8f2b7a50c03b3e.tar.gz bcm5719-llvm-06ba78d07de713070d7f1b21af8f2b7a50c03b3e.zip |
Fix crash in DisplayFunction(). ObjCInterfaceDecls can also get passed to this function, but we don't want to display them.
llvm-svn: 90944
-rw-r--r-- | clang/lib/Frontend/AnalysisConsumer.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/Frontend/AnalysisConsumer.cpp b/clang/lib/Frontend/AnalysisConsumer.cpp index 92f34b21fed..dab64d0d93a 100644 --- a/clang/lib/Frontend/AnalysisConsumer.cpp +++ b/clang/lib/Frontend/AnalysisConsumer.cpp @@ -143,17 +143,14 @@ public: PresumedLoc Loc = SM.getPresumedLoc(D->getLocation()); llvm::errs() << "ANALYZE: " << Loc.getFilename(); - if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) { - assert(isa<FunctionDecl>(D) || isa<ObjCMethodDecl>(D)); - llvm::errs() << ' ' << ND->getNameAsString(); + if (isa<FunctionDecl>(D) || isa<ObjCMethodDecl>(D)) { + const NamedDecl *ND = cast<NamedDecl>(D); + llvm::errs() << ' ' << ND->getNameAsString() << '\n'; } - else { - assert(isa<BlockDecl>(D)); + else if (isa<BlockDecl>(D)) { llvm::errs() << ' ' << "block(line:" << Loc.getLine() << ",col:" - << Loc.getColumn(); + << Loc.getColumn() << '\n'; } - - llvm::errs() << '\n'; } void addCodeAction(CodeAction action) { |