Make sure literals have the right node id when propagating
This commit is contained in:
parent
06c516c580
commit
f0df745f54
@ -112,6 +112,7 @@ unification_set(SetID, VirtualNode)
|
||||
|
||||
% Node attributes that have multiple node arguments (usually, only the first argument is a node)
|
||||
multiple_nodes_attribute("node_flag_source").
|
||||
multiple_nodes_attribute("node_flag_possible_prop").
|
||||
multiple_nodes_attribute("depends_on").
|
||||
multiple_nodes_attribute("virtual_on_edge").
|
||||
|
||||
@ -119,11 +120,13 @@ multiple_nodes_attribute("virtual_on_edge").
|
||||
attr(Name, node(min_dupe_id, A1)) :- literal(LiteralID, Name, A1), solve_literal(LiteralID).
|
||||
attr(Name, node(min_dupe_id, A1), A2) :- literal(LiteralID, Name, A1, A2), solve_literal(LiteralID).
|
||||
attr(Name, node(min_dupe_id, A1), A2, A3) :- literal(LiteralID, Name, A1, A2, A3), solve_literal(LiteralID), not multiple_nodes_attribute(Name).
|
||||
attr(Name, node(min_dupe_id, A1), A2, A3, A4) :- literal(LiteralID, Name, A1, A2, A3, A4), solve_literal(LiteralID).
|
||||
attr(Name, node(min_dupe_id, A1), A2, A3, A4) :- literal(LiteralID, Name, A1, A2, A3, A4), solve_literal(LiteralID), not multiple_nodes_attribute(Name).
|
||||
|
||||
% Special cases where nodes occur in arguments other than A1
|
||||
attr("node_flag_source", node(min_dupe_id, A1), A2, node(min_dupe_id, A3)) :- literal(LiteralID, "node_flag_source", A1, A2, A3), solve_literal(LiteralID).
|
||||
attr("depends_on", node(min_dupe_id, A1), node(min_dupe_id, A2), A3) :- literal(LiteralID, "depends_on", A1, A2, A3), solve_literal(LiteralID).
|
||||
attr("node_flag_possible_prop", node(min_dupe_id, A1), A2, A3, node(min_dupe_id, A4)) :- literal(LiteralID, "node_flag_possible_prop", A1, A2, A3, A4), solve_literal(LiteralID).
|
||||
|
||||
|
||||
% Discriminate between "roots" that have been explicitly requested, and roots that are deduced from "virtual roots"
|
||||
explicitly_requested_root(node(min_dupe_id, A1)) :- literal(LiteralID, "root", A1), solve_literal(LiteralID).
|
||||
@ -1201,17 +1204,14 @@ attr("node_flag_propagate", Package, FlagType, Flag, Source) :-
|
||||
not attr("node_flag_set", Package, FlagType, _).
|
||||
|
||||
attr("node_flag_possible_prop", Package, FlagType, Flag, Source) :-
|
||||
node_compiler(Source, CompilerID),
|
||||
node_compiler(Package, CompilerID),
|
||||
depends_on(Parent, Package),
|
||||
same_compiler(Parent, Package),
|
||||
attr("node_flag_possible_prop", Parent, _, _, Source),
|
||||
attr("node_flag", Source, FlagType, Flag),
|
||||
compiler_id(CompilerID),
|
||||
flag_type(FlagType).
|
||||
|
||||
error(100, "{0} and {1} cannot both propagate compiler flags '{2}' to {3}", Source1, Source2, Package, FlagType) :-
|
||||
depends_on(Source1, Package),
|
||||
depends_on(Source2, Package),
|
||||
same_compiler(Source1, Package),
|
||||
same_compiler(Source2, Package),
|
||||
attr("node_flag_propagate", _, FlagType, _, Source1),
|
||||
attr("node_flag_propagate", _, FlagType, _, Source2),
|
||||
Source1 < Source2.
|
||||
@ -1220,10 +1220,8 @@ error(100, "{0} and {1} cannot both propagate compiler flags '{2}' to {3}", Sour
|
||||
attr("node_flag_source", PackageNode, FlagType, PackageNode)
|
||||
:- attr("node_flag_set", PackageNode, FlagType, _).
|
||||
|
||||
attr("node_flag_source", DependencyNode, FlagType, Q)
|
||||
:- attr("node_flag_source", PackageNode, FlagType, Q),
|
||||
node_flag_inherited(DependencyNode, FlagType, _),
|
||||
attr("node_flag_propagate", PackageNode, FlagType).
|
||||
attr("node_flag_source", PackageNode, FlagType, Q)
|
||||
:- attr("node_flag_propagate", PackageNode, FlagType, _, Q).
|
||||
|
||||
% compiler flags from compilers.yaml are put on nodes if compiler matches
|
||||
attr("node_flag", PackageNode, FlagType, Flag)
|
||||
@ -1245,7 +1243,7 @@ attr("node_flag_compiler_default", PackageNode)
|
||||
|
||||
% if a flag is set to something or inherited, it's included
|
||||
attr("node_flag", PackageNode, FlagType, Flag) :- attr("node_flag_set", PackageNode, FlagType, Flag).
|
||||
attr("node_flag", PackageNode, FlagType, Flag) :- node_flag_inherited(PackageNode, FlagType, Flag).
|
||||
attr("node_flag", PackageNode, FlagType, Flag) :- attr("node_flag_propagate", PackageNode, FlagType, Flag, _).
|
||||
|
||||
% if no node flags are set for a type, there are no flags.
|
||||
attr("no_flags", PackageNode, FlagType)
|
||||
|
Loading…
Reference in New Issue
Block a user