summaryrefslogtreecommitdiff
path: root/tools/standalone_miri/module_tree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/standalone_miri/module_tree.cpp')
-rw-r--r--tools/standalone_miri/module_tree.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/standalone_miri/module_tree.cpp b/tools/standalone_miri/module_tree.cpp
index 321eaad9..a457db8e 100644
--- a/tools/standalone_miri/module_tree.cpp
+++ b/tools/standalone_miri/module_tree.cpp
@@ -91,10 +91,24 @@ bool Parser::parse_one()
{
rv_ty = parse_type();
}
- auto body = parse_body();
+
+ if( lex.consume_if('=') )
+ {
+ auto link_name = ::std::move(lex.check_consume(TokenClass::String).strval);
+ lex.check_consume(':');
+ auto abi = ::std::move(lex.check_consume(TokenClass::String).strval);
+ lex.check_consume(';');
- auto p2 = p;
- tree.functions.insert( ::std::make_pair(::std::move(p), Function { ::std::move(p2), ::std::move(arg_tys), rv_ty, ::std::move(body) }) );
+ auto p2 = p;
+ tree.functions.insert( ::std::make_pair(::std::move(p), Function { ::std::move(p2), ::std::move(arg_tys), rv_ty, {link_name, abi}, {} }) );
+ }
+ else
+ {
+ auto body = parse_body();
+
+ auto p2 = p;
+ tree.functions.insert( ::std::make_pair(::std::move(p), Function { ::std::move(p2), ::std::move(arg_tys), rv_ty, {}, ::std::move(body) }) );
+ }
}
else if( lex.consume_if("static") )
{