diff options
author | John Hodge <tpg@mutabah.net> | 2017-01-11 21:47:01 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2017-01-11 21:47:01 +0800 |
commit | 9204a6b3958a56a6624b4752047ed941f54ab5cc (patch) | |
tree | 8cba811f2e7fc812dffa1eb44ef97938b63ba02e /src/hir/from_ast.cpp | |
parent | d8e1c31c2158f60ce19a09723904ab0b71f7c27a (diff) | |
download | mrust-9204a6b3958a56a6624b4752047ed941f54ab5cc.tar.gz |
HIR - Static link_name (partial support)
Diffstat (limited to 'src/hir/from_ast.cpp')
-rw-r--r-- | src/hir/from_ast.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp index 927239ff..834b0e95 100644 --- a/src/hir/from_ast.cpp +++ b/src/hir/from_ast.cpp @@ -1224,6 +1224,13 @@ void _add_mod_val_item(::HIR::Module& mod, ::std::string name, bool is_pub, ::H })); else { ::HIR::Linkage linkage; + + // If there's no code, demangle the name (TODO: By ABI) and set linkage. + if( linkage.name == "" && ! e.value().is_valid() ) + { + linkage.name = item.name; + } + _add_mod_val_item(mod, item.name, item.is_pub, ::HIR::ValueItem::make_Static(::HIR::Static { mv$(linkage), (e.s_class() == ::AST::Static::MUT), |