diff options
author | Brad King <brad.king@kitware.com> | 2014-12-08 21:10:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-12-08 21:10:14 (GMT) |
commit | a0fe3f0824febccf8e5cd517587b455742f96c51 (patch) | |
tree | ff3e199baa641273bfd919a014f4914cb95076e2 /src | |
parent | 01f991852c288a061e121e0c6017da32b34bb3da (diff) | |
download | CastXML-a0fe3f0824febccf8e5cd517587b455742f96c51.zip CastXML-a0fe3f0824febccf8e5cd517587b455742f96c51.tar.gz CastXML-a0fe3f0824febccf8e5cd517587b455742f96c51.tar.bz2 |
RunClang: Do not add implicit members if errors occurred
If there are errors in the actual input translation unit, do not bother
trying to extend it with implicit members because we will not generate
output anyway.
Diffstat (limited to 'src')
-rw-r--r-- | src/RunClang.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/RunClang.cxx b/src/RunClang.cxx index 8346b09..7a003d2 100644 --- a/src/RunClang.cxx +++ b/src/RunClang.cxx @@ -87,12 +87,14 @@ public: // Perform instantiations needed by the original translation unit. sema.PerformPendingInstantiations(); - // Suppress diagnostics from below extensions to the translation unit. - sema.getDiagnostics().setSuppressAllDiagnostics(true); + if (!sema.getDiagnostics().hasErrorOccurred()) { + // Suppress diagnostics from below extensions to the translation unit. + sema.getDiagnostics().setSuppressAllDiagnostics(true); - // Add implicit members to classes. - for(clang::CXXRecordDecl* rd : this->Classes) { - this->AddImplicitMembers(rd); + // Add implicit members to classes. + for(clang::CXXRecordDecl* rd : this->Classes) { + this->AddImplicitMembers(rd); + } } // Tell Clang to finish the translation unit and tear down the parser. |