projects
/
cparser
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Put { of function on separate line.
[cparser]
/
mangle.c
diff --git
a/mangle.c
b/mangle.c
index
b7d2bec
..
bcd78d6
100644
(file)
--- a/
mangle.c
+++ b/
mangle.c
@@
-222,7
+222,6
@@
static void mangle_type(type_t *orig_type)
case TYPE_BITFIELD:
panic("no mangling for this type implemented yet");
case TYPE_BITFIELD:
panic("no mangling for this type implemented yet");
- break;
}
panic("invalid type encountered while mangling");
}
}
panic("invalid type encountered while mangling");
}
@@
-281,7
+280,7
@@
ident *create_name_win32(entity_t *entity)
switch (entity->declaration.type->function.linkage) {
case LINKAGE_INVALID:
switch (entity->declaration.type->function.linkage) {
case LINKAGE_INVALID:
-
break
;
+
panic("linkage type of function is invalid")
;
case LINKAGE_C:
obstack_printf(o, "%s", entity->base.symbol->string);
case LINKAGE_C:
obstack_printf(o, "%s", entity->base.symbol->string);
@@
-331,7
+330,9
@@
ident *create_name_linux_elf(entity_t *entity)
if (entity->kind == ENTITY_FUNCTION) {
switch (entity->declaration.type->function.linkage) {
if (entity->kind == ENTITY_FUNCTION) {
switch (entity->declaration.type->function.linkage) {
- case LINKAGE_INVALID: break;
+ case LINKAGE_INVALID:
+ panic("linkage type of function is invalid");
+
case LINKAGE_C: break;
case LINKAGE_CXX: needs_mangling = true; break;
}
case LINKAGE_C: break;
case LINKAGE_CXX: needs_mangling = true; break;
}
@@
-353,6
+354,9
@@
ident *create_name_linux_elf(entity_t *entity)
*/
ident *create_name_macho(entity_t *entity)
{
*/
ident *create_name_macho(entity_t *entity)
{
+ if (entity->kind == ENTITY_FUNCTION && entity->declaration.type->function.linkage == LINKAGE_INVALID)
+ panic("linkage type of function is invalid");
+
obstack_printf(&obst, "_%s", entity->base.symbol->string);
return make_id_from_obst();
}
obstack_printf(&obst, "_%s", entity->base.symbol->string);
return make_id_from_obst();
}