r278733 - [CUDA] Fix CUDA install version parsing.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 15 13:38:48 PDT 2016


Author: jlebar
Date: Mon Aug 15 15:38:48 2016
New Revision: 278733

URL: http://llvm.org/viewvc/llvm-project?rev=278733&view=rev
Log:
[CUDA] Fix CUDA install version parsing.

Summary:
getAsInteger returns true on error.  Oops.

No test because the behavior at the moment is identical with or without
this change.

Reviewers: tra

Subscribers: cfe-commits, Prazek

Differential Revision: https://reviews.llvm.org/D23340

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

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=278733&r1=278732&r2=278733&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Mon Aug 15 15:38:48 2016
@@ -1730,8 +1730,8 @@ static CudaVersion ParseCudaVersionFile(
   int Major = -1, Minor = -1;
   auto First = V.split('.');
   auto Second = First.second.split('.');
-  if (!First.first.getAsInteger(10, Major) ||
-      !Second.first.getAsInteger(10, Minor))
+  if (First.first.getAsInteger(10, Major) ||
+      Second.first.getAsInteger(10, Minor))
     return CudaVersion::UNKNOWN;
 
   if (Major == 7 && Minor == 0) {




More information about the cfe-commits mailing list