[PATCH] D25661: [Driver] Support obtaining active toolchain from gcc-config on Gentoo
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 25 02:41:05 PDT 2016
bkramer added inline comments.
================
Comment at: lib/Driver/ToolChains.cpp:1438
+ if (GCCToolchainDir == "" || GCCToolchainDir == D.SysRoot + "/usr") {
+ for (const StringRef& CandidateTriple : CandidateTripleAliases) {
+ llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
----------------
drop the const&. Using StringRef by value is fine.
================
Comment at: lib/Driver/ToolChains.cpp:1445
+ File.get()->getBuffer().split(Lines, "\n");
+ for (const StringRef& Line : Lines) {
+ // CURRENT=triple-version
----------------
drop ref
================
Comment at: lib/Driver/ToolChains.cpp:1447
+ // CURRENT=triple-version
+ if (Line.startswith("CURRENT=")) {
+ const std::pair<StringRef, StringRef> ActiveVersion =
----------------
We have StringRef::consume_front now to make this more convenient.
https://reviews.llvm.org/D25661
More information about the cfe-commits
mailing list