[PATCH] D80953: [AIX] asm output: use character literals in byte lists for strings

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 21:13:45 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/MC/MCAsmStreamer.cpp:905
+    if (isPrint(C)) {
+      OS << format(CharacterLiteralFormatString, static_cast<char>(C));
+      return;
----------------
daltenty wrote:
> hubert.reinterpretcast wrote:
> > May need to hedge against `-Werror,-Wformat-security` warning as seen recently on another commit.
> I'm assuming specifically we're worried about `-Wformat-nonliteral`. 
> 
> I think the MAI property supporting other arbitrary character formatting strings is a nice to have, but not essential to this patch, since AIX is currently the only user. We could simplify to the just supporting a character prefix (single quote in our case) or something like that so we can use a fixed format for the character itself.
@daltenty, the patch has been updated to encode the known (and used) formats into an enumeration type. The implementation of the formatting itself is selected via a switch, which passes different lambdas depending on the case chosen.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80953



More information about the llvm-commits mailing list