we can do without the odd align.h
authorMatthias Braun <matze@braunis.de>
Wed, 19 May 2010 11:44:44 +0000 (11:44 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 19 May 2010 11:44:44 +0000 (11:44 +0000)
[r27545]

include/libfirm/adt/align.h [deleted file]
include/libfirm/adt/array.h
ir/adt/pdeq.c
ir/libcore/lc_defines.h

diff --git a/include/libfirm/adt/align.h b/include/libfirm/adt/align.h
deleted file mode 100644 (file)
index feda6c3..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief       macros for alignment.
- * @author      Markus Armbruster
- * @version     $Id$
- */
-#ifndef FIRM_ADT_ALIGN_H
-#define FIRM_ADT_ALIGN_H
-
-#include <stddef.h>
-
-/** A size handled efficiently by malloc(), at least 1K.  */
-#define PREF_MALLOC_SIZE 2048
-
-
-/** A wrapper around GNU C's __attribute__ */
-
-/* According to the documentation, the attributes we are interested in
-   work with 2.5, but we encountered trouble before 2.7.  */
-#if defined (__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 7
-# define HAVE_ATTRIBUTE 1
-# define ATTRIBUTE(attrs) __attribute__ (attrs)
-#else
-# define ATTRIBUTE(attrs)
-#endif
-
-
-/* Alignment */
-
-/** A type that has most constrained alignment.  */
-typedef union {
-  long double d;
-  void *p;
-  long l;
-} aligned_type ATTRIBUTE ((aligned));
-
-/** Inquiring about the alignment of a type.  */
-#ifdef __GNUC__
-# define ALIGNOF(type) __alignof__ (type)
-#else
-# define ALIGNOF(type) offsetof (struct { char c; type d; }, d)
-#endif
-
-/** Maximal alignment required for any type.  */
-#define MAX_ALIGN ALIGNOF (aligned_type)
-
-#endif
index d84c8f1..52a598b 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "obst.h"
 #include "fourcc.h"
-#include "align.h"
 #include "xmalloc.h"
 
 /**
     assert((0 <= (idx)) && ((idx) < ARR_LEN((arr))))
 #endif
 
+/** A type that has most constrained alignment.  */
+typedef union {
+  long double d;
+  void *p;
+  long l;
+} aligned_type;
 
 /**
  * Construct an array header.
index 642fd35..8d596d0 100644 (file)
@@ -43,6 +43,9 @@
 /** Size of pdeq block cache. */
 #define TUNE_NSAVED_PDEQS 16
 
+/** A size handled efficiently by malloc(), at least 1K.  */
+#define PREF_MALLOC_SIZE 2048
+
 /**
  * Maximal number of data items in a pdeq chunk.
  */
index 6221004..54e637b 100644 (file)
 #define LC_FOURCC(a,b,c,d)        ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
 #define LC_FOURCC_STR(str)                       LC_FOURCC(str[0], str[1], str[2], str[3])
 
-#define LC_OFFSETOF(type,memb)   ((char *) &((type *) 0)->memb - (char *) 0)
-
-#ifdef __GNUC__
-#define LC_ALIGNOF(type)                                 __alignof__(type)
-#else
-#define LC_ALIGNOF(type)                                 LC_OFFSETOF(struct { char c; type d; }, d)
-#endif
-
-#define LC_PTR2INT(x) (((char *)(x)) - (char *)0)
-#define LC_INT2PTR(x) (((char *)(x)) + (char *)0)
-
 #endif