Generalize handling of .d files: Accept .d files with multiple targets, eat -MF arguments to preprocessor#557
Generalize handling of .d files: Accept .d files with multiple targets, eat -MF arguments to preprocessor#557michael-schwarz wants to merge 3 commits intomasterfrom
.d files: Accept .d files with multiple targets, eat -MF arguments to preprocessor#557Conversation
|
What type of files does this happen for? I'm thinking maybe we should instead of #530 only include |
|
It is a perfectly normal |
|
I think then we should actually add support such that |
|
I think we might have misunderstood each other. What happens is: |
|
Oh, I see what the real problem is there: the command line already provides some |
.d file if there is no .d file for an entry in the compilation database.d files: Accept .d files with multiple targets, eat -MF arguments to preprocessor
|
Now, we try to fix the call to the compiler if it contains |
|
I'm starting to doubt this approach. You added The extended Makefile parsing is also becoming more of a hack because the command line still contains other All these I think the other approach I suggested in #535 would be much more robust and less error-prone: extend |
I am a bit skeptical whether this is the general solution it appears to be though: If a header file itself contains no declarations but only includes other header files, we would not see it in this process at all. However, if this file changes to now include different things, we would have to re-run the preprocessor anyway. Or am I missing something here? |
Why not? If something is included, there will be a What wouldn't work is iterating over all the globals in the preprocessed file and collecting the filenames from their locations. |
|
The case that I was worried about was the one similar to the following one. File #include "1.h"
int main() {
int i =0;
int j = 0;
for(; i<5; i++) {
j += i*i;
}
assert(i == 5);
}File #include "2.h"File int blarg();Since But apparently it does: |
|
Closing in favor of #587. |
Skip instead of failing if there is no
.dfile for some entry in the compilation database.Needed for goblint/bench#9 after #535