dwarflang.fold module¶
Naive constant folding for the DWARFv4 expression language AST.
TODO: Boolean logic?
- class dwarflang.fold.Op(value)¶
Bases:
enum.Enum
An enumeration.
- ADD = <built-in function add>¶
- SUB = <built-in function sub>¶
- dwarflang.fold.constant_fold(instructions: List[dwarflang.ast.DwarfInstr]) List[dwarflang.ast.DwarfInstr] ¶
Naive constant folding for the DWARFv4 expression language AST.
TODO: Apply local folds in a sliding window
- Parameters
instructions (List[dwarflang.ast.DwarfInstr]) –
- Return type
List[dwarflang.ast.DwarfInstr]