[cfe-commits] r145228 - in /cfe/trunk: include/clang/Frontend/ASTUnit.h lib/Frontend/ASTUnit.cpp tools/libclang/Indexing.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Sun Nov 27 20:55:55 PST 2011
Author: akirtzidis
Date: Sun Nov 27 22:55:55 2011
New Revision: 145228
URL: http://llvm.org/viewvc/llvm-project?rev=145228&view=rev
Log:
[libclang] Indexing API: Capture diagnostics during indexing.
Modified:
cfe/trunk/include/clang/Frontend/ASTUnit.h
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/tools/libclang/Indexing.cpp
Modified: cfe/trunk/include/clang/Frontend/ASTUnit.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ASTUnit.h?rev=145228&r1=145227&r2=145228&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/ASTUnit.h (original)
+++ cfe/trunk/include/clang/Frontend/ASTUnit.h Sun Nov 27 22:55:55 2011
@@ -628,7 +628,8 @@
/// \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.
///
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=145228&r1=145227&r2=145228&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Sun Nov 27 22:55:55 2011
@@ -1632,10 +1632,11 @@
}
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();
Modified: cfe/trunk/tools/libclang/Indexing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/Indexing.cpp?rev=145228&r1=145227&r2=145228&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/Indexing.cpp (original)
+++ cfe/trunk/tools/libclang/Indexing.cpp Sun Nov 27 22:55:55 2011
@@ -317,7 +317,8 @@
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.
More information about the cfe-commits
mailing list