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 | 31e7f0f2937f0ae9faf35b4158b2efd4fb0b458b (patch) | |
tree | 8a8d7cd2b52abee474aab0fc3edba0f1b3c564b8 /clang/lib/Frontend/RewriteObjC.cpp | |
parent | 90916287edac3fdf623482a29062a7546a104fdd (diff) | |
download | bcm5719-llvm-31e7f0f2937f0ae9faf35b4158b2efd4fb0b458b.tar.gz bcm5719-llvm-31e7f0f2937f0ae9faf35b4158b2efd4fb0b458b.zip |
Add guard in RewriteObjC::HandleTopLevelSingleDecl() to not do
anything when Sema has issued an error. This matches the behavior in
RewriteObjC::HandleTranslationUnit().
llvm-svn: 95434
Diffstat (limited to 'clang/lib/Frontend/RewriteObjC.cpp')
-rw-r--r-- | clang/lib/Frontend/RewriteObjC.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp index b90babda5c5..d1b098af616 100644 --- a/clang/lib/Frontend/RewriteObjC.cpp +++ b/clang/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; |