[cfe-dev] PPCallbacks::InclusionDirective and included headers that are not found

Farzad Sadeghi via cfe-dev cfe-dev at lists.llvm.org
Tue Dec 27 11:42:01 PST 2016


The ASTFrontendAction I'm implementing also adds some PPCallbacks. One
of the ones im using right now is InclusionDirective. How i can check
whether an inclusion directive has been successull? I did try
Module::IsAvailable and FileEntry::IsValid but they dont seem to be
what I think they are.  using those two will result in the code
breaking just the same(the code exits with a seg fault since there are
pointer objects poiting to random to places because the inclusion
directive could not be found, but thats not the issue).
My first question is how can i check for a header file actually
existing in a PPCallback?
clang does throw an error if the preprocessor callback is not included
in the code which results in breaking the code if a header is not
found, which brings me to my second question.
Do the PPCallbacks registered for a FrontendAction run before the
DiagnosticsManager or in paralel?

-- 
Farzad Sadeghi



More information about the cfe-dev mailing list