[all-commits] [llvm/llvm-project] 646e50: [clang] add -fmodule-file-home-is-cwd

Richard Howell via All-commits all-commits at lists.llvm.org
Thu May 12 07:28:01 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 646e502de0d854cb3ecaca90ab52bebfe59a40cd
      https://github.com/llvm/llvm-project/commit/646e502de0d854cb3ecaca90ab52bebfe59a40cd
  Author: Richard Howell <rhow at fb.com>
  Date:   2022-05-12 (Thu, 12 May 2022)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/Lex/HeaderSearchOptions.h
    M clang/lib/Serialization/ASTWriter.cpp
    A clang/test/Modules/module-file-home-is-cwd.m

  Log Message:
  -----------
  [clang] add -fmodule-file-home-is-cwd

This diff adds a new frontend flag `-fmodule-file-home-is-cwd`.
The behavior of this flag is similar to
`-fmodule-map-file-home-is-cwd` but does not require the module
map files to be modified to have inputs relative to the cwd.
Instead the output modules will have their `BaseDirectory` set
to the cwd and will try and resolve paths relative to that.

The motiviation for this change is to support relocatable pcm
files that are built on different machines with different paths
without having to alter module map files, which is sometimes not
possible as they are provided by 3rd parties.

Reviewed By: urnathan

Differential Revision: https://reviews.llvm.org/D124874




More information about the All-commits mailing list