[clang] [clang][Driver] Use shared_ptr in the Compilation class (PR #116406)
David Truby via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 2 06:13:23 PST 2024
================
@@ -61,11 +61,11 @@ class Compilation {
OrderedOffloadingToolchains;
/// The original (untranslated) input argument list.
- llvm::opt::InputArgList *Args;
+ std::unique_ptr<llvm::opt::InputArgList> Args;
/// The driver translated arguments. Note that toolchains may perform their
/// own argument translation.
- llvm::opt::DerivedArgList *TranslatedArgs;
+ std::shared_ptr<llvm::opt::DerivedArgList> TranslatedArgs;
----------------
DavidTruby wrote:
This can be a unique_ptr as well; TranslatedArgs is fully owned by the Compilation class and doesn't share ownership with anyone else.
https://github.com/llvm/llvm-project/pull/116406
More information about the cfe-commits
mailing list