Switch the emission of diagnostics without a source location to
a dedicated path. The logic for such diagnostics is much simpler than for others. This begins to make an important separation in this routine. We expect most (and most interesting) textual diagnostics to be made in the presence of at least *some* source locations and a source manager. However the DiagnosticConsumer must be prepared to diagnose errors even when the source manager doesn't (yet) exist or when there is no location information at all. In order to sink more and more logic into the TextDiagnostic class while minimizing its complexity, my plan is to force the DiagnosticConsumer to special case diagnosing any locationless messages and then hand the rest to the TextDiagnostic class. I'd appreciate any comments on this design. It requires a bit of code duplication in order to keep interfaces simple. Alternatively, if we really need TextDiagnostic to be capable of handling diagnostics even in the absence of a viable SourceManager, then this split isn't necessary. llvm-svn: 140525
Loading
Please register or sign in to comment