Skip to content

Commit 5d24d1f

Browse files
committed
UF: add file utility for analysis-digest file
1 parent bf450d3 commit 5d24d1f

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

chc/util/fileutil.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# Copyright (c) 2017-2020 Kestrel Technology LLC
88
# Copyright (c) 2020-2022 Henny B. Sipma
9-
# Copyright (c) 2023-2024 Aarno Labs LLC
9+
# Copyright (c) 2023-2025 Aarno Labs LLC
1010
#
1111
# Permission is hereby granted, free of charge, to any person obtaining a copy
1212
# of this software and associated documentation files (the "Software"), to deal
@@ -1331,6 +1331,30 @@ def get_spo_xnode(
13311331
filename, "function", "Secondary proof obligations file", show=False)
13321332

13331333

1334+
def get_adg_filename(
1335+
targetpath: str,
1336+
projectname: str,
1337+
cfilepath: Optional[str],
1338+
cfilename: str,
1339+
fnname: str) -> str:
1340+
fnpath = get_cfile_fnpath(
1341+
targetpath, projectname, cfilepath, cfilename, fnname)
1342+
filename = get_fn_composite(cfilename, fnname, "adg")
1343+
return os.path.join(fnpath, filename)
1344+
1345+
1346+
def get_adg_xnode(
1347+
targetpath: str,
1348+
projectname: str,
1349+
cfilepath: Optional[str],
1350+
cfilename: str,
1351+
fnname: str) -> Optional[ET.Element]:
1352+
filename = get_adg_filename(
1353+
targetpath, projectname, cfilepath, cfilename, fnname)
1354+
return get_xnode(
1355+
filename, "function", "Analysis digests file", show=False)
1356+
1357+
13341358
def save_spo_file(
13351359
targetpath: str,
13361360
projectname: str,

0 commit comments

Comments
 (0)