goldstein.w.n added a comment.

In D137181#3926848 <https://reviews.llvm.org/D137181#3926848>, @owenpan wrote:

> In D137181#3924002 <https://reviews.llvm.org/D137181#3924002>, @sstwcw wrote:
>
>> Can you make `TokenAnnotator::printDebugInfo` print `PPLevel`?
>
> @goldstein.w.n can you add it as follows?
>
>   $ git diff TokenAnnotator.cpp
>   diff --git a/clang/lib/Format/TokenAnnotator.cpp 
> b/clang/lib/Format/TokenAnnotator.cpp
>   index 75570552146c..536472e9d136 100644
>   --- a/clang/lib/Format/TokenAnnotator.cpp
>   +++ b/clang/lib/Format/TokenAnnotator.cpp
>   @@ -5093,8 +5093,9 @@ bool TokenAnnotator::canBreakBefore(const 
> AnnotatedLine &Line,
>    }
>    
>    void TokenAnnotator::printDebugInfo(const AnnotatedLine &Line) const {
>   -  llvm::errs() << "AnnotatedTokens(L=" << Line.Level << ", T=" << Line.Type
>   -               << ", C=" << Line.IsContinuation << "):\n";
>   +  llvm::errs() << "AnnotatedTokens(L=" << Line.Level << ", P=" << 
> Line.PPLevel
>   +               << ", T=" << Line.Type << ", C=" << Line.IsContinuation
>   +               << "):\n";
>      const FormatToken *Tok = Line.First;
>      while (Tok) {
>        llvm::errs() << " M=" << Tok->MustBreakBefore

Done.

>> Since you changed the rules for indentation in `UnwrappedLineFormatter`, do 
>> you also need to change `UnwrappedLineParser::mightFitOnOneLine`?
>
> `mightFitOnOneLine` is not called on PPDirective lines, but it's a good idea 
> to add an assertion.

Added assert.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137181/new/

https://reviews.llvm.org/D137181

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to