[cfe-commits] r142062 - /cfe/trunk/include/clang/Basic/Diagnostic.h

Chandler Carruth chandlerc at gmail.com
Sat Oct 15 03:48:13 PDT 2011


Author: chandlerc
Date: Sat Oct 15 05:48:13 2011
New Revision: 142062

URL: http://llvm.org/viewvc/llvm-project?rev=142062&view=rev
Log:
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.

Modified:
    cfe/trunk/include/clang/Basic/Diagnostic.h

Modified: cfe/trunk/include/clang/Basic/Diagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Diagnostic.h?rev=142062&r1=142061&r2=142062&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Diagnostic.h (original)
+++ cfe/trunk/include/clang/Basic/Diagnostic.h Sat Oct 15 05:48:13 2011
@@ -951,6 +951,11 @@
     return DiagObj->DiagRanges[Idx];
   }
 
+  /// \brief Return an array reference for this diagnostic's ranges.
+  ArrayRef<CharSourceRange> getRanges() const {
+    return llvm::makeArrayRef(DiagObj->DiagRanges, DiagObj->NumDiagRanges);
+  }
+
   unsigned getNumFixItHints() const {
     return DiagObj->NumFixItHints;
   }





More information about the cfe-commits mailing list