llvm.org GIT mirror llvm / a794f4a
[COFF, ARM64] Use '//' as comment character in assembly files in GNU environments This allows using semicolons for bundling up more than one statement per line. This is used within the mingw-w64 project in some assembly files that contain code for multiple architectures. Differential Revision: https://reviews.llvm.org/D36366 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310797 91177308-0d34-0410-b5e6-96231b3b80d8 Martin Storsjo 2 years ago
4 changed file(s) with 30 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
101101 }
102102
103103 AArch64MCAsmInfoCOFF::AArch64MCAsmInfoCOFF() {
104 CommentString = ";";
105104 PrivateGlobalPrefix = ".L";
106105 PrivateLabelPrefix = ".L";
107106 AlignmentIsInBytes = false;
108107 SupportsDebugInformation = true;
109108 ExceptionsType = ExceptionHandling::WinEH;
110109 }
110
111 AArch64MCAsmInfoMicrosoftCOFF::AArch64MCAsmInfoMicrosoftCOFF() {
112 CommentString = ";";
113 }
114
115 AArch64MCAsmInfoGNUCOFF::AArch64MCAsmInfoGNUCOFF() {
116 CommentString = "//";
117 }
3737 explicit AArch64MCAsmInfoCOFF();
3838 };
3939
40 struct AArch64MCAsmInfoMicrosoftCOFF : public AArch64MCAsmInfoCOFF {
41 explicit AArch64MCAsmInfoMicrosoftCOFF();
42 };
43
44 struct AArch64MCAsmInfoGNUCOFF : public AArch64MCAsmInfoCOFF {
45 explicit AArch64MCAsmInfoGNUCOFF();
46 };
47
4048 } // namespace llvm
4149
4250 #endif
6868 MCAsmInfo *MAI;
6969 if (TheTriple.isOSBinFormatMachO())
7070 MAI = new AArch64MCAsmInfoDarwin();
71 else if (TheTriple.isWindowsMSVCEnvironment())
72 MAI = new AArch64MCAsmInfoMicrosoftCOFF();
7173 else if (TheTriple.isOSBinFormatCOFF())
72 MAI = new AArch64MCAsmInfoCOFF();
74 MAI = new AArch64MCAsmInfoGNUCOFF();
7375 else {
7476 assert(TheTriple.isOSBinFormatELF() && "Invalid target");
7577 MAI = new AArch64MCAsmInfoELF(TheTriple);
0 // RUN: llvm-mc -triple aarch64-windows-gnu -filetype obj -o %t.obj %s
1 // RUN: llvm-objdump -d %t.obj | FileCheck %s
2
3 func:
4 // Check that the nop instruction after the semicolon also is handled
5 nop; nop
6 add x0, x0, #42
7
8 // CHECK: 0: 1f 20 03 d5 nop
9 // CHECK: 4: 1f 20 03 d5 nop
10 // CHECK: 8: 00 a8 00 91 add x0, x0, #42