Skip to content

Commit b7c10f3

Browse files
committed
Fix .arch_directive emission with 'no' prefix
1 parent 747bb90 commit b7c10f3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7211,12 +7211,13 @@ bool AArch64AsmParser::parseDirectiveArch(SMLoc L) {
72117211
bool AArch64AsmParser::parseDirectiveArchExtension(SMLoc L) {
72127212
SMLoc ExtLoc = getLoc();
72137213

7214-
StringRef Name = getParser().parseStringToEndOfStatement().trim();
7214+
StringRef FullName = getParser().parseStringToEndOfStatement().trim();
72157215

72167216
if (parseEOL())
72177217
return true;
72187218

72197219
bool EnableFeature = true;
7220+
StringRef Name = FullName;
72207221
if (Name.starts_with_insensitive("no")) {
72217222
EnableFeature = false;
72227223
Name = Name.substr(2);
@@ -7237,7 +7238,7 @@ bool AArch64AsmParser::parseDirectiveArchExtension(SMLoc L) {
72377238
FeatureBitset Features = ComputeAvailableFeatures(STI.getFeatureBits());
72387239
setAvailableFeatures(Features);
72397240

7240-
getTargetStreamer().emitDirectiveArchExtension(Name);
7241+
getTargetStreamer().emitDirectiveArchExtension(FullName);
72417242
return false;
72427243
}
72437244

llvm/test/MC/AArch64/arch_directive.s

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
# CHECK-NEXT: .arch armv8-a
66
# CHECK-NEXT: .arch_extension lse
77
# CHECK-NEXT: cas x0, x1, [x2]
8+
# CHECK-NEXT: .arch_extension nolse
89
.text
910
.arch armv8-a+lse
1011
cas x0, x1, [x2]
1112
.arch armv8-a
1213
.arch_extension lse
1314
cas x0, x1, [x2]
15+
.arch_extension nolse

0 commit comments

Comments
 (0)