[all-commits] [llvm/llvm-project] 26fa9e: Add support to find out resource dir and add it as...
Kousik Kumar via All-commits
all-commits at lists.llvm.org
Fri Nov 22 07:44:03 PST 2019
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 26fa9e31f58a7ff693f3a5d8c2eb1b6a5a13b133
https://github.com/llvm/llvm-project/commit/26fa9e31f58a7ff693f3a5d8c2eb1b6a5a13b133
Author: Kousik Kumar <kousikk at google.com>
Date: 2019-11-22 (Fri, 22 Nov 2019)
Changed paths:
M clang/tools/clang-scan-deps/ClangScanDeps.cpp
Log Message:
-----------
Add support to find out resource dir and add it as compilation args
Summary:
If -resource-dir is not specified as part of the compilation command, then by default
clang-scan-deps picks up a directory relative to its own path as resource-directory.
This is probably not the right behavior - since resource directory should be picked relative
to the path of the clang-compiler in the compilation command.
This patch adds support for it along with a cache to store the resource-dir paths based on
compiler paths.
Notes:
1. "-resource-dir" is a behavior that's specific to clang, gcc does not have that flag. That's why if I'm not able to find a resource-dir, I quietly ignore it.
2. Should I also use the mtime of the compiler in the cache? I think its not strictly necessary since we assume the filesystem is immutable.
3. From my testing, this does not regress performance.
4. Will try to get this tested on Windows.
But basically the problem that this patch is trying to solve is, clients might not always want to specify
"-resource-dir" in their compile commands, so scan-deps must auto-infer it correctly.
Reviewers: arphaman, Bigcheese, jkorous, dexonsmith, klimek
Reviewed By: Bigcheese
Subscribers: MaskRay, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69122
More information about the All-commits
mailing list