@@ -2375,10 +2375,18 @@ impl ConversionContext {
23752375 {
23762376 let name = from_value :: < String > ( node. extras [ 0 ] . clone ( ) )
23772377 . expect ( "Macros must have a name" ) ;
2378+ let raw_params = from_value :: < Vec < Value > > ( node. extras [ 1 ] . clone ( ) )
2379+ . expect ( "Macros must have a parameter list" ) ;
2380+ let params: Vec < String > = raw_params
2381+ . into_iter ( )
2382+ . map ( |v| from_value ( v) . expect ( "param name" ) )
2383+ . collect ( ) ;
23782384
23792385 let mac_object = match node. tag {
23802386 ASTEntryTag :: TagMacroObjectDef => CDeclKind :: MacroObject { name } ,
2381- ASTEntryTag :: TagMacroFunctionDef => CDeclKind :: MacroFunction { name } ,
2387+ ASTEntryTag :: TagMacroFunctionDef => {
2388+ CDeclKind :: MacroFunction { name, params }
2389+ }
23822390 _ => unreachable ! ( "Unexpected tag for macro" ) ,
23832391 } ;
23842392
@@ -2391,20 +2399,6 @@ impl ConversionContext {
23912399 self . typed_context . c_decls_top . push ( CDeclId ( new_id) ) ;
23922400 }
23932401
2394- ASTEntryTag :: TagMacroFunctionDef if expected_ty & MACRO_DECL != 0 => {
2395- let name = from_value :: < String > ( node. extras [ 0 ] . clone ( ) )
2396- . expect ( "Macros must have a name" ) ;
2397-
2398- let mac_object = CDeclKind :: MacroFunction { name } ;
2399- self . add_decl ( new_id, located ( node, mac_object) ) ;
2400- self . processed_nodes . insert ( new_id, MACRO_DECL ) ;
2401-
2402- // Macros aren't technically top-level decls, so clang
2403- // doesn't put them in top_nodes, but we do need to process
2404- // them early.
2405- self . typed_context . c_decls_top . push ( CDeclId ( new_id) ) ;
2406- }
2407-
24082402 ASTEntryTag :: TagNonCanonicalDecl if expected_ty & DECL != 0 => {
24092403 let canonical_decl =
24102404 node. children [ 0 ] . expect ( "NonCanonicalDecl must point to a canonical decl" ) ;
0 commit comments