[PATCH] D25661: [Driver] Support obtaining active toolchain from gcc-config on Gentoo

Michał Górny via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 17 06:46:43 PDT 2016


mgorny added inline comments.


================
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.
----------------
ABataev wrote:
> I think it is better to use `llvm::Triple` class here for parsing `ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT` string rather than `StringRef::split()`
This is not parsing the triple but detaching the version appended to it.


https://reviews.llvm.org/D25661





More information about the cfe-commits mailing list