From: Chandler Carruth Date: Sat, 15 Oct 2011 10:48:13 +0000 (+0000) Subject: Add an accessor for all of the ranges in a diagnostic as an ArrayRef. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28409289193afca1a3178a9796f8e8aebcb76896;p=clang Add an accessor for all of the ranges in a diagnostic as an ArrayRef. This will simplify a number of calls in the diagnostic printing going forward. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142062 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index fefc44ce7b..ae0f6ea0cf 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -951,6 +951,11 @@ public: return DiagObj->DiagRanges[Idx]; } + /// \brief Return an array reference for this diagnostic's ranges. + ArrayRef getRanges() const { + return llvm::makeArrayRef(DiagObj->DiagRanges, DiagObj->NumDiagRanges); + } + unsigned getNumFixItHints() const { return DiagObj->NumFixItHints; }