r190038 - clang-format: Enable formatting of nested blocks.

Daniel Jasper djasper at google.com
Thu Sep 5 09:08:39 PDT 2013


Added LLVM_ATTRIBUTE_UNUSED in r190061.


On Thu, Sep 5, 2013 at 5:54 PM, Richard Sandiford <
rsandifo at linux.vnet.ibm.com> wrote:

> Probably old news, sorry, but this:
>
> Daniel Jasper <djasper at google.com> writes:
> > @@ -1183,23 +1189,39 @@ void UnwrappedLineParser::parseObjCProto
> >    parseObjCUntilAtEnd();
> >  }
> >
> > +static void printDebugInfo(const UnwrappedLine &Line, StringRef Prefix
> = "") {
> > +  llvm::dbgs() << Prefix << "Line(" << Line.Level << ")"
> > +               << (Line.InPPDirective ? " MACRO" : "") << ": ";
> > +  for (std::list<UnwrappedLineNode>::const_iterator I =
> Line.Tokens.begin(),
> > +                                                    E =
> Line.Tokens.end();
> > +       I != E; ++I) {
> > +    llvm::dbgs() << I->Tok->Tok.getName() << " ";
> > +  }
> > +  for (std::list<UnwrappedLineNode>::const_iterator I =
> Line.Tokens.begin(),
> > +                                                    E =
> Line.Tokens.end();
> > +       I != E; ++I) {
> > +    const UnwrappedLineNode &Node = *I;
> > +    for (SmallVectorImpl<UnwrappedLine>::const_iterator
> > +             I = Node.Children.begin(),
> > +             E = Node.Children.end();
> > +         I != E; ++I) {
> > +      printDebugInfo(*I, "\nChild: ");
> > +    }
> > +  }
> > +  llvm::dbgs() << "\n";
> > +}
> > +
> >  void UnwrappedLineParser::addUnwrappedLine() {
> >    if (Line->Tokens.empty())
> >      return;
> >    DEBUG({
> > -    llvm::dbgs() << "Line(" << Line->Level << ")"
> > -                 << (Line->InPPDirective ? " MACRO" : "") << ": ";
> > -    for (std::list<FormatToken *>::iterator I = Line->Tokens.begin(),
> > -                                            E = Line->Tokens.end();
> > -         I != E; ++I) {
> > -      llvm::dbgs() << (*I)->Tok.getName() << " ";
> > -    }
> > -    llvm::dbgs() << "\n";
> > +    if (CurrentLines == &Lines)
> > +      printDebugInfo(*Line);
> >    });
>
> causes a -Werror release bootstrap to fail, because the function is
> defined but not used in that case.
>
> Thanks,
> Richard
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130905/1bbc5bd2/attachment.html>


More information about the cfe-commits mailing list