diff options
author | Jim Grosbach <grosbach@apple.com> | 2012-06-22 23:56:44 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2012-06-22 23:56:44 +0000 |
commit | 4dbfdfba6c92b6224bf58364371569f5780844d3 (patch) | |
tree | b7661af210cd5e1cdfa22c292241a10e07d70ff6 /include | |
parent | 009f7afbeb77d1cc8e962bac7057b73b6d39d62f (diff) | |
download | external_llvm-4dbfdfba6c92b6224bf58364371569f5780844d3.zip external_llvm-4dbfdfba6c92b6224bf58364371569f5780844d3.tar.gz external_llvm-4dbfdfba6c92b6224bf58364371569f5780844d3.tar.bz2 |
TableGen: AsmMatcher support for better operand diagnostics.
"Invalid operand" may be a completely correct diagnostic, but it's often
insufficiently specific to really help identify and fix the problem in
assembly source. Allow a target to specify a more-specific diagnostic kind
for each AsmOperandClass derived definition and use that to provide
more detailed diagnostics when an operant of that class resulted in a
match failure.
rdar://8987109
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/Target.td | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td index e053ce8..50b30ef 100644 --- a/include/llvm/Target/Target.td +++ b/include/llvm/Target/Target.td @@ -523,6 +523,11 @@ class AsmOperandClass { /// to immediates or registers and are very instruction specific (as flags to /// set in a processor register, coprocessor number, ...). string ParserMethod = ?; + + // The diagnostic type to present when referencing this operand in a + // match failure error message. By default, use a generic "invalid operand" + // diagnostic. The target AsmParser maps these codes to text. + string DiagnosticType = ""; } def ImmAsmOperand : AsmOperandClass { |