Browse Source

Add "none" calling convention

gingerBill 6 years ago
parent
commit
64bd884d94
4 changed files with 8 additions and 0 deletions
  1. 1 0
      src/ir_print.cpp
  2. 1 0
      src/parser.cpp
  3. 3 0
      src/parser.hpp
  4. 3 0
      src/types.cpp

+ 1 - 0
src/ir_print.cpp

@@ -1052,6 +1052,7 @@ void ir_print_calling_convention(irFileBuffer *f, irModule *m, ProcCallingConven
 	case ProcCC_CDecl:       ir_write_str_lit(f, "ccc ");   break;
 	case ProcCC_StdCall:     ir_write_str_lit(f, "cc 64 "); break;
 	case ProcCC_FastCall:    ir_write_str_lit(f, "cc 65 "); break;
+	case ProcCC_None:        ir_write_str_lit(f, "");       break;
 	default: GB_PANIC("unknown calling convention: %d", cc);
 	}
 }

+ 1 - 0
src/parser.cpp

@@ -2700,6 +2700,7 @@ ProcCallingConvention string_to_calling_convention(String s) {
 	if (s == "std")         return ProcCC_StdCall;
 	if (s == "fastcall")    return ProcCC_FastCall;
 	if (s == "fast")        return ProcCC_FastCall;
+	if (s == "none")        return ProcCC_None;
 	return ProcCC_Invalid;
 }
 

+ 3 - 0
src/parser.hpp

@@ -166,6 +166,9 @@ enum ProcCallingConvention {
 	// ProcCC_VectorCall,
 	// ProcCC_ClrCall,
 
+	ProcCC_None,
+
+
 	ProcCC_ForeignBlockDefault = -1,
 };
 

+ 3 - 0
src/types.cpp

@@ -2894,6 +2894,9 @@ gbString write_type_to_string(gbString str, Type *type) {
 		case ProcCC_FastCall:
 			str = gb_string_appendc(str, " \"fastcall\" ");
 			break;
+		case ProcCC_None:
+			str = gb_string_appendc(str, " \"none\" ");
+			break;
 		// case ProcCC_VectorCall:
 		// 	str = gb_string_appendc(str, " \"vectorcall\" ");
 		// 	break;