On 10/23/2011 08:37 AM, penberg@xxxxxxxxxxxxxx wrote:
From: Pekka Enberg<penberg@xxxxxxxxxx>
This patch is needed to fix the sparsec LLVM backend data type sizes.
Cc: Christopher Li<sparse@xxxxxxxxxxx>
Cc: Jeff Garzik<jgarzik@xxxxxxxxxx>
Cc: Linus Torvalds<torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Pekka Enberg<penberg@xxxxxxxxxx>
---
target.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/target.c b/target.c
index 6a535bc..009002f 100644
--- a/target.c
+++ b/target.c
@@ -17,9 +17,9 @@ int max_alignment = 16;
int bits_in_bool = 8;
int bits_in_char = 8;
int bits_in_short = 16;
-int bits_in_int = 32;
-int bits_in_long = 32;
-int bits_in_longlong = 64;
+int bits_in_int = sizeof(int) * 8;
+int bits_in_long = sizeof(long) * 8;
+int bits_in_longlong = sizeof(long long) * 8;
int bits_in_longlonglong = 128;
int max_int_alignment = 4;
@@ -36,8 +36,8 @@ int max_fp_alignment = 8;
/*
* Pointer data type
*/
-int bits_in_pointer = 32;
-int pointer_alignment = 4;
+int bits_in_pointer = sizeof(void *) * 8;
+int pointer_alignment = sizeof(void *);
No objection, but ideally we should select from a target template.
We don't want to start down the road of making runtime target switching
(i386/x86-64) difficult.
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html