summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-10-18 22:14:48 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-10-18 22:14:48 +0000
commite42aeece6c3264ffd6f61af3745d2071466c7194 (patch)
tree13e4455691c7532c72d7483f99bf297ae60aa970
parenteaa13851a7fe604363577350c5cf65c257c4d41a (diff)
downloadllvm-e42aeece6c3264ffd6f61af3745d2071466c7194.tar.gz
llvm-e42aeece6c3264ffd6f61af3745d2071466c7194.tar.bz2
llvm-e42aeece6c3264ffd6f61af3745d2071466c7194.tar.xz
Move code to redefine INT64_{MIN,MAX} on AIX/PowerPC to a separate header,
because #undef becomes commented out in DataTypes.h.in due to autoheader git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17135 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/DataTypes.h.in12
-rw-r--r--include/llvm/Support/DataTypesFix.h29
2 files changed, 31 insertions, 10 deletions
diff --git a/include/llvm/Support/DataTypes.h.in b/include/llvm/Support/DataTypes.h.in
index 9da5423946..2ac1e1721e 100644
--- a/include/llvm/Support/DataTypes.h.in
+++ b/include/llvm/Support/DataTypes.h.in
@@ -49,16 +49,8 @@
#include <stdint.h>
#endif
-#if defined(_POWER) && defined(_AIX)
-// GCC is strict about defining large constants: they must have LL modifier.
-// We will catch INT64_MAX in the default case below.
-#undef INT64_MAX
-// AIX #defines INT64_MIN as (-INT64_MAX-1), or -9223372036854775808 which GCC
-// complains about as `integer constant is so large that it is unsigned', so
-// set INT64_MIN to be one above that:
-#undef INT64_MIN
-#define INT64_MIN -9223372036854775807LL
-#endif
+// Fix AIX definitions of INT64_{MIN,MAX}
+#include "llvm/Support/DataTypesFix.h"
// Handle incorrect definition of uint64_t as u_int64_t
#ifndef HAVE_UINT64_T
diff --git a/include/llvm/Support/DataTypesFix.h b/include/llvm/Support/DataTypesFix.h
new file mode 100644
index 0000000000..c73998d1d3
--- /dev/null
+++ b/include/llvm/Support/DataTypesFix.h
@@ -0,0 +1,29 @@
+//===-- include/Support/DataTypesFix.h - Fix datatype defs ------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file overrides default system-defined types and limits which cannot be
+// done in DataTypes.h.in because it is processed by autoheader first, which
+// comments out any #undef statement
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SUPPORT_DATATYPESFIX_H
+#define SUPPORT_DATATYPESFIX_H
+
+#include "llvm/Config/config.h"
+
+#if defined(_POWER) && defined(_AIX)
+// GCC is strict about defining large constants: they must have LL modifier.
+#undef INT64_MAX
+#define INT64_MAX 9223372036854775807LL
+#undef INT64_MIN
+#define INT64_MIN (-INT64_MAX-1)
+#endif
+
+#endif /* SUPPORT_DATATYPESFIX_H */