]> granicus.if.org Git - clang/commit
introduce a new CharSourceRange class, and enhance the diagnostics routines
authorChris Lattner <sabre@nondot.org>
Fri, 18 Jun 2010 22:45:06 +0000 (22:45 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 18 Jun 2010 22:45:06 +0000 (22:45 +0000)
commit0a76aae8c03cb7dd7bdbe683485560afaf695959
treebe02325d4dbabf2f026a3297efe51a3e3511fa05
parent96fb42ea29253cf2b34848dfdb3e40ef14ca8ebc
introduce a new CharSourceRange class, and enhance the diagnostics routines
to use them instead of SourceRange.  CharSourceRange is just a SourceRange
plus a bool that indicates whether the range has the end character resolved
or whether the end location is the start of the end token.  While most of
the compiler wants to think of ranges that have ends that are the start of
the end token, the printf diagnostic stuff wants to highlight ranges within
tokens.

This is transparent to the diagnostic stuff.  To start taking advantage of
the new capabilities, you can do something like this:
  Diag(..) << CharSourceRange::getCharRange(Begin,End)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106338 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/Diagnostic.h
include/clang/Basic/PartialDiagnostic.h
include/clang/Basic/SourceLocation.h
include/clang/Frontend/TextDiagnosticPrinter.h
include/clang/Rewrite/Rewriter.h
lib/Basic/Diagnostic.cpp
lib/Checker/PathDiagnostic.cpp
lib/Frontend/TextDiagnosticPrinter.cpp
lib/Rewrite/Rewriter.cpp
tools/libclang/CIndex.cpp
tools/libclang/CXSourceLocation.h