r188084 - Add a convenient way to compare GCCVersions without creating temporary objects.

Benjamin Kramer benny.kra at gmail.com
Fri Aug 9 11:00:13 PDT 2013


On 09.08.2013, at 19:46, Chandler Carruth <chandlerc at google.com> wrote:

> 
> On Fri, Aug 9, 2013 at 10:17 AM, Benjamin Kramer <benny.kra at googlemail.com> wrote:
> Add a convenient way to compare GCCVersions without creating temporary objects.
> 
> Er, is this really better? I don't find it more readable. 

-      static const GCCVersion MinVersion = { "4.1.1", 4, 1, 1, "" };
-      if (CandidateVersion < MinVersion)
+      if (CandidateVersion.isOlderThan(4, 1, 1))

The list initializer version mentions the version number twice, I found that really ugly and the version string isn't used at all. I guess we could always call GCCVersion::Parse if we don't care about performance (I don't think this code is hot).

- Ben



More information about the cfe-commits mailing list