mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 05:12:33 +00:00
Merge changes to add attributes to the HLDS, MLDS and ILDS from the
Estimated hours taken: 2 Branches: main Merge changes to add attributes to the HLDS, MLDS and ILDS from the dotnet-foreign branch. We don't merge the changes to add syntax for attributes, as the syntax is still very experimental. compiler/hlds_pred.m: compiler/prog_data.m: Add attributes to the pred_info (they are a bit like markers, but are more than just boolean flags). compiler/ilasm.m: Add custom attributes to appropriate positions (on assemblies, IL types and methods). compiler/ml_code_gen.m: compiler/ml_code_util.m: compiler/ml_elim_nested.m: compiler/ml_optimize.m: compiler/ml_tailcall.m: compiler/ml_type_gen.m: compiler/ml_util.m: compiler/mlds.m: compiler/mlds_to_c.m: compiler/mlds_to_csharp.m: compiler/mlds_to_gcc.m: compiler/mlds_to_java.m: compiler/mlds_to_mcpp.m: Add mlds__attributes, which are the MLDS version of custom attributes. Convert hlds_pred__attributes into mlds__attributes. Add a list of mlds__attributes to the mlds__function defn. compiler/mlds_to_il.m: Convert MLDS attributes to IL custom attributes.
This commit is contained in:
@@ -422,7 +422,7 @@ generate_wrapper_method(ModuleName, Defn0, Defn) :-
|
||||
(
|
||||
Name0 = function(_Label0, ProcID, MaybeSeqNum, PredID),
|
||||
Body0 = mlds__function(MaybeID, Params0,
|
||||
MaybeStatements0),
|
||||
MaybeStatements0, Attributes),
|
||||
MaybeStatements0 = defined_here(Statements0),
|
||||
Statements0 = mlds__statement(
|
||||
block(BlockDefns0, _BlockList0), _)
|
||||
@@ -460,7 +460,7 @@ generate_wrapper_method(ModuleName, Defn0, Defn) :-
|
||||
%
|
||||
Params = mlds__func_params(Args, RetTypes),
|
||||
Body = mlds__function(MaybeID, Params,
|
||||
defined_here(Statements)),
|
||||
defined_here(Statements), Attributes),
|
||||
Flags = ml_gen_special_member_decl_flags,
|
||||
Defn = mlds__defn(Name, Context, Flags, Body)
|
||||
;
|
||||
@@ -629,7 +629,8 @@ output_defn(Indent, ModuleName, Defn) -->
|
||||
output_defn_body(_, Name, _, mlds__data(Type, Initializer)) -->
|
||||
output_data_defn(Name, Type, Initializer).
|
||||
output_defn_body(Indent, Name, Context,
|
||||
mlds__function(MaybePredProcId, Signature, MaybeBody)) -->
|
||||
mlds__function(MaybePredProcId, Signature, MaybeBody,
|
||||
_Attributes)) -->
|
||||
output_maybe(MaybePredProcId, output_pred_proc_id),
|
||||
output_func(Indent, Name, Context, Signature, MaybeBody).
|
||||
output_defn_body(Indent, Name, Context, mlds__class(ClassDefn)) -->
|
||||
|
||||
Reference in New Issue
Block a user