1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

[FunC] CMake option -DFUNC_DEBUG for development purposes

Seeing function name in debugger
makes it much easier to delve into FunC sources
This commit is contained in:
Aleksandr Kirsanov 2024-04-20 23:13:10 +03:00
parent a5d2a1003f
commit cbd78964c5
No known key found for this signature in database
GPG key ID: B758BBAA01FFB3D3
4 changed files with 28 additions and 0 deletions

View file

@ -51,6 +51,9 @@ template <typename T>
SymDef* define_builtin_func(std::string name, TypeExpr* func_type, const T& func, bool impure = false) {
SymDef* def = predefine_builtin_func(name, func_type);
def->value = new SymValAsmFunc{func_type, func, impure};
#ifdef FUNC_DEBUG
dynamic_cast<SymValAsmFunc*>(def->value)->name = name;
#endif
return def;
}
@ -59,6 +62,9 @@ SymDef* define_builtin_func(std::string name, TypeExpr* func_type, const T& func
std::initializer_list<int> ret_order = {}, bool impure = false) {
SymDef* def = predefine_builtin_func(name, func_type);
def->value = new SymValAsmFunc{func_type, func, arg_order, ret_order, impure};
#ifdef FUNC_DEBUG
dynamic_cast<SymValAsmFunc*>(def->value)->name = name;
#endif
return def;
}
@ -67,6 +73,9 @@ SymDef* define_builtin_func(std::string name, TypeExpr* func_type, const AsmOp&
bool impure = false) {
SymDef* def = predefine_builtin_func(name, func_type);
def->value = new SymValAsmFunc{func_type, make_simple_compile(macro), arg_order, ret_order, impure};
#ifdef FUNC_DEBUG
dynamic_cast<SymValAsmFunc*>(def->value)->name = name;
#endif
return def;
}