[cgen] suggestion: improve error message
DJ Delorie
dj@redhat.com
Sat Oct 22 00:08:00 GMT 2005
If you use the wrong operand in an insn, you get a vague "assert:
indx" error. This replaces it with a (hopefully) more instructive
message, hopefully allowing you to *find* the error.
* operand.scm (-anyof-merge-syntax): Print a more useful error
message.
Index: operand.scm
===================================================================
RCS file: /cvs/src/src/cgen/operand.scm,v
retrieving revision 1.11
diff -p -U3 -r1.11 operand.scm
--- operand.scm 29 Jul 2005 18:51:24 -0000 1.11
+++ operand.scm 22 Oct 2005 00:04:39 -0000
@@ -1120,7 +1120,9 @@
(if (anyof-operand? e)
(let* ((name (obj:name e))
(indx (element-lookup-index name value-names 0)))
- (assert indx)
+ (if (not indx)
+ (error "Name " name " not one of " values)
+ )
(-anyof-syntax (list-ref values indx)))
e))
syntax-elements)))
More information about the Binutils
mailing list