diff --git a/op-summarizer/gcovreader.py b/op-summarizer/gcovreader.py index 097a777..17c7cc9 100644 --- a/op-summarizer/gcovreader.py +++ b/op-summarizer/gcovreader.py @@ -27,13 +27,16 @@ class GCovFile: lines: List[GCovLine] = [] for line in file["lines"]: - if len(line["branches"]): - # GCov reports branches in reverse order to our parser. - branch_number = len(line["branches"]) - for branch in line["branches"]: - lines.append(GCovLine(line["line_number"], branch["count"], branch_number)) - branch_number -= 1 - else: - lines.append(GCovLine(line["line_number"], line["count"])) + lines.append(GCovLine(line["line_number"], line["count"])) + + # Branch specific identification. TODO! later. + #if len(line["branches"]): + # # GCov reports branches in reverse order to our parser. + # branch_number = len(line["branches"]) + # for branch in line["branches"]: + # lines.append(GCovLine(line["line_number"], branch["count"], branch_number)) + # branch_number -= 1 + #else: + # lines.append(GCovLine(line["line_number"], line["count"]))) self.files[name] = lines diff --git a/op-summarizer/opsummarizer.py b/op-summarizer/opsummarizer.py index a1be312..303ddb7 100644 --- a/op-summarizer/opsummarizer.py +++ b/op-summarizer/opsummarizer.py @@ -17,6 +17,8 @@ class OpSummarizer: def count_operations(self, file: str) -> Dict[UniqueOperation, int]: if file not in self.gcov.files or file not in self.ops.files: + print(f"Gcov files: {self.gcov.files.keys()}") + print(f"Opfinder files: {self.ops.files.keys()}") raise RuntimeError(f"File {file} not in both parsers.") op_counter: Dict[UniqueOperation, int] = {} @@ -26,8 +28,8 @@ class OpSummarizer: for op_log in op_lines: # TODO: revise this. Need a special case for for-loop clauses # or branching in general. - if op_log.branch_number != gcov_line.branch_number: - continue + #if op_log.branch_number != gcov_line.branch_number: + # continue unique_op = op_log.entry