Conversation
|
I implemented the dependencies Makefile approach. With "files": {
"/home/simmo/Desktop/goblint-action-test/cmake-project/main.c": [
"/home/simmo/dev/goblint/sv-comp/goblint/_opam/share/goblint/includes/assert.h",
"/home/simmo/Desktop/goblint-action-test/cmake-project/lib/lib.h"
],
"/home/simmo/dev/goblint/sv-comp/goblint/_opam/share/goblint/includes/stdlib.c":
[],
"/home/simmo/Desktop/goblint-action-test/cmake-project/lib/lib.c": [
"/home/simmo/Desktop/goblint-action-test/cmake-project/lib/lib.h"
]
},Doing it in CIL might be a bit more general if we want to analyze already preprocessed programs that contain those line pragmas, because this wouldn't know about those. Although I don't think we should bother because we cannot reasonably handle such programs with GobPie etc anyway: the warning locations would be in possibly nonexistent physical files that were included, not in the physical file that was actually analyzed, so all the output would be a mess anyway. |
|
Looks good! Would this information also be sufficient to make the pre-processing (and potentially parsing into In order to guarantee this, transitive dependencies would probably have to be considered as well... |
I think it should be. The use case in GobPie is somewhat related.
This should cover all includes transitively, because they're inlined transitively during preprocessing, so the corresponding indirect dependency should be direct in this output. |
|
Due to some MagpieBridge oddities this information cannot be used to its true extent in GobPie for the time being. But I'm merging it anyway since it might become useful. |
This reverts commit cf405d8.
This reverts commit 4536c2c.
Adds a list of analyzed (and dependency) files to the json-messages output used by GobPie.
It would be very useful for the latter when using compilation databases to know the list of files that Goblint read from the compilation database and analyzed. Otherwise GobPie would have to unnecessarily duplicate compilation database logic.
Moreover, what this list should also contain is all the dependency files, i.e. included headers (transitively!), because any change to those would also require reanalysis. This however is nontrivial and I currently see two possible ways to go about it:
#lineetc pragma parser to not only change the current location inside its lexer, but record each filename encountered and expose that to Goblint. Just iterating over all locations inside the AST might be insufficient if the header file contains no definitions!-Mto ask it for all dependencies in Makefile format and parse that in Goblint.@michael-schwarz Do you have a preference or any other idea?
TODO