/// \brief Second string argument for the delayed diagnostic.
std::string DelayedDiagArg2;
- /// \brief Flag name value.
+ /// \brief Optional flag value.
///
- /// Some flags accept values. For instance, -Wframe-larger-than or -Rpass.
- /// When reporting a diagnostic with those flags, it is useful to also
- /// report the value that actually triggered the flag. The content of this
- /// string is a value to be emitted after the flag name.
- std::string FlagNameValue;
+ /// Some flags accept values, for instance: -Wframe-larger-than=<value> and
+ /// -Rpass=<value>. The content of this string is emitted after the flag name
+ /// and '='.
+ std::string FlagValue;
public:
explicit DiagnosticsEngine(
/// \brief Clear out the current diagnostic.
void Clear() { CurDiagID = ~0U; }
- /// \brief Return the value associated to this diagnostic flag.
- StringRef getFlagNameValue() const { return StringRef(FlagNameValue); }
-
- /// \brief Set the value associated to this diagnostic flag.
- void setFlagNameValue(StringRef V) { FlagNameValue = V; }
+ /// \brief Return the value associated with this diagnostic flag.
+ StringRef getFlagValue() const { return FlagValue; }
private:
/// \brief Report the delayed diagnostic.
DiagObj->DiagFixItHints.push_back(Hint);
}
- void addFlagValue(StringRef V) const { DiagObj->setFlagNameValue(V); }
+ void addFlagValue(StringRef V) const { DiagObj->FlagValue = V; }
};
struct AddFlagValue {
assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!");
CurDiagLoc = Loc;
CurDiagID = DiagID;
- FlagNameValue.clear();
+ FlagValue.clear();
return DiagnosticBuilder(this);
}