Skip to content

Commit b0c182f

Browse files
committed
Add CaptureDiagsKind to buildASTFromCodeWithArgs
1 parent f44eaf4 commit b0c182f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

clang/include/clang/Tooling/Tooling.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "clang/AST/ASTConsumer.h"
3333
#include "clang/Basic/FileManager.h"
3434
#include "clang/Basic/LLVM.h"
35+
#include "clang/Frontend/ASTUnit.h"
3536
#include "clang/Frontend/FrontendAction.h"
3637
#include "clang/Frontend/PCHContainerOperations.h"
3738
#include "clang/Tooling/ArgumentsAdjusters.h"
@@ -238,6 +239,7 @@ std::unique_ptr<ASTUnit> buildASTFromCodeWithArgs(
238239
ArgumentsAdjuster Adjuster = getClangStripDependencyFileAdjuster(),
239240
const FileContentMappings &VirtualMappedFiles = FileContentMappings(),
240241
DiagnosticConsumer *DiagConsumer = nullptr,
242+
CaptureDiagsKind CaptureKind = CaptureDiagsKind::None,
241243
IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS =
242244
llvm::vfs::getRealFileSystem());
243245

clang/lib/Tooling/Tooling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ std::unique_ptr<ASTUnit> buildASTFromCodeWithArgs(
692692
StringRef Code, const std::vector<std::string> &Args, StringRef FileName,
693693
StringRef ToolName, std::shared_ptr<PCHContainerOperations> PCHContainerOps,
694694
ArgumentsAdjuster Adjuster, const FileContentMappings &VirtualMappedFiles,
695-
DiagnosticConsumer *DiagConsumer,
695+
DiagnosticConsumer *DiagConsumer, CaptureDiagsKind CaptureKind,
696696
IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) {
697697
std::vector<std::unique_ptr<ASTUnit>> ASTs;
698698
ASTBuilderAction Action(ASTs);

clang/unittests/Tooling/ToolingTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ TEST(buildASTFromCode, FileSystem) {
161161
R"(#include "included_file.h")", {}, "input.cc", "clang-tool",
162162
std::make_shared<PCHContainerOperations>(),
163163
getClangStripDependencyFileAdjuster(), FileContentMappings(), nullptr,
164-
InMemoryFileSystem);
164+
CaptureDiagsKind::None, InMemoryFileSystem);
165165
ASSERT_TRUE(AST.get());
166166
EXPECT_TRUE(FindClassDeclX(AST.get()));
167167
}

0 commit comments

Comments
 (0)