@@ -335,13 +335,12 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
335
335
// / \brief Second string argument for the delayed diagnostic.
336
336
std::string DelayedDiagArg2;
337
337
338
- // / \brief Flag name value.
338
+ // / \brief Optional flag value.
339
339
// /
340
- // / Some flags accept values. For instance, -Wframe-larger-than or -Rpass.
341
- // / When reporting a diagnostic with those flags, it is useful to also
342
- // / report the value that actually triggered the flag. The content of this
343
- // / string is a value to be emitted after the flag name.
344
- std::string FlagNameValue;
340
+ // / Some flags accept values, for instance: -Wframe-larger-than=<value> and
341
+ // / -Rpass=<value>. The content of this string is emitted after the flag name
342
+ // / and '='.
343
+ std::string FlagValue;
345
344
346
345
public:
347
346
explicit DiagnosticsEngine (
@@ -703,11 +702,8 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
703
702
// / \brief Clear out the current diagnostic.
704
703
void Clear () { CurDiagID = ~0U ; }
705
704
706
- // / \brief Return the value associated to this diagnostic flag.
707
- StringRef getFlagNameValue () const { return StringRef (FlagNameValue); }
708
-
709
- // / \brief Set the value associated to this diagnostic flag.
710
- void setFlagNameValue (StringRef V) { FlagNameValue = V; }
705
+ // / \brief Return the value associated with this diagnostic flag.
706
+ StringRef getFlagValue () const { return FlagValue; }
711
707
712
708
private:
713
709
// / \brief Report the delayed diagnostic.
@@ -997,7 +993,7 @@ class DiagnosticBuilder {
997
993
DiagObj->DiagFixItHints .push_back (Hint);
998
994
}
999
995
1000
- void addFlagValue (StringRef V) const { DiagObj->setFlagNameValue (V) ; }
996
+ void addFlagValue (StringRef V) const { DiagObj->FlagValue = V ; }
1001
997
};
1002
998
1003
999
struct AddFlagValue {
@@ -1108,7 +1104,7 @@ inline DiagnosticBuilder DiagnosticsEngine::Report(SourceLocation Loc,
1108
1104
assert (CurDiagID == ~0U && " Multiple diagnostics in flight at once!" );
1109
1105
CurDiagLoc = Loc;
1110
1106
CurDiagID = DiagID;
1111
- FlagNameValue .clear ();
1107
+ FlagValue .clear ();
1112
1108
return DiagnosticBuilder (this );
1113
1109
}
1114
1110
0 commit comments