Revision be6cdf67 lib/opcodes_base.py
b/lib/opcodes_base.py | ||
---|---|---|
94 | 94 |
return "_".join(n.upper() for n in _NameComponents(name)) |
95 | 95 |
|
96 | 96 |
|
97 |
def NameToReasonSrc(name): |
|
97 |
def NameToReasonSrc(name, prefix):
|
|
98 | 98 |
"""Convert an opcode class name to a source string for the reason trail |
99 | 99 |
|
100 | 100 |
@type name: string |
101 | 101 |
@param name: the class name, as OpXxxYyy |
102 |
@type prefix: string |
|
103 |
@param prefix: the prefix that will be prepended to the opcode name |
|
102 | 104 |
@rtype: string |
103 | 105 |
@return: the name in the OP_XXXX_YYYY format |
104 | 106 |
|
105 | 107 |
""" |
106 | 108 |
if not name.startswith("Op"): |
107 | 109 |
return None |
108 |
return "%s:%s" % (constants.OPCODE_REASON_SRC_OPCODE,
|
|
110 |
return "%s:%s" % (prefix,
|
|
109 | 111 |
"_".join(n.lower() for n in _NameComponents(name))) |
110 | 112 |
|
111 | 113 |
|
Also available in: Unified diff