[cfe-commits] r90944 - /cfe/trunk/lib/Frontend/AnalysisConsumer.cpp

Ted Kremenek kremenek at apple.com
Tue Dec 8 19:45:19 PST 2009


Author: kremenek
Date: Tue Dec  8 21:45:19 2009
New Revision: 90944

URL: http://llvm.org/viewvc/llvm-project?rev=90944&view=rev
Log:
Fix crash in DisplayFunction().  ObjCInterfaceDecls can also get passed to this function, but we don't want to display them.

Modified:
    cfe/trunk/lib/Frontend/AnalysisConsumer.cpp

Modified: cfe/trunk/lib/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/AnalysisConsumer.cpp?rev=90944&r1=90943&r2=90944&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/Frontend/AnalysisConsumer.cpp Tue Dec  8 21:45:19 2009
@@ -143,17 +143,14 @@
     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) {





More information about the cfe-commits mailing list