summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-06-15 22:11:51 +0000
committerJohn McCall <rjmccall@apple.com>2011-06-15 22:11:51 +0000
commitc20b1393e18eb88e150b013671d0c493ac2091b7 (patch)
treeb15036ca30b6b5c476419cfefe575a9afd05d03c
parentf7456194a372d39365bfa8d2ef53d98823a49e64 (diff)
downloadbcm5719-llvm-c20b1393e18eb88e150b013671d0c493ac2091b7.tar.gz
bcm5719-llvm-c20b1393e18eb88e150b013671d0c493ac2091b7.zip
Missing files.
llvm-svn: 133096
-rw-r--r--clang/include/clang/Basic/Diagnostic.h21
-rw-r--r--clang/include/clang/Basic/DiagnosticIDs.h4
2 files changed, 21 insertions, 4 deletions
diff --git a/clang/include/clang/Basic/Diagnostic.h b/clang/include/clang/Basic/Diagnostic.h
index fa763246d1b..9f12c548f51 100644
--- a/clang/include/clang/Basic/Diagnostic.h
+++ b/clang/include/clang/Basic/Diagnostic.h
@@ -251,6 +251,11 @@ private:
bool ErrorOccurred;
bool FatalErrorOccurred;
+ /// \brief Toggles for DiagnosticErrorTrap to check whether an error occurred
+ /// during a parsing section, e.g. during parsing a function.
+ bool TrapErrorOccurred;
+ bool TrapUnrecoverableErrorOccurred;
+
/// LastDiagLevel - This is the level of the last diagnostic emitted. This is
/// used to emit continuation diagnostics with the same level as the
/// diagnostic that they follow.
@@ -621,20 +626,28 @@ private:
/// queried.
class DiagnosticErrorTrap {
Diagnostic &Diag;
- unsigned PrevErrors;
public:
explicit DiagnosticErrorTrap(Diagnostic &Diag)
- : Diag(Diag), PrevErrors(Diag.NumErrors) {}
+ : Diag(Diag) { reset(); }
/// \brief Determine whether any errors have occurred since this
/// object instance was created.
bool hasErrorOccurred() const {
- return Diag.NumErrors > PrevErrors;
+ return Diag.TrapErrorOccurred;
+ }
+
+ /// \brief Determine whether any unrecoverable errors have occurred since this
+ /// object instance was created.
+ bool hasUnrecoverableErrorOccurred() const {
+ return Diag.TrapUnrecoverableErrorOccurred;
}
// Set to initial state of "no errors occurred".
- void reset() { PrevErrors = Diag.NumErrors; }
+ void reset() {
+ Diag.TrapErrorOccurred = false;
+ Diag.TrapUnrecoverableErrorOccurred = false;
+ }
};
//===----------------------------------------------------------------------===//
diff --git a/clang/include/clang/Basic/DiagnosticIDs.h b/clang/include/clang/Basic/DiagnosticIDs.h
index fa816de4fdd..ae4ed5bbb13 100644
--- a/clang/include/clang/Basic/DiagnosticIDs.h
+++ b/clang/include/clang/Basic/DiagnosticIDs.h
@@ -227,6 +227,10 @@ private:
/// suppressed.
bool ProcessDiag(Diagnostic &Diag) const;
+ /// \brief Whether the diagnostic may leave the AST in a state where some
+ /// invariants can break.
+ bool isUnrecoverable(unsigned DiagID) const;
+
friend class Diagnostic;
};
OpenPOWER on IntegriCloud