From 9204a6b3958a56a6624b4752047ed941f54ab5cc Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 11 Jan 2017 21:47:01 +0800 Subject: HIR - Static link_name (partial support) --- src/hir/from_ast.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/hir/from_ast.cpp') 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), -- cgit v1.2.3