[PATCH] D109513: [AsmPrinter, SystemZ] Allow target to add instructions before section is ended.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 21 04:12:30 PDT 2021


jonpa added inline comments.


================
Comment at: llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp:553
+    SystemZTargetStreamer *TS = getTargetStreamer();
+    assert(TS && "do not have a target streamer");
     MCSymbol *DotSym = nullptr;
----------------
uweigand wrote:
> Maybe move the assert into the getTargetStreamer() routine, just like in the AsmParser?   (In fact, do we really need two copies of the getTargetStreamer() routine now?)
I started out with the assert inside getTargetStreamer(), but then got test failures because the TargetStreamer is not necessarily created in some cases for example when output is discarded. This was while I was still doing this in emitEndOfAsmFile(), but I see that now it is actually possible to move the assert back, which I did.

Hmm, maybe we could store a pointer to it when createAsmTargetStreamer() / createObjectTargetStreamer() is called. I think that maybe it's better to use the getters like now when they are used, as this object is not guaranteed to be present... 



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

https://reviews.llvm.org/D109513



More information about the llvm-commits mailing list