Permalink
Browse files

* Changed the checks in configure to check of intptr_t instead of uin…

…tptr_t

* Renamed functions in ToLLVM, because they conflicted in version 100
  • Loading branch information...
1 parent 7ccee99 commit d1bb2c344e2f3ef1952a715a63fc867662bd049f JohnVanSchie committed Jan 10, 2008
Showing with 61 additions and 65 deletions.
  1. +31 −31 EHC/configure
  2. +2 −2 EHC/configure.ac
  3. +4 −4 EHC/src/grinc/ConfigDefines.chs.in
  4. +20 −20 EHC/src/grinc/Silly/ToLLVM.cag
  5. +4 −8 EHC/src/rts/config.ch.in
View
@@ -2524,7 +2524,7 @@ LLVMC_CMD=$llvmcCmd
# AC_CHECK_SIZEOF([unsigned int])
# sizeof GrWord*, Pointer
-# AC_CHECK_SIZEOF([unsigned int *])
+# AC_CHECK_SIZEOF([nsigned int *])
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4081,9 +4081,9 @@ fi
done
-{ echo "$as_me:$LINENO: checking for uintptr_t" >&5
-echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_uintptr_t+set}" = set; then
+{ echo "$as_me:$LINENO: checking for intptr_t" >&5
+echo $ECHO_N "checking for intptr_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_intptr_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
@@ -4093,7 +4093,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef uintptr_t ac__type_new_;
+typedef intptr_t ac__type_new_;
int
main ()
{
@@ -4122,26 +4122,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_type_uintptr_t=yes
+ ac_cv_type_intptr_t=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_uintptr_t=no
+ ac_cv_type_intptr_t=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
-echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_type_intptr_t" >&5
+echo "${ECHO_T}$ac_cv_type_intptr_t" >&6; }
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of uintptr_t" >&5
-echo $ECHO_N "checking size of uintptr_t... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_uintptr_t+set}" = set; then
+{ echo "$as_me:$LINENO: checking size of intptr_t" >&5
+echo $ECHO_N "checking size of intptr_t... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_intptr_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
@@ -4153,7 +4153,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
- typedef uintptr_t ac__type_sizeof_;
+ typedef intptr_t ac__type_sizeof_;
int
main ()
{
@@ -4190,7 +4190,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
- typedef uintptr_t ac__type_sizeof_;
+ typedef intptr_t ac__type_sizeof_;
int
main ()
{
@@ -4244,7 +4244,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
- typedef uintptr_t ac__type_sizeof_;
+ typedef intptr_t ac__type_sizeof_;
int
main ()
{
@@ -4281,7 +4281,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
- typedef uintptr_t ac__type_sizeof_;
+ typedef intptr_t ac__type_sizeof_;
int
main ()
{
@@ -4345,7 +4345,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
- typedef uintptr_t ac__type_sizeof_;
+ typedef intptr_t ac__type_sizeof_;
int
main ()
{
@@ -4384,15 +4384,15 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
-?*) ac_cv_sizeof_uintptr_t=$ac_lo;;
-'') if test "$ac_cv_type_uintptr_t" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t)
+?*) ac_cv_sizeof_intptr_t=$ac_lo;;
+'') if test "$ac_cv_type_intptr_t" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (intptr_t)
See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (uintptr_t)
+echo "$as_me: error: cannot compute sizeof (intptr_t)
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }
else
- ac_cv_sizeof_uintptr_t=0
+ ac_cv_sizeof_intptr_t=0
fi ;;
esac
else
@@ -4403,7 +4403,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
- typedef uintptr_t ac__type_sizeof_;
+ typedef intptr_t ac__type_sizeof_;
static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
#include <stdio.h>
@@ -4455,34 +4455,34 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_sizeof_uintptr_t=`cat conftest.val`
+ ac_cv_sizeof_intptr_t=`cat conftest.val`
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
-if test "$ac_cv_type_uintptr_t" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t)
+if test "$ac_cv_type_intptr_t" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (intptr_t)
See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (uintptr_t)
+echo "$as_me: error: cannot compute sizeof (intptr_t)
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }
else
- ac_cv_sizeof_uintptr_t=0
+ ac_cv_sizeof_intptr_t=0
fi
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.val
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_uintptr_t" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_intptr_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_intptr_t" >&6; }
cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UINTPTR_T $ac_cv_sizeof_uintptr_t
+#define SIZEOF_INTPTR_T $ac_cv_sizeof_intptr_t
_ACEOF
View
@@ -275,8 +275,8 @@ AC_SUBST(LLVMC_CMD,$llvmcCmd)
# AC_CHECK_SIZEOF([unsigned int])
# sizeof GrWord*, Pointer
-# AC_CHECK_SIZEOF([unsigned int *])
-AC_CHECK_SIZEOF([uintptr_t])
+# AC_CHECK_SIZEOF([nsigned int *])
+AC_CHECK_SIZEOF([intptr_t])
AC_C_BIGENDIAN([AC_DEFINE([BIGENDIAN],[1]) AC_DEFINE([LITTLEENDIAN],[0])],
[AC_DEFINE([LITTLEENDIAN],[1]) AC_DEFINE([BIGENDIAN],[0])],
@@ -10,15 +10,15 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%[8 export(sizeofPointer)
-#undef SIZEOF_UINTPTR_T
+#undef SIZEOF_INTPTR_T
sizeofPointer :: Int
-sizeofPointer = SIZEOF_UINTPTR_T
+sizeofPointer = SIZEOF_INTPTR_T
%%]
%%[8 export(sizeofGrWord,use64Bits,use32Bits)
sizeofGrWord :: Integer
-sizeofGrWord = SIZEOF_UINTPTR_T
+sizeofGrWord = SIZEOF_INTPTR_T
use64Bits, use32Bits :: Bool
(use64Bits,use32Bits)
@@ -57,4 +57,4 @@ rtsGlobalVarPrefix = RTS_GLOBAL_VAR_PREFIX
rtsUseGC :: Bool
rtsUseGC = mkB USE_BOEHM_GC
-%%]
+%%]
@@ -270,18 +270,18 @@ SEM Statement
-- to a LLVMExpression and need to be reduced to a Var
loc.(uniqNr1,argVars,argStmts) =
foldr (\x xs -> let (nr,val,stmt) =
- expr2var (fst3 xs) x
- in ( nr, val : snd3 xs
- , stmt ++ (trd3 xs)
+ expr2var (fstTup3 xs) x
+ in ( nr, val : sndTup3 xs
+ , stmt ++ (trdTup3 xs)
)
) (@loc.uniqSeed,[],[]) @args.llvmExpr
-- Some arguments can be pointers and need to be casted
-- to inttypes
loc.(uniqNr2,castVars,castStmts) =
foldr (\x xs -> let (nr,val,stmt) =
- cast2int (fst3 xs) x @lhs.intType
- in ( nr, val : snd3 xs
- , stmt ++ (trd3 xs)
+ cast2int (fstTup3 xs) x @lhs.intType
+ in ( nr, val : sndTup3 xs
+ , stmt ++ (trdTup3 xs)
)
) (@loc.uniqNr1,[],[]) @loc.argVars
@@ -352,7 +352,7 @@ SEM Statement
loc.altStmts =
concatMap (( ++ [Stmt_Branch @loc.resumeLabel]) .
- trd3)
+ trdTup3)
@body.jumpTargets
loc.targets = map (\(x,y,z) -> (x,y)) @body.jumpTargets
@@ -455,18 +455,18 @@ SEM Value
-- to a LLVMExpression and need to be reduced to a Var
loc.(uniqNr1,argVars,argStmts) =
foldr (\x xs -> let (nr,val,stmt) =
- expr2var (fst3 xs) x
- in ( nr, val : snd3 xs
- , stmt ++ (trd3 xs)
+ expr2var (fstTup3 xs) x
+ in ( nr, val : sndTup3 xs
+ , stmt ++ (trdTup3 xs)
)
) (@loc.uniqSeed,[],[]) @args.llvmExpr
-- Some arguments can be pointers and need to be casted
-- to inttypes
loc.(uniqNr2,castVars,castStmts) =
foldr (\x xs -> let (nr,val,stmt) =
- cast2int (fst3 xs) x @lhs.intType
- in ( nr, val : snd3 xs
- , stmt ++ (trd3 xs)
+ cast2int (fstTup3 xs) x @lhs.intType
+ in ( nr, val : sndTup3 xs
+ , stmt ++ (trdTup3 xs)
)
) (@loc.uniqNr1,[],[]) @loc.argVars
-- We generate the formal parameters by generating new names
@@ -705,16 +705,16 @@ hs2str :: HsName -> String
hs2str = hsnShowAlphanumeric
-- Get the first element of a 3 tuple
-fst3 :: (a,b,c) -> a
-fst3 (x,_,_) = x
+fstTup3 :: (a,b,c) -> a
+fstTup3 (x,_,_) = x
-- Get the second element of a 3 tuple
-snd3 :: (a,b,c) -> b
-snd3 (_,x,_) = x
+sndTup3 :: (a,b,c) -> b
+sndTup3 (_,x,_) = x
-- Get the third element of a 3 tuple
-trd3 :: (a,b,c) -> c
-trd3 (_,_,x) = x
+trdTup3 :: (a,b,c) -> c
+trdTup3 (_,_,x) = x
primPatternMatchFailureFuncDecl :: FuncDecl
primPatternMatchFailureFuncDecl =
@@ -822,4 +822,4 @@ load2Value nr var
(nr2,var2,stmts2) = load2Value nr1 var1
in (nr2,var2, stmts1 ++ stmts2)
}
-%%]
+%%]
View
@@ -4,17 +4,13 @@
#undef USE_BOEHM_GC
/* size of Pointer/GrWord/... */
-#undef SIZEOF_UINTPTR_T
+#undef SIZEOF_INTPTR_T
/* size of Pointer */
-#undef SIZEOF_UNSIGNED_INT_P
-
-#define SIZEOF_POINTER SIZEOF_UINTPTR_T
+#define SIZEOF_POINTER SIZEOF_INTPTR_T
/* size of GrWord */
-#undef SIZEOF_UNSIGNED_INT
-
-#define SIZEOF_GRWORD SIZEOF_UINTPTR_T
+#define SIZEOF_GRWORD SIZEOF_INTPTR_T
%%]
@@ -24,7 +20,7 @@
%%]
%%[8
-#if SIZEOF_UINTPTR_T == 8
+#if SIZEOF_INTPTR_T == 8
#define USE_64_BITS 1
#define USE_32_BITS 0
#else

0 comments on commit d1bb2c3

Please sign in to comment.