Re: [PATCH] D21946: Subject: [PATCH] [Driver] fix windows SDK detect

2016-07-27 Thread comicfans44 via cfe-commits
comicfans44 added a comment.

In https://reviews.llvm.org/D21946#473071, @zturner wrote:

> In https://reviews.llvm.org/D21946#473070, @comicfans44 wrote:
>
> > I've not commited to cfe before, so I think I havn't commit access 
> > permission.
>
>
> If you've committed anywhere in LLVM, you should have commit access to cfe.  
> Feel free to give it a try, as I won't be able to commit until Wednesday of 
> next week at the earliest anyway due to the upcoming holiday.


ping ?


https://reviews.llvm.org/D21946



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D21946: Subject: [PATCH] [Driver] fix windows SDK detect

2016-07-01 Thread comicfans44 via cfe-commits
comicfans44 created this revision.
comicfans44 added reviewers: zturner, majnemer.
comicfans44 added a subscriber: cfe-commits.

1. readFullStringValue returns bool, should not compared with ERROR_SUCCESS
2. RegQueryValueExW string may contain null terminating char ,should be trimmed
these leads getSystemRegistryString return incorrect result, and following
getWindows10SDKVersion gives incorrect result for string append, prevents 
correct
SDK detected.


http://reviews.llvm.org/D21946

Files:
  lib/Driver/MSVCToolChain.cpp

Index: lib/Driver/MSVCToolChain.cpp
===
--- lib/Driver/MSVCToolChain.cpp
+++ lib/Driver/MSVCToolChain.cpp
@@ -113,6 +113,9 @@
   if (result == ERROR_SUCCESS) {
 std::wstring WideValue(reinterpret_cast(buffer.data()),
valueSize / sizeof(wchar_t));
+if (valueSize && WideValue.back() == L'\0') {
+WideValue.pop_back();
+}
 // The destination buffer must be empty as an invariant of the conversion
 // function; but this function is sometimes called in a loop that passes in
 // the same buffer, however. Simply clear it out so we can overwrite it.
@@ -190,8 +193,7 @@
   lResult = RegOpenKeyExA(hTopKey, bestName.c_str(), 0,
   KEY_READ | KEY_WOW64_32KEY, &hKey);
   if (lResult == ERROR_SUCCESS) {
-lResult = readFullStringValue(hKey, valueName, value);
-if (lResult == ERROR_SUCCESS) {
+if (readFullStringValue(hKey, valueName, value)) {
   bestValue = dvalue;
   if (phValue)
 *phValue = bestName;
@@ -208,8 +210,7 @@
 lResult =
 RegOpenKeyExA(hRootKey, keyPath, 0, KEY_READ | KEY_WOW64_32KEY, &hKey);
 if (lResult == ERROR_SUCCESS) {
-  lResult = readFullStringValue(hKey, valueName, value);
-  if (lResult == ERROR_SUCCESS)
+  if (readFullStringValue(hKey, valueName, value))
 returnValue = true;
   if (phValue)
 phValue->clear();


Index: lib/Driver/MSVCToolChain.cpp
===
--- lib/Driver/MSVCToolChain.cpp
+++ lib/Driver/MSVCToolChain.cpp
@@ -113,6 +113,9 @@
   if (result == ERROR_SUCCESS) {
 std::wstring WideValue(reinterpret_cast(buffer.data()),
valueSize / sizeof(wchar_t));
+if (valueSize && WideValue.back() == L'\0') {
+WideValue.pop_back();
+}
 // The destination buffer must be empty as an invariant of the conversion
 // function; but this function is sometimes called in a loop that passes in
 // the same buffer, however. Simply clear it out so we can overwrite it.
@@ -190,8 +193,7 @@
   lResult = RegOpenKeyExA(hTopKey, bestName.c_str(), 0,
   KEY_READ | KEY_WOW64_32KEY, &hKey);
   if (lResult == ERROR_SUCCESS) {
-lResult = readFullStringValue(hKey, valueName, value);
-if (lResult == ERROR_SUCCESS) {
+if (readFullStringValue(hKey, valueName, value)) {
   bestValue = dvalue;
   if (phValue)
 *phValue = bestName;
@@ -208,8 +210,7 @@
 lResult =
 RegOpenKeyExA(hRootKey, keyPath, 0, KEY_READ | KEY_WOW64_32KEY, &hKey);
 if (lResult == ERROR_SUCCESS) {
-  lResult = readFullStringValue(hKey, valueName, value);
-  if (lResult == ERROR_SUCCESS)
+  if (readFullStringValue(hKey, valueName, value))
 returnValue = true;
   if (phValue)
 phValue->clear();
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D21946: Subject: [PATCH] [Driver] fix windows SDK detect

2016-07-01 Thread comicfans44 via cfe-commits
comicfans44 added a comment.

I've not commited to cfe before, so I think I havn't commit access permission.


http://reviews.llvm.org/D21946



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D21946: Subject: [PATCH] [Driver] fix windows SDK detect

2016-07-01 Thread comicfans44 via cfe-commits
comicfans44 added a comment.

neither did I commited to LLVM ... so I'll wait.


http://reviews.llvm.org/D21946



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits