From 37b753368238cd25868632960f477d25f973b977 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 17 Jun 2019 12:10:40 +0000 Subject: 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 llvm-svn: 363548 --- clang/test/Driver/cl-options.c | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/test/Driver/cl-options.c') diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c index 4b41720441a..2b71bd044b6 100644 --- a/clang/test/Driver/cl-options.c +++ b/clang/test/Driver/cl-options.c @@ -619,6 +619,7 @@ // RUN: -fno-coverage-mapping \ // RUN: -fdiagnostics-color \ // RUN: -fno-diagnostics-color \ +// RUN: -fdebug-compilation-dir . \ // RUN: -fdiagnostics-parseable-fixits \ // RUN: -fdiagnostics-absolute-paths \ // RUN: -ferror-limit=10 \ -- cgit v1.2.3