summaryrefslogtreecommitdiffstats
path: root/llvm/utils/KillTheDoctor/KillTheDoctor.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-11 03:58:34 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-11 03:58:34 +0000
commita813d608a943579804eb9f12c8ede2955bb3a777 (patch)
treed77b568b616cc527538721269ccdf1aa6283798d /llvm/utils/KillTheDoctor/KillTheDoctor.cpp
parent6a9aae77d4bc6eb644c106fc79be6f59c53c5ba1 (diff)
downloadbcm5719-llvm-a813d608a943579804eb9f12c8ede2955bb3a777.tar.gz
bcm5719-llvm-a813d608a943579804eb9f12c8ede2955bb3a777.zip
Remove windows_error.
MSVC doesn't seem to provide any is_error_code_enum enumeration for the windows errors. Fortunately very few places in llvm have to handle raw windows errors, so we can just construct the corresponding error_code directly. llvm-svn: 210631
Diffstat (limited to 'llvm/utils/KillTheDoctor/KillTheDoctor.cpp')
-rw-r--r--llvm/utils/KillTheDoctor/KillTheDoctor.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/utils/KillTheDoctor/KillTheDoctor.cpp b/llvm/utils/KillTheDoctor/KillTheDoctor.cpp
index a0d314bf10a..f236c5ffc9e 100644
--- a/llvm/utils/KillTheDoctor/KillTheDoctor.cpp
+++ b/llvm/utils/KillTheDoctor/KillTheDoctor.cpp
@@ -169,6 +169,10 @@ namespace {
typedef ScopedHandle<FileHandle> FileScopedHandle;
}
+static error_code windows_error(unsigned E) {
+ return error_code(E, system_category());
+}
+
static error_code GetFileNameFromHandle(HANDLE FileHandle,
std::string& Name) {
char Filename[MAX_PATH+1];
@@ -245,7 +249,7 @@ static std::string FindProgram(const std::string &Program, error_code &ec) {
ec = windows_error(::GetLastError());
else if (length > array_lengthof(PathName)) {
// This may have been the file, return with error.
- ec = windows_error::buffer_overflow;
+ ec = windows_error(ERROR_BUFFER_OVERFLOW);
break;
} else {
// We found the path! Return it.
OpenPOWER on IntegriCloud