|
|
@@ -1764,24 +1764,26 @@ PROCEDURE LowerDecls (seq: AST.Node);
|
|
|
QbeGen.DeclConst(nm, qv, AST.Ty(c))
|
|
|
ELSIF AST.Kind(c) = AST.NkProcDecl THEN
|
|
|
Name(AST.Child(c, 0), nm);
|
|
|
- IF NOT ProcInfo(nm, uid, res, depth, ext, np) THEN END;
|
|
|
- QbeGen.Mangled(nm, uid, mg);
|
|
|
- QbeGen.BeginFunc(mg);
|
|
|
- j := 0;
|
|
|
- WHILE j < np DO
|
|
|
- IF NOT ParamInfo(nm, j, pt, pv, txt) THEN END;
|
|
|
- IF NOT QbeGen.FuncParam(txt, pv OR SymTab.IsOpenArray(pt), pt) THEN END;
|
|
|
- INC(j)
|
|
|
- END;
|
|
|
- QbeGen.SetFuncRes(res);
|
|
|
- IF AST.Child(c, 1) = AST.NoNode THEN
|
|
|
- (* declaration-only (definition module): replay the heading *)
|
|
|
- QbeGen.AbortFunc
|
|
|
- ELSE
|
|
|
- QbeGen.EndFuncHeader;
|
|
|
- LowerDecls(AST.Child(c, 2));
|
|
|
- LowerStmt(AST.Child(c, 1));
|
|
|
- QbeGen.EndFunc(res)
|
|
|
+ IF ProcInfo(nm, uid, res, depth, ext, np) THEN
|
|
|
+ QbeGen.Mangled(nm, uid, mg);
|
|
|
+ QbeGen.BeginFunc(mg);
|
|
|
+ j := 0;
|
|
|
+ WHILE j < np DO
|
|
|
+ IF ParamInfo(nm, j, pt, pv, txt) THEN
|
|
|
+ IF NOT QbeGen.FuncParam(txt, pv OR SymTab.IsOpenArray(pt), pt) THEN END
|
|
|
+ END;
|
|
|
+ INC(j)
|
|
|
+ END;
|
|
|
+ QbeGen.SetFuncRes(res);
|
|
|
+ IF AST.Child(c, 1) = AST.NoNode THEN
|
|
|
+ (* declaration-only (definition module): replay the heading *)
|
|
|
+ QbeGen.AbortFunc
|
|
|
+ ELSE
|
|
|
+ QbeGen.EndFuncHeader;
|
|
|
+ LowerDecls(AST.Child(c, 2));
|
|
|
+ LowerStmt(AST.Child(c, 1));
|
|
|
+ QbeGen.EndFunc(res)
|
|
|
+ END
|
|
|
END
|
|
|
END;
|
|
|
INC(i)
|