[all-commits] [llvm/llvm-project] cead90: [clang-scan-deps] Don't inspect Args[0] as an opti...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Thu Sep 19 10:46:31 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cead9044a995910306e2e64b426fcc8042d7e0ef
      https://github.com/llvm/llvm-project/commit/cead9044a995910306e2e64b426fcc8042d7e0ef
  Author: Martin Storsjö <martin at martin.st>
  Date:   2024-09-19 (Thu, 19 Sep 2024)

  Changed paths:
    M clang/tools/clang-scan-deps/ClangScanDeps.cpp

  Log Message:
  -----------
  [clang-scan-deps] Don't inspect Args[0] as an option (#109050)

Since a26ec542371652e1d774696e90016fd5b0b1c191, we expand the executable
name to an absolute path, if it isn't already one, if found in path.

This broke a couple tests in some environments; when the clang workdir
resides in a path under e.g. /opt. Tests that only use a tool name like
"clang-cl" would get expanded to the absolute path in the build tree.
The loop for finding the last "-o" like option for clang-cl command
lines would inspect all arguments, including Args[0] which is the
executable name itself. As an /opt path matches Arg.starts_with("/o"),
this would get detected as an object file output name in cases where
there was no other explicit output argument.

Thus, this fixes those tests in workdirs under e.g. /opt.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list