[llvm] r238311 - We always have an InstPrinter.

Filipe Cabecinhas filcab at gmail.com
Wed May 27 10:33:34 PDT 2015


Ah, should have checked the context.
Thanks.

  Filipe

  F

On Wed, May 27, 2015 at 10:33 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> >> --- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
> >> +++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Wed May 27 07:13:06 2015
> >> @@ -65,8 +65,9 @@ public:
> >>          AsmBackend(asmbackend), CommentStream(CommentToEmit),
> >>          IsVerboseAsm(isVerboseAsm), ShowInst(showInst),
> >>          UseDwarfDirectory(useDwarfDirectory) {
> >> -    if (InstPrinter && IsVerboseAsm)
> >> -      InstPrinter->setCommentStream(CommentStream);
> >> +    assert(InstPrinter);
> >> +    if (IsVerboseAsm)
> >> +        InstPrinter->setCommentStream(CommentStream);
> >>    }
> >
> >
> > Why the assert here?If there's a reason, why not in the other chunks too?
>
> It is the constructor, so it is the first code path that gets hit.
>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150527/e45f8806/attachment.html>


More information about the llvm-commits mailing list