[all-commits] [llvm/llvm-project] e194bd: [Multilib] Custom flags YAML parsing
Victor Campos via All-commits
all-commits at lists.llvm.org
Thu Oct 24 02:14:17 PDT 2024
Branch: refs/heads/users/vhscampos/multilib-flags-yaml-parsing
Home: https://github.com/llvm/llvm-project
Commit: e194bdad39ea7f719e1a133eca94f9ce6ef3e881
https://github.com/llvm/llvm-project/commit/e194bdad39ea7f719e1a133eca94f9ce6ef3e881
Author: Victor Campos <victor.campos at arm.com>
Date: 2024-10-23 (Wed, 23 Oct 2024)
Changed paths:
M clang/include/clang/Driver/Multilib.h
M clang/lib/Driver/Multilib.cpp
A clang/test/Driver/baremetal-multilib-custom-flags-parsing.yaml
Log Message:
-----------
[Multilib] Custom flags YAML parsing
This patch adds support for custom flags in the multilib YAML file.
Details about this change can be found in:
https://discourse.llvm.org/t/rfc-multilib-custom-flags/81058
CustomFlagDeclaration objects are instantiated using shared_ptr. This is
motivated by the fact that each custom flag value,
CustomFlagValueDetail, contains a back reference to their corresponding
flag declaration.
Since the CustomFlagDeclaration objects are transferred from the YAML
parser to the MultilibSet instance after the parsing is finished, back
references implemented as raw pointers would become dangling. This would
need to be remediated in the copy/move constructors by updating the
pointer.
Therefore it's just simpler and less error-prone to have all references
to CustomFlagDeclaration, including the back reference, as shared_ptr.
This way dangling pointers are not a concern.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list