зеркало из https://github.com/microsoft/clang-1.git
[libclang] Indexing API: Capture diagnostics during indexing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145228 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
5c00fc309b
Коммит
991bf49f68
|
@ -628,7 +628,8 @@ public:
|
|||
|
||||
/// \brief Create a ASTUnit. Gets ownership of the passed CompilerInvocation.
|
||||
static ASTUnit *create(CompilerInvocation *CI,
|
||||
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags);
|
||||
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
|
||||
bool CaptureDiagnostics = false);
|
||||
|
||||
/// \brief Create a ASTUnit from an AST file.
|
||||
///
|
||||
|
|
|
@ -1632,10 +1632,11 @@ StringRef ASTUnit::getMainFileName() const {
|
|||
}
|
||||
|
||||
ASTUnit *ASTUnit::create(CompilerInvocation *CI,
|
||||
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags) {
|
||||
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
|
||||
bool CaptureDiagnostics) {
|
||||
llvm::OwningPtr<ASTUnit> AST;
|
||||
AST.reset(new ASTUnit(false));
|
||||
ConfigureDiags(Diags, 0, 0, *AST, /*CaptureDiagnostics=*/false);
|
||||
ConfigureDiags(Diags, 0, 0, *AST, CaptureDiagnostics);
|
||||
AST->Diagnostics = Diags;
|
||||
AST->Invocation = CI;
|
||||
AST->FileSystemOpts = CI->getFileSystemOpts();
|
||||
|
|
|
@ -317,7 +317,8 @@ static void clang_indexSourceFile_Impl(void *UserData) {
|
|||
if (!requestedToGetTU)
|
||||
CInvok->getPreprocessorOpts().DetailedRecord = false;
|
||||
|
||||
ASTUnit *Unit = ASTUnit::create(CInvok.getPtr(), Diags);
|
||||
ASTUnit *Unit = ASTUnit::create(CInvok.getPtr(), Diags,
|
||||
/*CaptureDiagnostics=*/true);
|
||||
llvm::OwningPtr<CXTUOwner> CXTU(new CXTUOwner(MakeCXTranslationUnit(Unit)));
|
||||
|
||||
// Recover resources if we crash before exiting this method.
|
||||
|
|
Загрузка…
Ссылка в новой задаче