From 961597c764419d97c4ac586fa971e3a0d2cffa22 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 25 Nov 2019 13:58:31 +0100 Subject: codegen/generate-dfa-benchmark: Support measurement of getEnergy call --- bin/generate-dfa-benchmark.py | 4 ++++ lib/codegen.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py index 429703b..76c1f77 100755 --- a/bin/generate-dfa-benchmark.py +++ b/bin/generate-dfa-benchmark.py @@ -381,6 +381,10 @@ if __name__ == '__main__': repo = Repo('/home/derf/var/projects/multipass/build/repo.acp') + if 'accounting' in opt and 'getEnergy' not in map(lambda x: x.name, pta.transitions): + for state in pta.get_state_names(): + pta.add_transition(state, state, 'getEnergy') + pta.set_random_energy_model() if 'accounting' in opt: diff --git a/lib/codegen.py b/lib/codegen.py index 45ae8f7..45a6871 100644 --- a/lib/codegen.py +++ b/lib/codegen.py @@ -7,6 +7,8 @@ header_template = """ #ifndef DFATOOL_{name}_H #define DFATOOL_{name}_H +#include "stdint.h" + {includes} class {name} @@ -486,6 +488,9 @@ class MultipassDriver: for transition in self.pta.get_unique_transitions(): + if transition.name == 'getEnergy': + continue + # XXX right now we only verify whether both functions have the # same number of arguments. This breaks in many overloading cases. function_info = self.class_info.function[transition.name] -- cgit v1.2.3