Skip to content

Commit

Permalink
Add BCFileExtension for AST based blame
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonievonMann committed Jun 17, 2024
1 parent f4464bf commit 8fae327
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion varats-core/varats/experiment/wllvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class BCFileExtensions(Enum):
OPT = 'O2'
TBAA = "TBAA"
FEATURE = 'feature'
BLAME = "blame"
BLAME = 'blame'
BLAME_AST = 'blame_ast'

def __lt__(self, other: tp.Any) -> bool:
if isinstance(other, BCFileExtensions):
Expand Down
13 changes: 7 additions & 6 deletions varats/varats/experiments/vara/blame_ast_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ class BlameAnnotationGeneration(actions.ProjectStep): #type: ignore

project: VProject

def __init__(self, project: Project, experiment_handle: ExperimentHandle):
def __init__(
self, project: Project, experiment_handle: ExperimentHandle,
file_extensions: list[BCFileExtensions]
):
super().__init__(project=project)
self.__experiment_handle = experiment_handle
self.__file_extensions = file_extensions

def __call__(self) -> actions.StepResult:
return self.analyze()
Expand Down Expand Up @@ -79,10 +83,7 @@ def analyze(self) -> actions.StepResult:
get_local_project_git_paths(self.project.name).items()
]), "-vara-use-phasar", f"-vara-report-outfile={result_file}",
get_cached_bc_file_path(
self.project, binary, [
BCFileExtensions.NO_OPT, BCFileExtensions.TBAA,
BCFileExtensions.BLAME
]
self.project, binary, self.__file_extensions
)
]

Expand Down Expand Up @@ -225,7 +226,7 @@ def actions_for_project(
bc_file_extensions = [
BCFileExtensions.NO_OPT,
BCFileExtensions.TBAA,
BCFileExtensions.BLAME,
BCFileExtensions.BLAME_AST,
]

BE.setup_basic_blame_experiment(self, project, BA)
Expand Down

0 comments on commit 8fae327

Please sign in to comment.