Changeset View
Changeset View
Standalone View
Standalone View
include/clang/Frontend/ASTUnit.h
Show First 20 Lines • Show All 432 Lines • ▼ Show 20 Lines | public: | ||||
std::shared_ptr<Preprocessor> getPreprocessorPtr() const { return PP; } | std::shared_ptr<Preprocessor> getPreprocessorPtr() const { return PP; } | ||||
const ASTContext &getASTContext() const { return *Ctx; } | const ASTContext &getASTContext() const { return *Ctx; } | ||||
ASTContext &getASTContext() { return *Ctx; } | ASTContext &getASTContext() { return *Ctx; } | ||||
void setASTContext(ASTContext *ctx) { Ctx = ctx; } | void setASTContext(ASTContext *ctx) { Ctx = ctx; } | ||||
void setPreprocessor(std::shared_ptr<Preprocessor> pp); | void setPreprocessor(std::shared_ptr<Preprocessor> pp); | ||||
/// Enable source-range based diagnostic messages. | |||||
/// | |||||
/// If diagnostic messages with source-range information are to be expected | |||||
/// and AST comes not from file (e.g. after LoadFromCompilerInvocation) this | |||||
/// function has to be called. | |||||
/// The function is to be called only once and the AST should be associated | |||||
/// with the same source file afterwards. | |||||
void enableSourceFileDiagnostics(); | |||||
bool hasSema() const { return (bool)TheSema; } | bool hasSema() const { return (bool)TheSema; } | ||||
Sema &getSema() const { | Sema &getSema() const { | ||||
assert(TheSema && "ASTUnit does not have a Sema object!"); | assert(TheSema && "ASTUnit does not have a Sema object!"); | ||||
return *TheSema; | return *TheSema; | ||||
} | } | ||||
const LangOptions &getLangOpts() const { | const LangOptions &getLangOpts() const { | ||||
▲ Show 20 Lines • Show All 435 Lines • Show Last 20 Lines |