Use numeric_limits instead of LLONG_MAX
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 21 Oct 2015 21:10:12 +0000 (21:10 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 21 Oct 2015 21:10:12 +0000 (21:10 +0000)
This is a build fix for configurations where LLONG_MAX is
not defined in system headers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250946 91177308-0d34-0410-b5e6-96231b3b80d8

lib/DebugInfo/DWARF/DWARFFormValue.cpp

index d22e63502d250e0bbedec0d81fbe88077e79e38e..a11b00a926d9cea1f730ad1439bbdd527ddb3c61 100644 (file)
@@ -18,7 +18,7 @@
 #include "llvm/Support/Format.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cassert>
-#include <climits>
+#include <limits>
 using namespace llvm;
 using namespace dwarf;
 using namespace syntax;
@@ -565,7 +565,7 @@ Optional<uint64_t> DWARFFormValue::getAsUnsignedConstant() const {
 
 Optional<int64_t> DWARFFormValue::getAsSignedConstant() const {
   if ((!isFormClass(FC_Constant) && !isFormClass(FC_Flag)) ||
-      (Form == DW_FORM_udata && uint64_t(LLONG_MAX) < Value.uval))
+      (Form == DW_FORM_udata && uint64_t(std::numeric_limits<int64_t>::max()) < Value.uval))
     return None;
   switch (Form) {
   case DW_FORM_data4: