compiler/codegen/symbol.cpp
// Alter the C code type to avoid _ref_, c_ptr_ prefixes and instead use a
// type that C understands without additional information (e.g. instead of
// _ref_int64_t, just int64_t *).  But only for exported symbols like the
// return type of exported functions, or arguments of those functions.
//
// TODO: apply to _ddata as well?
Alter the C code type to avoid _ref_, c_ptr_ prefixes and instead use a
type that C understands without additional information .  But only for exported symbols like the
return type of exported functions, or arguments of those functions.


Alter the C code type to avoid _ref_ c_ptr_ prefixes and instead use a type that C understands without additional information . But only for exported symbols like the return type of exported functions or arguments of those functions .
static std::string
transformTypeForPointer(Type* type) {
  std::string typeName = type->codegen().c;
  if (type->symbol->hasFlag(FLAG_REF)) {
    Type* referenced = type->getValType();
    return referenced->codegen().c + " *";
  } else if (type->symbol->hasFlag(FLAG_C_PTR_CLASS)) {
    Type* pointedTo = getDataClassType(type->symbol)->typeInfo();
    return pointedTo->codegen().c + " *";
  }
  return typeName;
}
static std :: string transformTypeForPointer ( Type * type ) { std :: string typeName = type -> codegen ( ) . c ; if ( type -> symbol -> hasFlag ( FLAG_REF ) ) { Type * referenced = type -> getValType ( ) ; return referenced -> codegen ( ) . c + " " ; } else if ( type -> symbol -> hasFlag ( FLAG_C_PTR_CLASS ) ) { Type * pointedTo = getDataClassType ( type -> symbol ) -> typeInfo ( ) ; return pointedTo -> codegen ( ) . c + " " ; } return typeName ; }
Alter the C code type to avoid _ref_, c_ptr_ prefixes and instead use a
type that C understands without additional information (e.g.
Alter the C code type to avoid _ref_ c_ptr_ prefixes and instead use a type that C understands without additional information ( e . g .