aboutsummaryrefslogtreecommitdiff
path: root/x86_64-gen.c
diff options
context:
space:
mode:
authorgrischka <grischka>2017-07-09 12:38:25 +0200
committergrischka <grischka>2017-07-09 12:38:25 +0200
commitf87afa72e06842da1f1bb902e4a192195646134b (patch)
tree83dd60adf5948dfe0bf25c46d0f821d79d299b63 /x86_64-gen.c
parent9ba76ac834608f76b734674048a7cc4334051e32 (diff)
downloadtinycc-f87afa72e06842da1f1bb902e4a192195646134b.tar.gz
tinycc-f87afa72e06842da1f1bb902e4a192195646134b.tar.bz2
refactor enums
Eliminate VT_ENUM as a basic type. Instead use the integral types VT_InT/VT_LLONG with an additional flag to indicate that it is an enum.
Diffstat (limited to 'x86_64-gen.c')
-rw-r--r--x86_64-gen.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/x86_64-gen.c b/x86_64-gen.c
index feedc12..a71e209 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -415,9 +415,11 @@ void load(int r, SValue *sv)
} else if ((ft & VT_TYPE) == (VT_SHORT | VT_UNSIGNED)) {
b = 0xb70f; /* movzwl */
} else {
- assert(((ft & VT_BTYPE) == VT_INT) || ((ft & VT_BTYPE) == VT_LLONG)
- || ((ft & VT_BTYPE) == VT_PTR) || ((ft & VT_BTYPE) == VT_ENUM)
- || ((ft & VT_BTYPE) == VT_FUNC));
+ assert(((ft & VT_BTYPE) == VT_INT)
+ || ((ft & VT_BTYPE) == VT_LLONG)
+ || ((ft & VT_BTYPE) == VT_PTR)
+ || ((ft & VT_BTYPE) == VT_FUNC)
+ );
ll = is64_type(ft);
b = 0x8b;
}
@@ -1092,7 +1094,7 @@ static X86_64_Mode classify_x86_64_inner(CType *ty)
case VT_BOOL:
case VT_PTR:
case VT_FUNC:
- case VT_ENUM: return x86_64_mode_integer;
+ return x86_64_mode_integer;
case VT_FLOAT:
case VT_DOUBLE: return x86_64_mode_sse;