[PATCH] D100942: [clang][deps] Include "-cc1" in the arguments
Jan Svoboda via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 22 01:58:06 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG398f25340000: [clang][deps] Include "-cc1" in the arguments (authored by jansvoboda11).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100942/new/
https://reviews.llvm.org/D100942
Files:
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
clang/test/ClangScanDeps/modules-full.cpp
Index: clang/test/ClangScanDeps/modules-full.cpp
===================================================================
--- clang/test/ClangScanDeps/modules-full.cpp
+++ clang/test/ClangScanDeps/modules-full.cpp
@@ -37,6 +37,7 @@
// CHECK-NEXT: ],
// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/Inputs/module.modulemap",
// CHECK-NEXT: "command-line": [
+// CHECK-NEXT: "-cc1",
// CHECK: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap",
// CHECK: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H1]]/header2-{{[A-Z0-9]+}}.pcm",
// CHECK-NOT: "-fimplicit-module-maps",
@@ -53,6 +54,7 @@
// CHECK-NEXT: "clang-module-deps": [],
// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/Inputs/module.modulemap",
// CHECK-NEXT: "command-line": [
+// CHECK-NEXT: "-cc1",
// CHECK-NOT: "-fimplicit-module-maps",
// CHECK: "-fno-implicit-modules",
// CHECK: ],
@@ -67,6 +69,7 @@
// CHECK-NEXT: "clang-module-deps": [],
// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/Inputs/module.modulemap",
// CHECK-NEXT: "command-line": [
+// CHECK-NEXT: "-cc1",
// CHECK-NOT: "-fimplicit-module-maps",
// CHECK: "-fno-implicit-modules",
// CHECK: ],
Index: clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
===================================================================
--- clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
+++ clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
@@ -43,18 +43,13 @@
llvm::BumpPtrAllocator Alloc;
llvm::StringSaver Strings(Alloc);
auto SA = [&Strings](const Twine &Arg) { return Strings.save(Arg).data(); };
- SmallVector<const char *, 32> Args;
- // Synthesize full command line from the CompilerInvocation.
+ // Synthesize full command line from the CompilerInvocation, including "-cc1".
+ SmallVector<const char *, 32> Args{"-cc1"};
CI.generateCC1CommandLine(Args, SA);
// Convert arguments to the return type.
- std::vector<std::string> Ret;
- Ret.reserve(Args.size());
- for (const char *Arg : Args)
- Ret.emplace_back(Arg);
-
- return Ret;
+ return std::vector<std::string>{Args.begin(), Args.end()};
}
std::vector<std::string> ModuleDeps::getFullCommandLine(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100942.339518.patch
Type: text/x-patch
Size: 2371 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210422/df15c2ad/attachment-0001.bin>
More information about the cfe-commits
mailing list