From 384caa9849a0025110bdd873d867161d6eae06a1 Mon Sep 17 00:00:00 2001 From: lateralusX Date: Mon, 28 May 2018 11:43:06 +0200 Subject: [PATCH] Build LLVM Windows x64 using CMake + VS2015 or VS2017. --- include/llvm/CodeGen/PBQP/CostAllocator.h | 4 ++-- include/llvm/CodeGen/PBQP/Math.h | 4 ++-- include/llvm/Support/Compiler.h | 4 ++-- tools/llvm-readobj/Error.cpp | 2 +- tools/obj2yaml/Error.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/llvm/CodeGen/PBQP/CostAllocator.h b/include/llvm/CodeGen/PBQP/CostAllocator.h index 892e5b4557b..2c75f7eaadf 100644 --- a/include/llvm/CodeGen/PBQP/CostAllocator.h +++ b/include/llvm/CodeGen/PBQP/CostAllocator.h @@ -87,10 +87,10 @@ class CostPool { !std::is_same::type>::value, bool>::type - operator()(const PoolEntry* a, const CostKeyT &b) { + operator()(const PoolEntry* a, const CostKeyT &b) const { return compare(a->getCost(), b); } - bool operator()(const PoolEntry* a, const PoolEntry* b) { + bool operator()(const PoolEntry* a, const PoolEntry* b) const { return compare(a->getCost(), b->getCost()); } private: diff --git a/include/llvm/CodeGen/PBQP/Math.h b/include/llvm/CodeGen/PBQP/Math.h index 69a9d83cc09..7d2ed9d1f0b 100644 --- a/include/llvm/CodeGen/PBQP/Math.h +++ b/include/llvm/CodeGen/PBQP/Math.h @@ -138,7 +138,7 @@ class Vector { class VectorComparator { public: - bool operator()(const Vector &A, const Vector &B) { + bool operator()(const Vector &A, const Vector &B) const { if (A.Length < B.Length) return true; if (B.Length < A.Length) @@ -386,7 +386,7 @@ class Matrix { class MatrixComparator { public: - bool operator()(const Matrix &A, const Matrix &B) { + bool operator()(const Matrix &A, const Matrix &B) const { if (A.Rows < B.Rows) return true; if (B.Rows < A.Rows) diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index 85f0cc6a391..db9345b1ff9 100644 --- a/include/llvm/Support/Compiler.h +++ b/include/llvm/Support/Compiler.h @@ -61,7 +61,7 @@ #define LLVM_MSC_PREREQ(version) 0 #endif -#ifndef _MSC_VER +#if !defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER >= 1910) #define LLVM_NOEXCEPT noexcept #else #define LLVM_NOEXCEPT @@ -117,7 +117,7 @@ #define LLVM_DELETED_FUNCTION #endif -#if __has_feature(cxx_constexpr) || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if __has_feature(cxx_constexpr) || defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(_MSC_VER) && _MSC_VER >= 1900) # define LLVM_CONSTEXPR constexpr #else # define LLVM_CONSTEXPR diff --git a/tools/llvm-readobj/Error.cpp b/tools/llvm-readobj/Error.cpp index a078f5c095c..7e6f780c5d1 100644 --- a/tools/llvm-readobj/Error.cpp +++ b/tools/llvm-readobj/Error.cpp @@ -24,7 +24,7 @@ class _readobj_error_category : public std::error_category { }; } // namespace -const char *_readobj_error_category::name() const { +const char *_readobj_error_category::name() const LLVM_NOEXCEPT { return "llvm.readobj"; } diff --git a/tools/obj2yaml/Error.cpp b/tools/obj2yaml/Error.cpp index 00741287a64..1b6a84c5bc6 100644 --- a/tools/obj2yaml/Error.cpp +++ b/tools/obj2yaml/Error.cpp @@ -20,7 +20,7 @@ class _obj2yaml_error_category : public std::error_category { }; } // namespace -const char *_obj2yaml_error_category::name() const { return "obj2yaml"; } +const char *_obj2yaml_error_category::name() const LLVM_NOEXCEPT { return "obj2yaml"; } std::string _obj2yaml_error_category::message(int ev) const { switch (static_cast(ev)) {