bruno added inline comments.
================
Comment at: lib/Driver/ToolChains.cpp:3937
+ StringRef Data = File.get()->getBuffer();
+ SmallVector<StringRef, 16> Lines;
+ Data.split(Lines, "\n");
----------------
This file usually has 5-6 lines, can you use 8 instead?
================
Comment at: lib/Driver/ToolChains.cpp:3940
+ for (const StringRef& Line : Lines) {
+ std::pair<StringRef, StringRef> SplitLine = Line.split('=');
+ int Version;
----------------
You probably want to explicitly skip the lines you're not interested to make it
a bit more clear. AFAIU, the VERSION is usually on the second line. How about:
if (Line.first.trim() != "VERSION")
continue;
<... then split and parse the value>
https://reviews.llvm.org/D24954
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits