[clang-tools-extra] r349148 - [clangd] Use buildCompilerInvocation to simplify the HeadersTests, NFC.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 14 05:49:00 PST 2018
Author: hokein
Date: Fri Dec 14 05:49:00 2018
New Revision: 349148
URL: http://llvm.org/viewvc/llvm-project?rev=349148&view=rev
Log:
[clangd] Use buildCompilerInvocation to simplify the HeadersTests, NFC.
Modified:
clang-tools-extra/trunk/unittests/clangd/HeadersTests.cpp
Modified: clang-tools-extra/trunk/unittests/clangd/HeadersTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/HeadersTests.cpp?rev=349148&r1=349147&r2=349148&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/HeadersTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/HeadersTests.cpp Fri Dec 14 05:49:00 2018
@@ -44,17 +44,11 @@ private:
auto VFS = FS.getFileSystem();
VFS->setCurrentWorkingDirectory(Cmd->Directory);
- std::vector<const char *> Argv;
- for (const auto &S : Cmd->CommandLine)
- Argv.push_back(S.c_str());
- auto CI = clang::createInvocationFromCommandLine(
- Argv,
- CompilerInstance::createDiagnostics(new DiagnosticOptions(),
- &IgnoreDiags, false),
- VFS);
+ ParseInputs PI;
+ PI.CompileCommand = *Cmd;
+ PI.FS = VFS;
+ auto CI = buildCompilerInvocation(PI);
EXPECT_TRUE(static_cast<bool>(CI));
- CI->getFrontendOpts().DisableFree = false;
-
// The diagnostic options must be set before creating a CompilerInstance.
CI->getDiagnosticOpts().IgnoreWarnings = true;
auto Clang = prepareCompilerInstance(
More information about the cfe-commits
mailing list