]> granicus.if.org Git - clang/commitdiff
Add guard in RewriteObjC::HandleTopLevelSingleDecl() to not do
authorTed Kremenek <kremenek@apple.com>
Fri, 5 Feb 2010 21:28:51 +0000 (21:28 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 5 Feb 2010 21:28:51 +0000 (21:28 +0000)
anything when Sema has issued an error.  This matches the behavior in
RewriteObjC::HandleTranslationUnit().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95434 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/RewriteObjC.cpp

index b90babda5c522194c8e26765ea4f3134af13e0ff..d1b098af616fa118c14c3d48e1ec2db482a66475 100644 (file)
@@ -634,6 +634,9 @@ void RewriteObjC::Initialize(ASTContext &context) {
 //===----------------------------------------------------------------------===//
 
 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::HandleDeclInMainFile(Decl *D) {
 }
 
 void RewriteObjC::HandleTranslationUnit(ASTContext &C) {
-  // Get the top-level buffer that this corresponds to.
-
-  // Rewrite tabs if we care.
-  //RewriteTabs();
-
   if (Diags.hasErrorOccurred())
     return;