Hello !I am currently investigating tools for C instrumentation for the purpose ofcoverage analysis.The tricky aspect of it definitely seems to be how to deal with thepreprocessing phase.There is mostly one question that comes to my mind, and after a bit ofresearch (on this mailing list) I did not find a satisfying answer.Let's say I want to support multiple compilers.I don't think I can preprocess the sources with the other compiler, thenparse them with clang, and evenif this would be possible, I think I would be losing too much informationabout macro expansion for example. So I will probably need to configure theClang preprocessor to modify where it looks for the include files, to usethe one of the compiler in use. Though, I fear having parsing problem withthis approach (the included code might be compiler-specific or might callsome built-ins that clang does not provide, as they mention here<https://urldefense.com/v3/__http://clang-developers.42468.n3.nabble.com/clangd-libclang-how-to-emulate-other-compilers-td4060396.html__;!!DZ3fjg!oYyNZWy85HqnM8DKf4CNyQxWHu22NpNC9b6dGCqoXU_Qz6hfLcijImHULzajXvwovos$ >).I also fear that running a different preprocessor (clang's) than the one ofthe compiler in use may result in altering the program semantics (does everypreprocessor implements macro expansion the same way?).By any chance, do you have any idea how existing coverage tools may dealwith this matter? Are there corner cases where instrumentation may beslightly off because of that?Thank you if you took the time to read / answerMatthieu Eyraud
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev