[PATCH] D82240: [MCParser] Support quoted section name for COFF

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 22 09:40:27 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGc52bee61e91b: [MCParser] Support quoted section name for COFF (authored by MaskRay).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82240

Files:
  llvm/lib/MC/MCParser/COFFAsmParser.cpp
  llvm/test/MC/COFF/section.s


Index: llvm/test/MC/COFF/section.s
===================================================================
--- llvm/test/MC/COFF/section.s
+++ llvm/test/MC/COFF/section.s
@@ -190,5 +190,11 @@
 // CHECK-NEXT:     ]
 // CHECK:        }
 
+/// The section name can be quoted.
+.section "@#$-{","n"
+// CHECK:        Section {
+// CHECK-NEXT:     Number:
+// CHECK-NEXT:     Name: @#$-{
 
+// CHECK-NOT:    Section {
 // CHECK:      ]
Index: llvm/lib/MC/MCParser/COFFAsmParser.cpp
===================================================================
--- llvm/lib/MC/MCParser/COFFAsmParser.cpp
+++ llvm/lib/MC/MCParser/COFFAsmParser.cpp
@@ -321,7 +321,7 @@
 }
 
 bool COFFAsmParser::ParseSectionName(StringRef &SectionName) {
-  if (!getLexer().is(AsmToken::Identifier))
+  if (!getLexer().is(AsmToken::Identifier) && !getLexer().is(AsmToken::String))
     return true;
 
   SectionName = getTok().getIdentifier();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82240.272472.patch
Type: text/x-patch
Size: 905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200622/b3da4110/attachment-0001.bin>


More information about the llvm-commits mailing list