aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-06-28 14:59:52 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-14 00:04:55 +0200
commitfa09d838d4b241c98f85657669e11f207d26d4fd (patch)
tree2e88c50b829a0a2c5c42130d5574324624ab310d
parent165d99c40f65c0f84252b6e8be754349c25f639e (diff)
downloadsparse-fa09d838d4b241c98f85657669e11f207d26d4fd.tar.gz
arch: add predefines __INT_LEAST${N}_TYPE__
These are used by some system headers (neon on arm64). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--predefine.c9
-rw-r--r--target-x86.c2
-rw-r--r--target.c8
-rw-r--r--target.h8
4 files changed, 27 insertions, 0 deletions
diff --git a/predefine.c b/predefine.c
index 94952e81..062e754b 100644
--- a/predefine.c
+++ b/predefine.c
@@ -145,6 +145,15 @@ void predefined_macros(void)
predefined_ctype("INT64", int64_ctype, PTYPE_MAX|PTYPE_TYPE);
predefined_ctype("UINT64", uint64_ctype, PTYPE_MAX|PTYPE_TYPE);
+ predefined_ctype("INT_LEAST8", &schar_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
+ predefined_ctype("UINT_LEAST8", &uchar_ctype, PTYPE_MAX|PTYPE_TYPE);
+ predefined_ctype("INT_LEAST16", &short_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
+ predefined_ctype("UINT_LEAST16",&ushort_ctype, PTYPE_MAX|PTYPE_TYPE);
+ predefined_ctype("INT_LEAST32", int32_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
+ predefined_ctype("UINT_LEAST32", uint32_ctype, PTYPE_MAX|PTYPE_TYPE);
+ predefined_ctype("INT_LEAST64", int64_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
+ predefined_ctype("UINT_LEAST64", uint64_ctype, PTYPE_MAX|PTYPE_TYPE);
+
predefined_ctype("INTMAX", intmax_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
predefined_ctype("UINTMAX", uintmax_ctype, PTYPE_MAX|PTYPE_TYPE);
predefined_ctype("INTPTR", ssize_t_ctype, PTYPE_MAX|PTYPE_TYPE|PTYPE_WIDTH);
diff --git a/target-x86.c b/target-x86.c
index 62323aec..956af92e 100644
--- a/target-x86.c
+++ b/target-x86.c
@@ -82,6 +82,8 @@ static void init_x86_64(const struct target *target)
uint64_ctype = &ullong_ctype;
intmax_ctype = &llong_ctype;
uintmax_ctype = &ullong_ctype;
+ least64_ctype = &long_ctype;
+ uleast64_ctype = &ulong_ctype;
break;
}
}
diff --git a/target.c b/target.c
index cbb25724..e2eb78e2 100644
--- a/target.c
+++ b/target.c
@@ -15,6 +15,14 @@ struct symbol *int32_ctype = &int_ctype;
struct symbol *uint32_ctype = &uint_ctype;
struct symbol *wchar_ctype = &int_ctype;
struct symbol *wint_ctype = &uint_ctype;
+struct symbol *least8_ctype = &schar_ctype;
+struct symbol *uleast8_ctype = &uchar_ctype;
+struct symbol *least16_ctype = &short_ctype;
+struct symbol *uleast16_ctype = &ushort_ctype;
+struct symbol *least32_ctype = &int_ctype;
+struct symbol *uleast32_ctype = &uint_ctype;
+struct symbol *least64_ctype = &llong_ctype;
+struct symbol *uleast64_ctype = &ullong_ctype;
/*
* For "__attribute__((aligned))"
diff --git a/target.h b/target.h
index fdf31129..4140b77c 100644
--- a/target.h
+++ b/target.h
@@ -13,6 +13,14 @@ extern struct symbol *int32_ctype;
extern struct symbol *uint32_ctype;
extern struct symbol *wchar_ctype;
extern struct symbol *wint_ctype;
+extern struct symbol *least8_ctype;
+extern struct symbol *uleast8_ctype;
+extern struct symbol *least16_ctype;
+extern struct symbol *uleast16_ctype;
+extern struct symbol *least32_ctype;
+extern struct symbol *uleast32_ctype;
+extern struct symbol *least64_ctype;
+extern struct symbol *uleast64_ctype;
/*
* For "__attribute__((aligned))"