def reorder_flags(self):
    "Order compiler flags on specs in predefined order.\n\n        We order flags so that any node's flags will take priority over\n        those of its dependents.  That is, the deepest node in the DAG's\n        flags will appear last on the compile line, in the order they\n        were specified.\n\n        The solver determines wihch flags are on nodes; this routine\n        imposes order afterwards.\n        "
    compilers = dict(((c.spec, c) for c in all_compilers_in_config()))
    for pkg in self._flag_compiler_defaults:
        spec = self._specs[pkg]
        compiler_flags = compilers[spec.compiler].flags
        check_same_flags(spec.compiler_flags, compiler_flags)
        spec.compiler_flags.update(compiler_flags)
    cmd_specs = dict(((s.name, s) for spec in self._command_line_specs for s in spec.traverse()))
    for (pkg, sources) in self._flag_sources.items():
        spec = self._specs[pkg]
        order = [s.name for s in spec.traverse(order='post', direction='parents')]
        sorted_sources = sorted(sources, key=(lambda s: order.index(s)))
        flags = collections.defaultdict((lambda : []))
        for source_name in sorted_sources:
            source = cmd_specs[source_name]
            for (name, flag_list) in source.compiler_flags.items():
                extend_flag_list(flags[name], flag_list)
        check_same_flags(spec.compiler_flags, flags)
        spec.compiler_flags.update(flags)
Order compiler flags on specs in predefined order.

We order flags so that any node's flags will take priority over
those of its dependents.  That is, the deepest node in the DAG's
flags will appear last on the compile line, in the order they
were specified.

The solver determines wihch flags are on nodes; this routine
imposes order afterwards.
def reorder_flags(self):
    "Order compiler flags on specs in predefined order.\n\n        We order flags so that any node's flags will take priority over\n        those of its dependents.  That is, the deepest node in the DAG's\n        flags will appear last on the compile line, in the order they\n        were specified.\n\n        The solver determines wihch flags are on nodes; this routine\n        imposes order afterwards.\n        "
    compilers = dict(((c.spec, c) for c in all_compilers_in_config()))
    for pkg in self._flag_compiler_defaults:
        spec = self._specs[pkg]
        compiler_flags = compilers[spec.compiler].flags
        check_same_flags(spec.compiler_flags, compiler_flags)
        spec.compiler_flags.update(compiler_flags)
    cmd_specs = dict(((s.name, s) for spec in self._command_line_specs for s in spec.traverse()))
    for (pkg, sources) in self._flag_sources.items():
        spec = self._specs[pkg]
        order = [s.name for s in spec.traverse(order='post', direction='parents')]
        sorted_sources = sorted(sources, key=(lambda s: order.index(s)))
        flags = collections.defaultdict((lambda : []))
        for source_name in sorted_sources:
            source = cmd_specs[source_name]
            for (name, flag_list) in source.compiler_flags.items():
                extend_flag_list(flags[name], flag_list)
        check_same_flags(spec.compiler_flags, flags)
        spec.compiler_flags.update(flags)