[all-commits] [llvm/llvm-project] ff9576: [Frontend] Fix -MP when main file is <stdin>

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri Oct 28 20:35:41 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ff9576f74514b836e1ba0268409a2ecb919d7118
      https://github.com/llvm/llvm-project/commit/ff9576f74514b836e1ba0268409a2ecb919d7118
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-10-28 (Fri, 28 Oct 2022)

  Changed paths:
    M clang/lib/Frontend/DependencyFile.cpp
    R clang/test/Frontend/dependency-gen-extradeps-phony.c
    A clang/test/Frontend/dependency-gen-phony.c

  Log Message:
  -----------
  [Frontend] Fix -MP when main file is <stdin>

rC220726 had a bug: `echo "<cstdlib>" | clang -M -MP -x c++ - 2>/dev/null`
(used by glibc/configure.ac find_cxx_header) omitted a `cstdlib:` line. Instead
of filtering out `<stdin>` in `Dependencies`, retain it (so that the number of
entries does not change whether or not main file is `<stdin>`) and filter the
`PhonyTarget` output.




More information about the All-commits mailing list