summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-12-08 21:10:14 (GMT)
committerBrad King <brad.king@kitware.com>2014-12-08 21:10:14 (GMT)
commita0fe3f0824febccf8e5cd517587b455742f96c51 (patch)
treeff3e199baa641273bfd919a014f4914cb95076e2 /src
parent01f991852c288a061e121e0c6017da32b34bb3da (diff)
downloadCastXML-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.cxx12
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.