diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2025-04-14 15:46:54 +0100 |
---|---|---|
committer | Richard Earnshaw <rearnsha@arm.com> | 2025-05-08 13:22:35 +0100 |
commit | 62dec5d9f60a0207c3c9147ceb8d4f7281e3fa80 (patch) | |
tree | 7120d153b47d4e8d0558d5e90933ea326f6f994e /libcpp/files.cc | |
parent | f260146bc05f6fba7b2a67a62063c770588b769d (diff) | |
download | gcc-62dec5d9f60a0207c3c9147ceb8d4f7281e3fa80.zip gcc-62dec5d9f60a0207c3c9147ceb8d4f7281e3fa80.tar.gz gcc-62dec5d9f60a0207c3c9147ceb8d4f7281e3fa80.tar.bz2 |
gensupport: validate compact constraint modifiers
For constraints there are operand modifiers and constraint qualifiers.
Operand modifiers apply to all alternatives and must appear, in
traditional syntax before the first alternative. Constraint
qualifiers, on the other hand must appear in each alternative to which
they apply.
There's no easy way to validate the distinction in the traditional md
format, but when using the new compact format we can enforce some
semantic checking of these characters to avoid some potentially
surprising code generation.
gcc/
* gensupport.cc (conlist::conlist): Pass a location to the constructor.
Only allow skipping of non-alpha-numeric characters when parsing a
number and only allow '=', '+' or '%'. Add some error checking when
parsing an operand number.
(parse_section_layout): Pass the location to the conlist constructor.
(parse_section): Allow an optional list of forbidden characters.
If specified, reject strings containing them.
(convert_syntax): Reject '=', '+' or '%' in an alternative.
Diffstat (limited to 'libcpp/files.cc')
0 files changed, 0 insertions, 0 deletions