aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/PartialDiagnostic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic/PartialDiagnostic.h')
-rw-r--r--include/clang/Basic/PartialDiagnostic.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Basic/PartialDiagnostic.h b/include/clang/Basic/PartialDiagnostic.h
index 53ce95cab1..b2f14afe56 100644
--- a/include/clang/Basic/PartialDiagnostic.h
+++ b/include/clang/Basic/PartialDiagnostic.h
@@ -329,6 +329,15 @@ public:
bool hasStorage() const { return DiagStorage != nullptr; }
+ /// Retrieve the string argument at the given index.
+ StringRef getStringArg(unsigned I) {
+ assert(DiagStorage && "No diagnostic storage?");
+ assert(I < DiagStorage->NumDiagArgs && "Not enough diagnostic args");
+ assert(DiagStorage->DiagArgumentsKind[I]
+ == DiagnosticsEngine::ak_std_string && "Not a string arg");
+ return DiagStorage->DiagArgumentsStr[I];
+ }
+
friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD,
unsigned I) {
PD.AddTaggedVal(I, DiagnosticsEngine::ak_uint);