[CUDA] Fix CUDA install version parsing.
authorJustin Lebar <jlebar@google.com>
Mon, 15 Aug 2016 20:38:48 +0000 (20:38 +0000)
committerJustin Lebar <jlebar@google.com>
Mon, 15 Aug 2016 20:38:48 +0000 (20:38 +0000)
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

llvm-svn: 278733

clang/lib/Driver/ToolChains.cpp

index fe866df..4d438c2 100644 (file)
@@ -1730,8 +1730,8 @@ static CudaVersion ParseCudaVersionFile(llvm::StringRef V) {
   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) {