]> granicus.if.org Git - clang/commit
Promote -fdebug-compilation-dir from a cc1 flag to clang and clang-cl driver flags
authorNico Weber <nicolasweber@gmx.de>
Mon, 17 Jun 2019 12:10:40 +0000 (12:10 +0000)
committerNico Weber <nicolasweber@gmx.de>
Mon, 17 Jun 2019 12:10:40 +0000 (12:10 +0000)
commit1acf6ad295f4e291e3116f0ad58ee16f7bfd7341
tree937b4b871443e622fb3a96c2bb7f9b94ff1080d7
parent122b86d07433f811fd5e19e64ac8e2826ca33361
Promote -fdebug-compilation-dir from a cc1 flag to clang and clang-cl driver flags

The flag is useful when wanting to create .o files that are independent
from the absolute path to the build directory. -fdebug-prefix-map= can
be used to the same effect, but it requires putting the absolute path
to the build directory on the build command line, so it still requires
the build command line to be dependent on the absolute path of the build
directory. With this flag, "-fdebug-compilation-dir ." makes it so that
both debug info and the compile command itself are independent of the
absolute path of the build directory, which is good for build
determinism (in the sense that the build is independent of which
directory it happens in) and for caching compile results.
(The tradeoff is that the debugger needs explicit configuration to know
the build directory. See also http://dwarfstd.org/ShowIssue.php?issue=171130.2)

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363548 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Driver/CC1Options.td
include/clang/Driver/Options.td
lib/Driver/ToolChains/Clang.cpp
test/Driver/cl-options.c
test/Driver/clang_f_opts.c