}
switch (type->function.linkage) {
- case LINKAGE_INVALID:
- panic("linkage type of function is invalid");
-
case LINKAGE_C:
obstack_printf(o, "%s", entity->base.symbol->string);
break;
type_t *type = skip_typeref(entity->declaration.type);
assert(is_type_function(type));
switch (type->function.linkage) {
- case LINKAGE_INVALID:
- panic("linkage type of function is invalid");
case LINKAGE_C:
if (entity->function.actual_name != NULL)
name = entity->function.actual_name->string;
assert(is_type_function(type));
switch (type->function.linkage) {
- case LINKAGE_INVALID:
- panic("linkage type of function is invalid");
-
default:
if (entity->function.actual_name != NULL)
return new_id_from_str(entity->function.actual_name->string);
static statement_t *current_loop = NULL;
static statement_t *current_parent = NULL;
static ms_try_statement_t *current_try = NULL;
-static linkage_kind_t current_linkage = LINKAGE_INVALID;
+static linkage_kind_t current_linkage;
static goto_statement_t *goto_first = NULL;
static goto_statement_t **goto_anchor = NULL;
static label_statement_t *label_first = NULL;
static entity_t *get_entity(const symbol_t *const symbol,
namespace_tag_t namespc)
{
- assert(namespc != NAMESPACE_INVALID);
entity_t *entity = symbol->entity;
for (; entity != NULL; entity = entity->base.symbol_next) {
if ((namespace_tag_t)entity->base.namespc == namespc)
{
symbol_t *symbol = entity->base.symbol;
entity_namespace_t namespc = entity->base.namespc;
- assert(namespc != NAMESPACE_INVALID);
+ assert(namespc != 0);
/* replace/add entity into entity list of the symbol */
entity_t **anchor;
}
typedef enum construct_type_kind_t {
- CONSTRUCT_INVALID,
- CONSTRUCT_POINTER,
+ CONSTRUCT_POINTER = 1,
CONSTRUCT_REFERENCE,
CONSTRUCT_FUNCTION,
CONSTRUCT_ARRAY
for (; iter != NULL; iter = iter->base.next) {
source_position_t const* const pos = &iter->base.pos;
switch (iter->kind) {
- case CONSTRUCT_INVALID:
- break;
case CONSTRUCT_FUNCTION: {
construct_function_type_t *function = &iter->function;
type_t *function_type = function->function_type;
new_linkage = LINKAGE_CXX;
} else {
errorf(&pos, "linkage string \"%s\" not recognized", linkage);
- new_linkage = LINKAGE_INVALID;
+ new_linkage = LINKAGE_C;
}
current_linkage = new_linkage;
/** Linkage specifications. */
typedef enum linkage_kind_t {
- LINKAGE_INVALID,
- LINKAGE_C, /**< C linkage. */
+ LINKAGE_C = 1, /**< C linkage. */
LINKAGE_CXX /**< C++ linkage. */
} linkage_kind_t;