Imagine you have a code, and have changed the precision specification of a real varaible from 'sp' --> 'dp'.
CodeChecker will tell you in how many places this will conflicts when trying to compile.
- An input sources folder with clean modified sources, i.e. sources without comments and split lines (you can run the CodeCleaner to obtain it)
- A vault obtained running MakeVault.py on these sources
- The value of the parameter 'wp'
If the vault is not provided, this script will parse the sources producing one
if vault_path is not None: # Loading vault vault = load_vault(vault_path) else: vault = Vault.Vault(path_to_input_sources)
It load all the files present in the input folder
# Find all files in sources all_sources = BasicFunctions.load_sources(path_to_input_sources)
Then, for every line in a file
- checks if
realvariables are used in subroutine or function calls, and in this case retrieves the called arguments and the dummy arguments (regardless of their intent)
dummy_argument, called_argument = get_real_in_line(line, vault, module.blocks[index], intent=["in", "out", "inout"])
- check the type are consistent
for dummy_arg, called_arg in zip(dummy_argument, called_argument): if dummy_arg.type != called_arg.type: [...]
For the moment when an inconsistency is detected we just print the line. This is because for the moment no inconsistencies have been detected.
# Clean the sources python CodeCleaner.py -i preprocessed_sources_nemo -o clean_preprocessed_sources_nemo # Implement Rpe, which will change all the reals to RPE type, and fix all the functions/sbr calls python ImplementRPEtoSource.py -i clean_preprocessed_sources_nemo -o sourcesWithRPE --output-vault vault_mp.pkl # This step is not needed, just to show MakeVault output can be used as input python MakeVault.py -i sourcesWithRPE -o make_vault.pkl --working-precision 'sp' # Now check that the ImplementRPE did not introduced bugs python CodeChecker.py -i clean_preprocessed_sources_nemo -v make_vault.pkl --working-precision 'sp' Checking file 249/249 zpshde Process finished with exit code 0