[llvm] r276334 - Fix the clang-cl self-host with VS 2013 headers

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 14:06:04 PDT 2016


Author: rnk
Date: Thu Jul 21 16:06:04 2016
New Revision: 276334

URL: http://llvm.org/viewvc/llvm-project?rev=276334&view=rev
Log:
Fix the clang-cl self-host with VS 2013 headers

std::numeric_limits<int64_t>::max() is not constexpr in VC 2013 headers,
and Clang complains that it isn't. MSVC 2013 itself is emitting a
dynamic initializer for this thing. Instead, use an enum.

Modified:
    llvm/trunk/lib/Analysis/CFLGraph.h

Modified: llvm/trunk/lib/Analysis/CFLGraph.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFLGraph.h?rev=276334&r1=276333&r2=276334&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CFLGraph.h (original)
+++ llvm/trunk/lib/Analysis/CFLGraph.h Thu Jul 21 16:06:04 2016
@@ -27,8 +27,7 @@ namespace cflaa {
 // We use UnknownOffset to represent pointer offsets that cannot be determined
 // at compile time. Note that MemoryLocation::UnknownSize cannot be used here
 // because we require a signed value.
-static LLVM_CONSTEXPR int64_t UnknownOffset =
-    std::numeric_limits<int64_t>::max();
+enum : int64_t { UnknownOffset = LLONG_MAX };
 
 inline int64_t addOffset(int64_t LHS, int64_t RHS) {
   if (LHS == UnknownOffset || RHS == UnknownOffset)




More information about the llvm-commits mailing list