This revision was automatically updated to reflect the committed changes.
Closed by commit rL285076: [Driver] Disable OpenSUSE rules for OpenSUSE/SLES 10
and older (authored by mgorny).
Changed prior to commit:
https://reviews.llvm.org/D24954?vs=75704=75713#toc
Repository:
rL LLVM
bruno accepted this revision.
bruno added a comment.
This revision is now accepted and ready to land.
LGTM!
https://reviews.llvm.org/D24954
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
mgorny updated this revision to Diff 75704.
mgorny added a comment.
Updated to perform `.startswith()` check before splitting.
https://reviews.llvm.org/D24954
Files:
lib/Driver/ToolChains.cpp
Index: lib/Driver/ToolChains.cpp
bruno added inline comments.
Comment at: lib/Driver/ToolChains.cpp:3942
+ int Version;
+ if (SplitLine.first.trim() != "VERSION")
+continue;
mgorny wrote:
> bruno wrote:
> > You can check `Line.trim() != VERSION` before the `split` as to do not
mgorny added inline comments.
Comment at: lib/Driver/ToolChains.cpp:3942
+ int Version;
+ if (SplitLine.first.trim() != "VERSION")
+continue;
bruno wrote:
> You can check `Line.trim() != VERSION` before the `split` as to do not try to
> split
bruno added inline comments.
Comment at: lib/Driver/ToolChains.cpp:3942
+ int Version;
+ if (SplitLine.first.trim() != "VERSION")
+continue;
You can check `Line.trim() != VERSION` before the `split` as to do not try to
split unnecessary lines.
mgorny updated this revision to Diff 75615.
mgorny added a comment.
Refactored the code as requested. Also I've noticed that if VERSION had invalid
value, the code continued reading the file — now it immediately returns
UnknownDistro in that case.
https://reviews.llvm.org/D24954
Files:
bruno added inline comments.
Comment at: lib/Driver/ToolChains.cpp:3937
+StringRef Data = File.get()->getBuffer();
+SmallVector Lines;
+Data.split(Lines, "\n");
This file usually has 5-6 lines, can you use 8 instead?
mgorny marked 3 inline comments as done.
mgorny added a comment.
I think I've addressed all your concerns now.
https://reviews.llvm.org/D24954
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
mgorny retitled this revision from "[ToolChains] Disable OpenSUSE rules for
SLES10" to "[Driver] Disable OpenSUSE rules for OpenSUSE/SLES 10 and older".
mgorny updated the summary for this revision.
mgorny updated this revision to Diff 75357.
https://reviews.llvm.org/D24954
Files:
10 matches
Mail list logo