Make default calling convention code more correct to read

This commit is contained in:
gingerBill
2021-06-08 14:33:49 +01:00
parent 76bb82a726
commit f19bb0f4d4
5 changed files with 31 additions and 16 deletions

View File

@@ -676,11 +676,17 @@ OdinDocTypeIndex odin_doc_type(OdinDocWriter *w, Type *type) {
String calling_convention = {};
switch (type->Proc.calling_convention) {
case ProcCC_Invalid:
case ProcCC_Odin:
// no need
break;
case ProcCC_Odin:
if (default_calling_convention() != ProcCC_Odin) {
calling_convention = str_lit("odin");
}
break;
case ProcCC_Contextless:
calling_convention = str_lit("contextless");
if (default_calling_convention() != ProcCC_Contextless) {
calling_convention = str_lit("contextless");
}
break;
case ProcCC_CDecl:
calling_convention = str_lit("cdecl");