Split out operand descriptions.

- cdsl.operands has the Operand and OperandKind classes.
This commit is contained in:
Jakob Stoklund Olesen
2016-11-08 10:58:23 -08:00
parent e6b959436d
commit 19287c1f32
10 changed files with 167 additions and 156 deletions

View File

@@ -4,3 +4,14 @@ Cretonne DSL classes.
This module defines the classes that are used to define Cretonne instructions
and other entitties.
"""
from __future__ import absolute_import
import re
camel_re = re.compile('(^|_)([a-z])')
def camel_case(s):
# type: (str) -> str
"""Convert the string s to CamelCase"""
return camel_re.sub(lambda m: m.group(2).upper(), s)