[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-11-22 Thread Kousik Kumar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG26fa9e31f58a: Add support to find out resource dir and add it as compilation args (authored by kousikk). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69122/

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-11-21 Thread Michael Spencer via Phabricator via cfe-commits
Bigcheese added a comment. Thanks, you're good to commit. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69122/new/ https://reviews.llvm.org/D69122 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-11-21 Thread Kousik Kumar via Phabricator via cfe-commits
kousikk added inline comments. Comment at: clang/tools/clang-scan-deps/ClangScanDeps.cpp:75-79 +llvm::Optional Redirects[] = { +{""}, // Stdin +StringRef(OutputFile), +StringRef(ErrorFile), +}; Bigcheese wrote: > It would be nice i

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-11-21 Thread Kousik Kumar via Phabricator via cfe-commits
kousikk updated this revision to Diff 230508. kousikk marked 4 inline comments as done. kousikk added a comment. Address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69122/new/ https://reviews.llvm.org/D69122 Files: clang/tools/

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-11-13 Thread Michael Spencer via Phabricator via cfe-commits
Bigcheese accepted this revision. Bigcheese added a comment. This revision is now accepted and ready to land. lgtm with the changes to `FindResourceDir`. Comment at: clang/tools/clang-scan-deps/ClangScanDeps.cpp:50 + /// compiler path is NOT an absolute path. + std::string Fi

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-11-12 Thread Kousik Kumar via Phabricator via cfe-commits
kousikk added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69122/new/ https://reviews.llvm.org/D69122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-11-02 Thread Kousik Kumar via Phabricator via cfe-commits
kousikk updated this revision to Diff 227601. kousikk added a comment. Forgot to run clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69122/new/ https://reviews.llvm.org/D69122 Files: clang/tools/clang-scan-deps/ClangScanDeps.cpp Inde

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-11-02 Thread Kousik Kumar via Phabricator via cfe-commits
kousikk updated this revision to Diff 227600. kousikk marked an inline comment as done. kousikk added a comment. @BigCheese - thanks, all the three points make sense! > An alternative would be to only do FindResourceDir when given an absolute > path to a compiler, instead of trying to guess. I t

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-10-29 Thread Michael Spencer via Phabricator via cfe-commits
Bigcheese requested changes to this revision. Bigcheese added a comment. This revision now requires changes to proceed. So I agree solving this problem makes sense, but I have some issues with the current patch. - This defaults to doing the lookup. The test suite, and some real outputs, just us

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-10-28 Thread Kousik Kumar via Phabricator via cfe-commits
kousikk added a comment. I discussed with @klimek about this. The conclusion we arrived at was: Allowing override of `resource-dir` for all tools is not something we should do (for reasons that @klimek has outlined above). However, the dependency scanner tool can choose to override `resource-di

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-10-24 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added a comment. > since resource directory should be picked relative > to the path of the clang-compiler in the compilation command. The resource dir should be the resource dir that shipped with the clang source code that the *tool* was built with. We can think about the resource dir as

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-10-24 Thread Michael Spencer via Phabricator via cfe-commits
Bigcheese added a reviewer: klimek. Bigcheese added a comment. I've added Manuel as a reviewer as this patch is also changing the tooling APIs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69122/new/ https://reviews.llvm.org/D69122

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-10-21 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Tooling/ArgumentsAdjusters.cpp:43 ArgumentsAdjuster getClangStripOutputAdjuster() { - return [](const CommandLineArguments &Args, StringRef /*unused*/) { + return [](const CommandLineArguments &Args, StringRef /*unused*/, St

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-10-21 Thread Michael Spencer via Phabricator via cfe-commits
Bigcheese added a comment. The current assumption is that the clang-scan-deps binary is the one that comes next to the clang binary you are using. There are lots of other differences between clang versions than just the resource-dir. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-10-17 Thread Kousik Kumar via Phabricator via cfe-commits
kousikk added a comment. > I haven't looked into this in detail but it feels kind of wasteful to start a > process just to get this value. Right, that's why I cache this information. So multiple compile commands sharing the same compiler process will trigger at 1 subprocess and then subsequent

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-10-17 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. @kousikk could we please add support for generic `-extra-arg`, which can then add `-resource-dir` like the other clang tools? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69122/new/ https://reviews.llvm.org/D69122 ___

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-10-17 Thread Jan Korous via Phabricator via cfe-commits
jkorous added inline comments. Comment at: clang/tools/clang-scan-deps/ClangScanDeps.cpp:70 +}; +if (const int RC = llvm::sys::ExecuteAndWait(ClangBinaryPath, PrintResourceDirArgs, {}, Redirects)) { + auto ErrorBuf = llvm::MemoryBuffer::getFile(ErrorFile.c_str()); -

[PATCH] D69122: Add support to find out resource dir and add it as compilation args

2019-10-17 Thread Kousik Kumar via Phabricator via cfe-commits
kousikk created this revision. kousikk added reviewers: arphaman, Bigcheese, jkorous, dexonsmith. Herald added a project: clang. Herald added a subscriber: cfe-commits. kousikk edited the summary of this revision. kousikk edited the summary of this revision. If -resource-dir is not specified as pa