[MCParser] Support quoted section name for COFF

This features matches ELFAsmParser and makes it possible to use `.section ".llvm.call-graph-profile","n"`

Reviewed By: zequanwu

Differential Revision: https://reviews.llvm.org/D82240
This commit is contained in:
Fangrui Song 2020-06-22 09:11:44 -07:00 committed by Fangrui Song
parent 9c56e94a9f
commit c52bee61e9
2 changed files with 7 additions and 1 deletions

View File

@ -321,7 +321,7 @@ bool COFFAsmParser::ParseSectionSwitch(StringRef Section,
}
bool COFFAsmParser::ParseSectionName(StringRef &SectionName) {
if (!getLexer().is(AsmToken::Identifier))
if (!getLexer().is(AsmToken::Identifier) && !getLexer().is(AsmToken::String))
return true;
SectionName = getTok().getIdentifier();

View File

@ -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: ]