Rationalize some of how the locations of prior diagnostics are tracked
across emissions. 1) The include stack printing is conditioned on non-note diagnostics, not just on warning diagnostics. 2) Those should be full source locations as they're tied to a source manager. 3) We should pass in the prior state to the TextDiagnostic constructor, allow it to mutate as diagnostics are emitted, and then cache the final state before tearing it down. Some of this remains incomplete, specifically #3 isn't finished for the non-note location. That'll come when the include stack printing sinks down a level. This also highlights how *completely* bug-ridden this code is. For example, we currently do all these comparisons of a FullSourceLoc and a SourceLocation... which silently does a SourceLocation to SourceLocation comparison, completely disregarding the source manager from whence one of the arguments came. Oops! Good thing in practice this wasn't important, but it could in theory be suppressing caret diagnostics in a second TU on a single clang invocation. I'm hoping to hammer these bugs out as the refactorings occur, although for so many of them it's really unlikely I can dream up a test case that would show the potentially buggy behavior. llvm-svn: 142067
Loading
Please register or sign in to comment