summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorOliver Stannard <oliver.stannard@arm.com>2017-10-03 14:34:57 +0000
committerOliver Stannard <oliver.stannard@arm.com>2017-10-03 14:34:57 +0000
commit41dfac3eb2f74339ed4a56211c91d7902453624d (patch)
tree2913d4ff23fdc02fec04a59731a94e4d183181ed /llvm/include
parent085a23f1872ad7e2fdf64fdea3356606c9318268 (diff)
downloadbcm5719-llvm-41dfac3eb2f74339ed4a56211c91d7902453624d.tar.gz
bcm5719-llvm-41dfac3eb2f74339ed4a56211c91d7902453624d.zip
[AsmParser] Add DiagnosticString to AsmOperands in tablegen
This adds a DiagnosticString member to the AsmOperand tablegen class, so that the diagnostic text to be used when an assembly operand is incorrect can be stored in the tablegen description of the operand, rather than in a separate switch statement in the AsmParser. If DiagnosticString is used for any operands, tablegen will emit a getMatchKindDiag function, to map from diagnostic enums to strings. Differential revision: https://reviews.llvm.org/D31606 llvm-svn: 314803
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Target/Target.td4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/include/llvm/Target/Target.td b/llvm/include/llvm/Target/Target.td
index b2b1d274f0d..62072dba807 100644
--- a/llvm/include/llvm/Target/Target.td
+++ b/llvm/include/llvm/Target/Target.td
@@ -677,6 +677,10 @@ class AsmOperandClass {
// diagnostic. The target AsmParser maps these codes to text.
string DiagnosticType = "";
+ /// A diagnostic message to emit when an invalid value is provided for this
+ /// operand.
+ string DiagnosticString = "";
+
/// Set to 1 if this operand is optional and not always required. Typically,
/// the AsmParser will emit an error when it finishes parsing an
/// instruction if it hasn't matched all the operands yet. However, this
OpenPOWER on IntegriCloud