[PATCH] D80953: [AIX] asm output: use character literals in byte lists for strings
    David Tenty via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Jun  3 20:53:54 PDT 2020
    
    
  
daltenty added inline comments.
================
Comment at: llvm/lib/MC/MCAsmStreamer.cpp:966
   if (Data.size() == 1 ||
-      !(MAI->getAscizDirective() || MAI->getAsciiDirective())) {
+      !(MAI->getAscizDirective() || MAI->getAsciiDirective() ||
+        MAI->getByteListDirective())) {
----------------
Why not ward off trouble below and just make the check reflect whether `AsciizDirective` is actually usable in this case upfront?
```
Data.size() == 1 || !(MAI->getAsciiDirective() || MAI->getByteListDirective() || MAI->getAsciizDirective() && Data.back() == 0)
```
================
Comment at: llvm/lib/MC/MCAsmStreamer.cpp:988
+  } else {
+    assert(MAI->getByteListDirective() &&
+           "Hit unexpected case of having .asciz but not .ascii or similar.");
----------------
See above comment.
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