ASTContext &getASTContext() { return *Ctx; }
void setASTContext(ASTContext *ctx) { Ctx = ctx; }
+ void setPreprocessor(Preprocessor *pp);
bool hasSema() const { return TheSema; }
Sema &getSema() const {
}
}
+void ASTUnit::setPreprocessor(Preprocessor *pp) { PP = pp; }
+
/// \brief Determine the set of code-completion contexts in which this
/// declaration should be shown.
static unsigned getDeclShowContexts(NamedDecl *ND,
IndexCtx.setASTContext(CI.getASTContext());
Preprocessor &PP = CI.getPreprocessor();
PP.addPPCallbacks(new IndexPPCallbacks(PP, IndexCtx));
+ IndexCtx.setPreprocessor(PP);
return new IndexingConsumer(IndexCtx);
}
static_cast<ASTUnit*>(CXTU->TUData)->setASTContext(&ctx);
}
+void IndexingContext::setPreprocessor(Preprocessor &PP) {
+ static_cast<ASTUnit*>(CXTU->TUData)->setPreprocessor(&PP);
+}
+
bool IndexingContext::shouldAbort() {
if (!CB.abortQuery)
return false;
ASTContext &getASTContext() const { return *Ctx; }
void setASTContext(ASTContext &ctx);
+ void setPreprocessor(Preprocessor &PP);
bool suppressRefs() const {
return IndexOptions & CXIndexOpt_SuppressRedundantRefs;