diff options
Diffstat (limited to 'src/trans/mangling.cpp')
-rw-r--r-- | src/trans/mangling.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/trans/mangling.cpp b/src/trans/mangling.cpp new file mode 100644 index 00000000..4e47094c --- /dev/null +++ b/src/trans/mangling.cpp @@ -0,0 +1,29 @@ +/* + * MRustC - Rust Compiler + * - By John Hodge (Mutabah/thePowersGang) + * + * trans/mangling.hpp + * - Name mangling support + */ +#include "mangling.hpp" +#include <hir/type.hpp> +#include <hir/path.hpp> + +::std::string Trans_Mangle(const ::HIR::GenericPath& path) +{ + ::std::stringstream ss; + ss << "_ZN" << path.m_path.m_crate_name.size() << path.m_path.m_crate_name; + for(const auto& comp : path.m_path.m_components) + ss << comp.size() << comp; + + return ss.str(); +} +::std::string Trans_Mangle(const ::HIR::Path& path) +{ + return ""; +} +::std::string Trans_Mangle(const ::HIR::TypeRef& ty) +{ + return ""; +} + |