[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-25 Thread Dmitry Antipov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG96318f64a786: [Driver] Perform Linux distribution detection only once (authored by dmantipov). Changed prior to commit: https://reviews.llvm.org/D87187?vs=294302=294478#toc Repository: rG LLVM

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-25 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea accepted this revision. aganea added a comment. Makes sense, you cache the commonly taken path, but not the (very uncommon) VFS codepath. LGTM, with some minor comments. Thanks again! Comment at: clang/include/clang/Driver/Distro.h:117 - bool IsOpenSUSE() const { -

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-25 Thread Dmitry Antipov via Phabricator via cfe-commits
dmantipov updated this revision to Diff 294302. dmantipov marked an inline comment as done. dmantipov added a comment. Well, the problem with tests seems to be a bit wider - tests uses llvm::vfs::InMemoryFileSystem, which is not "real", so detection will return Distro::UnknownDistro anyway.

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-24 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. `llvm::call_once` is fine, but IMO the static local version is preferable: it's built in to the language, no headers to include. Comment at: clang/lib/Driver/Distro.cpp:224 + if

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-24 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea added a comment. In D87187#2291806 , @dmantipov wrote: > IIUC compiler driver is not intended to be multithreaded. But OK, here is the > version with llvm::call_once(...). Thanks! There could be at least two cases I see, where the driver

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-24 Thread Dmitry Antipov via Phabricator via cfe-commits
dmantipov updated this revision to Diff 293949. dmantipov added a comment. IIUC compiler driver is not intended to be multithreaded. But OK, here is the version with llvm::call_once(...). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87187/new/

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-23 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. I think we can go forward with the reviewers we have. I have one more concern. Are the other reviewers happy? Comment at: clang/lib/Driver/Distro.cpp:206 +const llvm::Triple ) { + static Distro::DistroType Type =

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-23 Thread Dmitry Antipov via Phabricator via cfe-commits
dmantipov added a comment. What's next with this? Should I add more reviewers? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87187/new/ https://reviews.llvm.org/D87187 ___ cfe-commits mailing list

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-18 Thread Dmitry Antipov via Phabricator via cfe-commits
dmantipov updated this revision to Diff 292710. dmantipov added a comment. Updated (style adjustments). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87187/new/ https://reviews.llvm.org/D87187 Files: clang/include/clang/Driver/Distro.h

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-17 Thread Reid "Away June-Sep" Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: clang/lib/Driver/Distro.cpp:205 +const llvm::Triple ) { + static Distro::DistroType Type = Distro::UninitializedDistro; + rnk wrote: > aganea wrote: > > I'm not sure if this is safe.

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-17 Thread Reid "Away June-Sep" Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: clang/lib/Driver/Distro.cpp:205 +const llvm::Triple ) { + static Distro::DistroType Type = Distro::UninitializedDistro; + aganea wrote: > I'm not sure if this is safe. @rnk Do we expect

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-17 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea added a subscriber: rnk. aganea added a comment. Please install & run `git clang-format` before uploading the patch. Comment at: clang/include/clang/Driver/Distro.h:27 +// Special value means that no detection was performed yet. +UninitializedDistro = -1,

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-10 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru added a comment. I guess it isn't possible to write tests for this? Does it have an impact on cross compile ? Also, please fix the clang-format warning! Comment at: clang/lib/Driver/Distro.cpp:227 + if (!HostTriple.isOSLinux() && onRealFS) +Type =

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-07 Thread Dmitry Antipov via Phabricator via cfe-commits
dmantipov updated this revision to Diff 290281. dmantipov added a comment. Add trivial {/etc,/usr/lib}/os-release parser and fix tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87187/new/ https://reviews.llvm.org/D87187 Files:

[PATCH] D87187: [Driver] Perform Linux distribution detection just once

2020-09-05 Thread Dmitry Antipov via Phabricator via cfe-commits
dmantipov created this revision. dmantipov added reviewers: mgorny, aganea. dmantipov added a project: clang. Herald added a subscriber: cfe-commits. dmantipov requested review of this revision. When running regular ('clang++ foo.cc') native compilation on Linux target in a typical