[PATCH] D129607: [clang][deps] Fix handling of -MT in module command-line

Ben Langmuir via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 12 17:32:54 PDT 2022


benlangmuir created this revision.
benlangmuir added a reviewer: jansvoboda11.
Herald added a subscriber: mgorny.
Herald added a project: All.
benlangmuir requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

Follow-up to 6626f6fec3d3 <https://reviews.llvm.org/rG6626f6fec3d37b78b628b858bdadbbb8301e1a2f>, this fixes the handling of `-MT`

- If no targets are provided, we need to invent one since `cc1` expects the driver to have handled it. The default is to use `-o`, quoting as necessary for a make target.
- Fix the splitting for empty string, which was incorrectly treated as `{""}` instead of `{}`.
- Add a way to test this behaviour in clang-scan-deps.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129607

Files:
  clang/include/clang/Basic/MakeSupport.h
  clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
  clang/lib/Basic/CMakeLists.txt
  clang/lib/Basic/MakeSupport.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
  clang/test/ClangScanDeps/generate-modules-path-args.c
  clang/tools/clang-scan-deps/ClangScanDeps.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129607.444119.patch
Type: text/x-patch
Size: 10199 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220713/1455c1b6/attachment-0001.bin>


More information about the cfe-commits mailing list