r300328 - Make Gentoo GNU GCC Config override whitespace tolerant

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 14 08:21:18 PDT 2017


Author: erichkeane
Date: Fri Apr 14 10:21:18 2017
New Revision: 300328

URL: http://llvm.org/viewvc/llvm-project?rev=300328&view=rev
Log:
Make Gentoo GNU GCC Config override whitespace tolerant

The config-*triple* file handling isn't tolerant of 
leading/trailing whitespace, making it not terribly 
obvious when a single extraneous tab/space/etc will 
cause the override to be ignored. This patch simply 
trims the lines to ensure that it is tolerant of 
whitespace.

Modified:
    cfe/trunk/lib/Driver/ToolChains/Gnu.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=300328&r1=300327&r2=300328&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Fri Apr 14 10:21:18 2017
@@ -2173,6 +2173,7 @@ bool Generic_GCC::GCCInstallationDetecto
     SmallVector<StringRef, 2> Lines;
     File.get()->getBuffer().split(Lines, "\n");
     for (StringRef Line : Lines) {
+      Line = Line.trim();
       // CURRENT=triple-version
       if (Line.consume_front("CURRENT=")) {
         const std::pair<StringRef, StringRef> ActiveVersion =




More information about the cfe-commits mailing list