Fix Python formatting to keep flake8 happy.
Python coding style is verified by the lib/cretonne/meta/check.sh script which is not run as part of test-all.sh. cc @dinfuehr
This commit is contained in:
@@ -273,9 +273,18 @@ def gen_opcodes(groups, fmt):
|
|||||||
|
|
||||||
with fmt.indented('impl Opcode {', '}'):
|
with fmt.indented('impl Opcode {', '}'):
|
||||||
attrs = [
|
attrs = [
|
||||||
{ 'name': 'is_branch', 'comment': 'True for all branch instructions.' },
|
{
|
||||||
{ 'name': 'is_terminator', 'comment': 'True for instructions that terminate EBB.' },
|
'name': 'is_branch',
|
||||||
{ 'name': 'can_trap', 'comment': 'True if instruction could trap.' }
|
'comment': 'True for all branch instructions.'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'is_terminator',
|
||||||
|
'comment': 'True for instructions that terminate EBB.'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'can_trap',
|
||||||
|
'comment': 'True if instruction could trap.'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
for attr in attrs:
|
for attr in attrs:
|
||||||
@@ -288,7 +297,9 @@ def gen_opcodes(groups, fmt):
|
|||||||
with fmt.indented('match self {', '}'):
|
with fmt.indented('match self {', '}'):
|
||||||
for i in instrs:
|
for i in instrs:
|
||||||
if getattr(i, attr['name']):
|
if getattr(i, attr['name']):
|
||||||
fmt.format('Opcode::{} => true,', i.camel_name, i.name)
|
fmt.format(
|
||||||
|
'Opcode::{} => true,',
|
||||||
|
i.camel_name, i.name)
|
||||||
|
|
||||||
fmt.line('_ => false')
|
fmt.line('_ => false')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user