aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/Sema.h')
-rw-r--r--lib/Sema/Sema.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index baf9c23da5..ada8aa157a 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -339,6 +339,10 @@ public:
typedef std::vector<std::pair<SourceLocation, Decl *> >
PotentiallyReferencedDecls;
+ /// \brief A set of diagnostics that may be emitted.
+ typedef std::vector<std::pair<SourceLocation, PartialDiagnostic> >
+ PotentiallyEmittedDiagnostics;
+
/// \brief Data structure used to record current or nested
/// expression evaluation contexts.
struct ExpressionEvaluationContextRecord {
@@ -358,10 +362,14 @@ public:
/// evaluated.
PotentiallyReferencedDecls *PotentiallyReferenced;
+ /// \brief The set of diagnostics to emit should this potentially
+ /// potentially-evaluated context become evaluated.
+ PotentiallyEmittedDiagnostics *PotentiallyDiagnosed;
+
ExpressionEvaluationContextRecord(ExpressionEvaluationContext Context,
unsigned NumTemporaries)
: Context(Context), NumTemporaries(NumTemporaries),
- PotentiallyReferenced(0) { }
+ PotentiallyReferenced(0), PotentiallyDiagnosed(0) { }
void addReferencedDecl(SourceLocation Loc, Decl *Decl) {
if (!PotentiallyReferenced)
@@ -369,9 +377,17 @@ public:
PotentiallyReferenced->push_back(std::make_pair(Loc, Decl));
}
+ void addDiagnostic(SourceLocation Loc, const PartialDiagnostic &PD) {
+ if (!PotentiallyDiagnosed)
+ PotentiallyDiagnosed = new PotentiallyEmittedDiagnostics;
+ PotentiallyDiagnosed->push_back(std::make_pair(Loc, PD));
+ }
+
void Destroy() {
delete PotentiallyReferenced;
+ delete PotentiallyDiagnosed;
PotentiallyReferenced = 0;
+ PotentiallyDiagnosed = 0;
}
};