Index: llvm/include/llvm/Support/WindowsSupport.h =================================================================== --- llvm/include/llvm/Support/WindowsSupport.h +++ llvm/include/llvm/Support/WindowsSupport.h @@ -28,7 +28,7 @@ // Require at least Windows 7 API. #define _WIN32_WINNT 0x0601 -#define _WIN32_IE 0x0800 // MinGW at it again. FIXME: verify if still needed. +#define _WIN32_IE 0x0800 // MinGW at it again. FIXME: verify if still needed. #define WIN32_LEAN_AND_MEAN #ifndef NOMINMAX #define NOMINMAX @@ -90,19 +90,16 @@ return R != 0; } -template -class ScopedHandle { +template class ScopedHandle { typedef typename HandleTraits::handle_type handle_type; handle_type Handle; - ScopedHandle(const ScopedHandle &other); // = delete; + ScopedHandle(const ScopedHandle &other); // = delete; void operator=(const ScopedHandle &other); // = delete; public: - ScopedHandle() - : Handle(HandleTraits::GetInvalid()) {} + ScopedHandle() : Handle(HandleTraits::GetInvalid()) {} - explicit ScopedHandle(handle_type h) - : Handle(h) {} + explicit ScopedHandle(handle_type h) : Handle(h) {} ~ScopedHandle() { if (HandleTraits::IsValid(Handle)) @@ -127,87 +124,61 @@ return HandleTraits::IsValid(Handle) ? true : false; } - operator handle_type() const { - return Handle; - } + operator handle_type() const { return Handle; } }; struct CommonHandleTraits { typedef HANDLE handle_type; - static handle_type GetInvalid() { - return INVALID_HANDLE_VALUE; - } + static handle_type GetInvalid() { return INVALID_HANDLE_VALUE; } - static void Close(handle_type h) { - ::CloseHandle(h); - } + static void Close(handle_type h) { ::CloseHandle(h); } - static bool IsValid(handle_type h) { - return h != GetInvalid(); - } + static bool IsValid(handle_type h) { return h != GetInvalid(); } }; struct JobHandleTraits : CommonHandleTraits { - static handle_type GetInvalid() { - return NULL; - } + static handle_type GetInvalid() { return NULL; } }; struct CryptContextTraits : CommonHandleTraits { typedef HCRYPTPROV handle_type; - static handle_type GetInvalid() { - return 0; - } + static handle_type GetInvalid() { return 0; } - static void Close(handle_type h) { - ::CryptReleaseContext(h, 0); - } + static void Close(handle_type h) { ::CryptReleaseContext(h, 0); } - static bool IsValid(handle_type h) { - return h != GetInvalid(); - } + static bool IsValid(handle_type h) { return h != GetInvalid(); } }; struct RegTraits : CommonHandleTraits { typedef HKEY handle_type; - static handle_type GetInvalid() { - return NULL; - } + static handle_type GetInvalid() { return NULL; } - static void Close(handle_type h) { - ::RegCloseKey(h); - } + static void Close(handle_type h) { ::RegCloseKey(h); } - static bool IsValid(handle_type h) { - return h != GetInvalid(); - } + static bool IsValid(handle_type h) { return h != GetInvalid(); } }; struct FindHandleTraits : CommonHandleTraits { - static void Close(handle_type h) { - ::FindClose(h); - } + static void Close(handle_type h) { ::FindClose(h); } }; struct FileHandleTraits : CommonHandleTraits {}; typedef ScopedHandle ScopedCommonHandle; -typedef ScopedHandle ScopedFileHandle; +typedef ScopedHandle ScopedFileHandle; typedef ScopedHandle ScopedCryptContext; -typedef ScopedHandle ScopedRegHandle; -typedef ScopedHandle ScopedFindHandle; -typedef ScopedHandle ScopedJobHandle; +typedef ScopedHandle ScopedRegHandle; +typedef ScopedHandle ScopedFindHandle; +typedef ScopedHandle ScopedJobHandle; namespace llvm { -template -class SmallVectorImpl; +template class SmallVectorImpl; template -typename SmallVectorImpl::const_pointer -c_str(SmallVectorImpl &str) { +typename SmallVectorImpl::const_pointer c_str(SmallVectorImpl &str) { str.push_back(0); str.pop_back(); return str.data(); Index: llvm/lib/Support/CrashRecoveryContext.cpp =================================================================== --- llvm/lib/Support/CrashRecoveryContext.cpp +++ llvm/lib/Support/CrashRecoveryContext.cpp @@ -209,7 +209,7 @@ // XP, so if support for older versions of Windows is required, // it will have to be added. -#include "Windows/WindowsSupport.h" +#include "llvm/Support/WindowsSupport.h" static LONG CALLBACK ExceptionHandler(PEXCEPTION_POINTERS ExceptionInfo) { Index: llvm/lib/Support/InitLLVM.cpp =================================================================== --- llvm/lib/Support/InitLLVM.cpp +++ llvm/lib/Support/InitLLVM.cpp @@ -16,7 +16,7 @@ #include #ifdef _WIN32 -#include "Windows/WindowsSupport.h" +#include "llvm/Support/WindowsSupport.h" #endif using namespace llvm; Index: llvm/lib/Support/RandomNumberGenerator.cpp =================================================================== --- llvm/lib/Support/RandomNumberGenerator.cpp +++ llvm/lib/Support/RandomNumberGenerator.cpp @@ -18,7 +18,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #ifdef _WIN32 -#include "Windows/WindowsSupport.h" +#include "llvm/Support/WindowsSupport.h" #else #include "Unix/Unix.h" #endif Index: llvm/lib/Support/raw_ostream.cpp =================================================================== --- llvm/lib/Support/raw_ostream.cpp +++ llvm/lib/Support/raw_ostream.cpp @@ -60,7 +60,7 @@ #endif #ifdef _WIN32 -#include "Windows/WindowsSupport.h" +#include "llvm/Support/WindowsSupport.h" #endif using namespace llvm;