diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-02-05 21:28:51 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-02-05 21:28:51 +0000 |
commit | e50187a987dadb6a3b6f673125617c8f42ff3560 (patch) | |
tree | 0cae3d8ee8944901212be6b715d17b7aad4be67e | |
parent | a5002106fbe5563aa59eba007416074d5b1ffecf (diff) |
Add guard in RewriteObjC::HandleTopLevelSingleDecl() to not do
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
-rw-r--r-- | lib/Frontend/RewriteObjC.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp index b90babda5c..d1b098af61 100644 --- a/lib/Frontend/RewriteObjC.cpp +++ b/lib/Frontend/RewriteObjC.cpp @@ -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; |