class IdentifierInfo;
class LangOptions;
class PartialDiagnostic;
+ class Preprocessor;
class SourceRange;
// Import the diagnostic enums themselves.
/// \arg LO - The language options for the source file being processed.
/// \arg PP - The preprocessor object being used for the source; this optional
/// and may not be present, for example when processing AST source files.
- virtual void BeginSourceFile(const LangOptions &LangOpts) {}
+ virtual void BeginSourceFile(const LangOptions &LangOpts,
+ const Preprocessor *PP = 0) {}
/// EndSourceFile - Callback to inform the diagnostic client that processing
/// of a source file has ended. The diagnostic client should assume that any
Secondary.reset(_Secondary);
}
- virtual void BeginSourceFile(const LangOptions &LO) {
- Primary->BeginSourceFile(LO);
- Secondary->BeginSourceFile(LO);
+ virtual void BeginSourceFile(const LangOptions &LO,
+ const Preprocessor *PP) {
+ Primary->BeginSourceFile(LO, PP);
+ Secondary->BeginSourceFile(LO, PP);
}
virtual void EndSourceFile() {
bool OwnsOutputStream = false);
virtual ~TextDiagnosticPrinter();
- void BeginSourceFile(const LangOptions &LO) {
+ void BeginSourceFile(const LangOptions &LO, const Preprocessor *PP) {
LangOpts = &LO;
}
AST->getSourceManager().createMainFileIDForMemBuffer(SB);
// Stream the input AST to the consumer.
- CI.getDiagnostics().getClient()->BeginSourceFile(PP.getLangOptions());
+ CI.getDiagnostics().getClient()->BeginSourceFile(PP.getLangOptions(), &PP);
ParseAST(PP, Consumer.get(), AST->getASTContext(),
CI.getFrontendOpts().ShowStats);
CI.getDiagnostics().getClient()->EndSourceFile();
Clang.createPreprocessor();
// Process the source file.
- Clang.getDiagnostics().getClient()->BeginSourceFile(Clang.getLangOpts());
+ Clang.getDiagnostics().getClient()->BeginSourceFile(Clang.getLangOpts(),
+ &Clang.getPreprocessor());
ProcessInputFile(Clang, InFile, ProgAction);
Clang.getDiagnostics().getClient()->EndSourceFile();
}