5[[maybe_unused]]
static auto length_encode(
const string& name) ->
string {
6 return std::to_string(name.length()) + name;
16 for (
const auto& i : llvm::enumerate(fn.arg_types())) {
23 if (
auto ret = fn.ret(); ret.has_value())
31 if (
const auto* ptr_type = ast_type.base_dyn_cast<
ty::Ptr>()) {
35 }
else if (
const auto* generic_type = ast_type.base_dyn_cast<
ty::Generic>()) {
36 auto match = parent.subs()->find_type(generic_type->name());
37 YUME_ASSERT(match.has_value(),
"Cannot mangle unsubstituted generic");
40 ss << ast_type.base_name();
43 if (ast_type.is_mut())
46 if (ast_type.is_ref())
49 if (ast_type.is_meta())
An unsubstituted generic type variable, usually something like T.
A "qualified" type, with a stackable qualifier, i.e. ptr.
A "qualified" type, with a non-stackable qualifier, i.e. mut.
static auto length_encode(const string &name) -> string
auto mangle_name(Fn &fn) -> string
A common base between declarations in the compiler: Fn, Struct and Const. Its value may also be absen...
A function declaration in the compiler.
#define YUME_ASSERT(assertion, message)