[PATCH] D138535: [AVR] Add $ separator string (like avr-gcc)

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 17:12:39 PST 2022


aykevl created this revision.
aykevl added reviewers: dylanmckay, benshi001, compnerd.
Herald added subscribers: Jim, hiraditya.
Herald added a project: All.
aykevl requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

avr-gcc uses the $ symbol as an assembly separator instead of the more common %% syntax. We need it in LLVM too to be compatible.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138535

Files:
  llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp
  llvm/test/MC/AVR/separator.s


Index: llvm/test/MC/AVR/separator.s
===================================================================
--- /dev/null
+++ llvm/test/MC/AVR/separator.s
@@ -0,0 +1,11 @@
+; RUN: llvm-mc -filetype=obj -triple avr < %s | llvm-objdump -d - | FileCheck %s
+
+foo:
+
+  ; The $ symbol is a separator (like a newline).
+  mov r0, r1 $ mov r1, r2 $ mov r2, r3 $ mov r3, r4
+
+; CHECK: mov r0, r1
+; CHECK: mov r1, r2
+; CHECK: mov r2, r3
+; CHECK: mov r3, r4
Index: llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp
===================================================================
--- llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp
+++ llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp
@@ -20,6 +20,7 @@
   CodePointerSize = 2;
   CalleeSaveStackSlotSize = 2;
   CommentString = ";";
+  SeparatorString = "$";
   PrivateGlobalPrefix = ".L";
   PrivateLabelPrefix = ".L";
   UsesELFSectionDirectiveForBSS = true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138535.477350.patch
Type: text/x-patch
Size: 909 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221123/7dd3bf79/attachment.bin>


More information about the llvm-commits mailing list