[llvm-commits] [compiler-rt] r144669 - in /compiler-rt/trunk/lib: endianness.h int_endianness.h int_lib.h int_types.h

Daniel Dunbar daniel at zuster.org
Tue Nov 15 10:56:21 PST 2011


Author: ddunbar
Date: Tue Nov 15 12:56:21 2011
New Revision: 144669

URL: http://llvm.org/viewvc/llvm-project?rev=144669&view=rev
Log:
lib: Rename endianness.h to int_endianness.h (for consistency) and tidy up a bit.

Added:
    compiler-rt/trunk/lib/int_endianness.h
      - copied, changed from r144668, compiler-rt/trunk/lib/endianness.h
Removed:
    compiler-rt/trunk/lib/endianness.h
Modified:
    compiler-rt/trunk/lib/int_lib.h
    compiler-rt/trunk/lib/int_types.h

Removed: compiler-rt/trunk/lib/endianness.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/endianness.h?rev=144668&view=auto
==============================================================================
--- compiler-rt/trunk/lib/endianness.h (original)
+++ compiler-rt/trunk/lib/endianness.h (removed)
@@ -1,94 +0,0 @@
-/* ===-- endianness.h - configuration header for compiler-rt ---------------===
- *
- *		       The LLVM Compiler Infrastructure
- *
- * This file is dual licensed under the MIT and the University of Illinois Open
- * Source Licenses. See LICENSE.TXT for details.
- *
- * ===----------------------------------------------------------------------===
- *
- * This file is a configuration header for compiler-rt.
- * This file is not part of the interface of this library.
- *
- * ===----------------------------------------------------------------------===
- */
-
-#ifndef ENDIANNESS_H
-#define ENDIANNESS_H
-
-/*
- * Known limitations:
- *   Middle endian systems are not handled currently.
- */
-
-#if defined(__SVR4) && defined(__sun)
-#include <sys/byteorder.h>
-
-#if _BYTE_ORDER == _BIG_ENDIAN
-#define _YUGA_LITTLE_ENDIAN 0
-#define _YUGA_BIG_ENDIAN    1
-#elif _BYTE_ORDER == _LITTLE_ENDIAN 
-#define _YUGA_LITTLE_ENDIAN 1
-#define _YUGA_BIG_ENDIAN    0
-#endif /* _BYTE_ORDER */
-
-#endif /* Solaris and AuroraUX. */
-
-/* .. */
-
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-#include <sys/endian.h>
-
-#if _BYTE_ORDER == _BIG_ENDIAN
-#define _YUGA_LITTLE_ENDIAN 0
-#define _YUGA_BIG_ENDIAN    1
-#elif _BYTE_ORDER == _LITTLE_ENDIAN
-#define _YUGA_LITTLE_ENDIAN 1
-#define _YUGA_BIG_ENDIAN    0
-#endif /* _BYTE_ORDER */
-
-#endif /* *BSD */
-
-/* .. */
-
-/* Mac OSX has __BIG_ENDIAN__ or __LITTLE_ENDIAN__ automatically set by the compiler (at least with GCC) */
-#if defined(__APPLE__) && defined(__MACH__) || defined(__ellcc__ )
-
-#ifdef __BIG_ENDIAN__
-#if __BIG_ENDIAN__
-#define _YUGA_LITTLE_ENDIAN 0
-#define _YUGA_BIG_ENDIAN    1
-#endif
-#endif /* __BIG_ENDIAN__ */
-
-#ifdef __LITTLE_ENDIAN__
-#if __LITTLE_ENDIAN__
-#define _YUGA_LITTLE_ENDIAN 1
-#define _YUGA_BIG_ENDIAN    0
-#endif
-#endif /* __LITTLE_ENDIAN__ */
-
-#endif /* Mac OSX */
-
-/* .. */
-
-#if defined(__linux__)
-#include <endian.h>
-
-#if __BYTE_ORDER == __BIG_ENDIAN
-#define _YUGA_LITTLE_ENDIAN 0
-#define _YUGA_BIG_ENDIAN    1
-#elif __BYTE_ORDER == __LITTLE_ENDIAN
-#define _YUGA_LITTLE_ENDIAN 1
-#define _YUGA_BIG_ENDIAN    0
-#endif /* __BYTE_ORDER */
-
-#endif /* GNU/Linux */
-
-/* . */
-
-#if !defined(_YUGA_LITTLE_ENDIAN) || !defined(_YUGA_BIG_ENDIAN)
-#error Unable to determine endian
-#endif /* Check we found an endianness correctly. */
-
-#endif /* ENDIANNESS_H */

Copied: compiler-rt/trunk/lib/int_endianness.h (from r144668, compiler-rt/trunk/lib/endianness.h)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/int_endianness.h?p2=compiler-rt/trunk/lib/int_endianness.h&p1=compiler-rt/trunk/lib/endianness.h&r1=144668&r2=144669&rev=144669&view=diff
==============================================================================
--- compiler-rt/trunk/lib/endianness.h (original)
+++ compiler-rt/trunk/lib/int_endianness.h Tue Nov 15 12:56:21 2011
@@ -1,4 +1,4 @@
-/* ===-- endianness.h - configuration header for compiler-rt ---------------===
+/* ===-- int_endianness.h - configuration header for compiler-rt ------------===
  *
  *		       The LLVM Compiler Infrastructure
  *
@@ -13,13 +13,8 @@
  * ===----------------------------------------------------------------------===
  */
 
-#ifndef ENDIANNESS_H
-#define ENDIANNESS_H
-
-/*
- * Known limitations:
- *   Middle endian systems are not handled currently.
- */
+#ifndef INT_ENDIANNESS_H
+#define INT_ENDIANNESS_H
 
 #if defined(__SVR4) && defined(__sun)
 #include <sys/byteorder.h>
@@ -91,4 +86,4 @@
 #error Unable to determine endian
 #endif /* Check we found an endianness correctly. */
 
-#endif /* ENDIANNESS_H */
+#endif /* INT_ENDIANNESS_H */

Modified: compiler-rt/trunk/lib/int_lib.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/int_lib.h?rev=144669&r1=144668&r2=144669&view=diff
==============================================================================
--- compiler-rt/trunk/lib/int_lib.h (original)
+++ compiler-rt/trunk/lib/int_lib.h Tue Nov 15 12:56:21 2011
@@ -16,6 +16,10 @@
 #ifndef INT_LIB_H
 #define INT_LIB_H
 
+/* Assumption: Signed integral is 2's complement. */
+/* Assumption: Right shift of signed negative is arithmetic shift. */
+/* Assumption: Endianness is little or big (not mixed). */
+
 /* ABI macro definitions */
 
 #if __ARM_EABI__
@@ -27,12 +31,8 @@
 # define COMPILER_RT_ABI
 #endif
 
-/* Assumption:  signed integral is 2's complement */
-/* Assumption:  right shift of signed negative is arithmetic shift */
-
 #include <limits.h>
 #include <stdint.h>
-#include "endianness.h"
 #include <math.h>
 
 /* If compiling for kernel use, call panic() instead of abort(). */

Modified: compiler-rt/trunk/lib/int_types.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/int_types.h?rev=144669&r1=144668&r2=144669&view=diff
==============================================================================
--- compiler-rt/trunk/lib/int_types.h (original)
+++ compiler-rt/trunk/lib/int_types.h Tue Nov 15 12:56:21 2011
@@ -18,7 +18,7 @@
 #ifndef INT_TYPES_H
 #define INT_TYPES_H
 
-#include "endianness.h"
+#include "int_endianness.h"
 
 typedef      int si_int;
 typedef unsigned su_int;





More information about the llvm-commits mailing list