[cfe-commits] r95434 - /cfe/trunk/lib/Frontend/RewriteObjC.cpp

Ted Kremenek kremenek at apple.com
Fri Feb 5 13:28:51 PST 2010


Author: kremenek
Date: Fri Feb  5 15:28:51 2010
New Revision: 95434

URL: http://llvm.org/viewvc/llvm-project?rev=95434&view=rev
Log:
Add guard in RewriteObjC::HandleTopLevelSingleDecl() to not do
anything when Sema has issued an error.  This matches the behavior in
RewriteObjC::HandleTranslationUnit().

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

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

==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Fri Feb  5 15:28:51 2010
@@ -634,6 +634,9 @@
 //===----------------------------------------------------------------------===//
 
 void RewriteObjC::HandleTopLevelSingleDecl(Decl *D) {
+  if (Diags.hasErrorOccurred())
+    return;
+
   // Two cases: either the decl could be in the main file, or it could be in a
   // #included file.  If the former, rewrite it now.  If the later, check to see
   // if we rewrote the #include/#import.
@@ -5248,11 +5251,6 @@
 }
 
 void RewriteObjC::HandleTranslationUnit(ASTContext &C) {
-  // Get the top-level buffer that this corresponds to.
-
-  // Rewrite tabs if we care.
-  //RewriteTabs();
-
   if (Diags.hasErrorOccurred())
     return;
 





More information about the cfe-commits mailing list