ABataev added inline comments.
================ Comment at: lib/Driver/ToolChains.cpp:1438 + if (GCCToolchainDir == "" || GCCToolchainDir == D.SysRoot + "/usr") { + for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) { + llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File = ---------------- Use range-based `for` here ================ Comment at: lib/Driver/ToolChains.cpp:1446-1463 + // CURRENT=triple-version + if (Line.startswith("CURRENT=")) { + const std::pair<StringRef, StringRef> ActiveVersion = + Line.substr(8).rsplit('-'); + // Note: Strictly speaking, we should be reading + // /etc/env.d/gcc/${CURRENT} now. However, the file doesn't + // contain anything new or especially useful to us. ---------------- I think it is better to use `llvm::Triple` class here for parsing `ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT` string rather than `StringRef::split()` https://reviews.llvm.org/D25661 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits