[llvm] r238311 - We always have an InstPrinter.
David Blaikie
dblaikie at gmail.com
Wed May 27 11:14:33 PDT 2015
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.
>
Could we take the parameter by reference instead of pointer?
>
> Cheers,
> Rafael
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150527/c95e8ef2/attachment.html>
More information about the llvm-commits
mailing list