forked from OSchip/llvm-project
[clangd] Use buildCompilerInvocation to simplify the HeadersTests, NFC.
llvm-svn: 349148
This commit is contained in:
parent
02c8343c75
commit
941ce02deb
|
@ -44,17 +44,11 @@ private:
|
||||||
auto VFS = FS.getFileSystem();
|
auto VFS = FS.getFileSystem();
|
||||||
VFS->setCurrentWorkingDirectory(Cmd->Directory);
|
VFS->setCurrentWorkingDirectory(Cmd->Directory);
|
||||||
|
|
||||||
std::vector<const char *> Argv;
|
ParseInputs PI;
|
||||||
for (const auto &S : Cmd->CommandLine)
|
PI.CompileCommand = *Cmd;
|
||||||
Argv.push_back(S.c_str());
|
PI.FS = VFS;
|
||||||
auto CI = clang::createInvocationFromCommandLine(
|
auto CI = buildCompilerInvocation(PI);
|
||||||
Argv,
|
|
||||||
CompilerInstance::createDiagnostics(new DiagnosticOptions(),
|
|
||||||
&IgnoreDiags, false),
|
|
||||||
VFS);
|
|
||||||
EXPECT_TRUE(static_cast<bool>(CI));
|
EXPECT_TRUE(static_cast<bool>(CI));
|
||||||
CI->getFrontendOpts().DisableFree = false;
|
|
||||||
|
|
||||||
// The diagnostic options must be set before creating a CompilerInstance.
|
// The diagnostic options must be set before creating a CompilerInstance.
|
||||||
CI->getDiagnosticOpts().IgnoreWarnings = true;
|
CI->getDiagnosticOpts().IgnoreWarnings = true;
|
||||||
auto Clang = prepareCompilerInstance(
|
auto Clang = prepareCompilerInstance(
|
||||||
|
|
Loading…
Reference in New Issue