case TYPE_TYPEOF:
case TYPE_TYPEDEF:
- case TYPE_INVALID:
break;
}
if (firm_type == NULL)
/* typedef/typeof should be skipped already */
case TYPE_TYPEDEF:
case TYPE_TYPEOF:
- case TYPE_INVALID:
case TYPE_ERROR:
break;
}
static char get_atomic_type_mangle(atomic_type_kind_t kind)
{
switch (kind) {
- case ATOMIC_TYPE_INVALID: break;
+ case ATOMIC_TYPE_INVALID: break;
case ATOMIC_TYPE_VOID: return 'v';
case ATOMIC_TYPE_WCHAR_T: return 'w';
case ATOMIC_TYPE_BOOL: return 'b';
case TYPE_IMAGINARY:
mangle_imaginary_type(&type->imaginary);
return;
- case TYPE_INVALID:
- panic("invalid type encountered while mangling");
case TYPE_ERROR:
panic("error type encountered while mangling");
case TYPE_TYPEDEF:
case TYPE_ERROR:
print_string("<error>");
return;
- case TYPE_INVALID:
- print_string("<invalid>");
- return;
case TYPE_ENUM:
print_type_enum(&type->enumt);
return;
print_array_type_post(&type->array);
return;
case TYPE_ERROR:
- case TYPE_INVALID:
case TYPE_ATOMIC:
case TYPE_COMPLEX:
case TYPE_IMAGINARY:
return identify_new_type(copy);
}
-/**
- * Check if a type is valid.
- *
- * @param type The type to check.
- * @return true if type represents a valid type.
- */
-bool type_valid(const type_t *type)
-{
- return type->kind != TYPE_INVALID;
-}
-
static bool test_atomic_type_flag(atomic_type_kind_t kind,
atomic_type_flag_t flag)
{
case TYPE_TYPEDEF:
case TYPE_TYPEOF:
panic("is_type_incomplete called without typerefs skipped");
- case TYPE_INVALID:
- break;
}
panic("invalid type found");
case TYPE_ERROR:
/* Hmm, the error type should be compatible to all other types */
return true;
- case TYPE_INVALID:
- panic("invalid type found in compatible types");
case TYPE_TYPEDEF:
case TYPE_TYPEOF:
panic("typerefs not skipped in compatible types?!?");
unsigned get_type_size(type_t *type)
{
switch (type->kind) {
- case TYPE_INVALID:
- break;
case TYPE_ERROR:
return 0;
case TYPE_ATOMIC:
unsigned get_type_alignment(type_t *type)
{
switch (type->kind) {
- case TYPE_INVALID:
- break;
case TYPE_ERROR:
return 0;
case TYPE_ATOMIC:
decl_modifiers_t get_type_modifiers(const type_t *type)
{
switch(type->kind) {
- case TYPE_INVALID:
case TYPE_ERROR:
break;
case TYPE_COMPOUND_STRUCT:
bool is_type_real(const type_t *type);
-/**
- * returns true if the type is valid. A type is valid if it contains no
- * unresolved references anymore and is not of TYPE_INVALID.
- */
-bool type_valid(const type_t *type);
-
/**
* returns true if the type is an arithmetic type (ยง6.2.5 clause 18)
*/
unsigned hash = 0;
switch (type->kind) {
- case TYPE_INVALID:
- panic("internalizing void or invalid types not possible");
case TYPE_ERROR:
return 0;
case TYPE_ATOMIC:
case TYPE_ERROR:
/* Hmm, the error type is never equal */
return false;
- case TYPE_INVALID:
- return false;
case TYPE_ATOMIC:
return atomic_types_equal(&type1->atomic, &type2->atomic);
case TYPE_COMPLEX:
#include "adt/obst.h"
typedef enum type_kind_t {
- TYPE_INVALID,
TYPE_ERROR,
TYPE_ATOMIC,
TYPE_COMPLEX,
case TYPE_ENUM:
walk_entity((entity_t*)type->enumt.enume, env);
return;
- case TYPE_INVALID:
- break;
}
panic("invalid type found");
}
case TYPE_FUNCTION:
write_function_type(&type->function);
return;
- case TYPE_INVALID:
- panic("invalid type found");
case TYPE_COMPLEX:
case TYPE_IMAGINARY:
default:
write_enum_type(&type->enumt);
return;
case TYPE_ERROR:
- case TYPE_INVALID:
case TYPE_TYPEOF:
case TYPE_TYPEDEF:
panic("invalid type found");