[PATCH] D60569: Return error on unsupported feature and exit
Brandon Jones via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 11 09:10:52 PDT 2019
BrandonTJones created this revision.
BrandonTJones added reviewers: andreadb, grosbach.
Herald added subscribers: hiraditya, kristof.beyls, javed.absar.
Herald added a project: LLVM.
Within the AARCH64 Asm Parser we currently fatally exit the assembler when given a feature that exists but isn't yet supported. This change simply allows the exit to be cleaner and without a crash.
Repository:
rL LLVM
https://reviews.llvm.org/D60569
Files:
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/test/MC/AsmParser/AArch64/directive-feature.s
Index: llvm/test/MC/AsmParser/AArch64/directive-feature.s
===================================================================
--- /dev/null
+++ llvm/test/MC/AsmParser/AArch64/directive-feature.s
@@ -0,0 +1,5 @@
+# RUN: not llvm-mc -triple aarch64 %s 2>&1 > /dev/null| FileCheck %s --check-prefix=CHECK-ERROR
+
+# CHECK-ERROR: error: unsupported architectural extension: dummy_extension
+TEST1:
+ .arch v8+dummy_extension
Index: llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
===================================================================
--- llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -2815,6 +2815,8 @@
const char *Name;
const FeatureBitset Features;
} ExtensionMap[] = {
+ {"dummy_extension",
+ {}}, // This is a dummy extension used for testing error outputs.
{"crc", {AArch64::FeatureCRC}},
{"sm4", {AArch64::FeatureSM4}},
{"sha3", {AArch64::FeatureSHA3}},
@@ -5142,7 +5144,7 @@
continue;
if (Extension.Features.none())
- report_fatal_error("unsupported architectural extension: " + Name);
+ return Error(ArchLoc, "unsupported architectural extension: " + Name);
FeatureBitset ToggleFeatures = EnableFeature
? (~Features & Extension.Features)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60569.194706.patch
Type: text/x-patch
Size: 1354 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190411/a9e062ea/attachment.bin>
More information about the llvm-commits
mailing list