[llvm-branch-commits] [Clang] Move AllocToken frontend options to LangOptions (PR #163635)
Florian Mayer via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Oct 15 17:19:56 PDT 2025
================
@@ -4544,6 +4554,30 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
if (const Arg *A = Args.getLastArg(OPT_frandomize_layout_seed_EQ))
Opts.RandstructSeed = A->getValue(0);
+ if (const auto *Arg = Args.getLastArg(options::OPT_falloc_token_max_EQ)) {
+ StringRef S = Arg->getValue();
+ uint64_t Value = 0;
+ if (S.getAsInteger(0, Value))
+ Diags.Report(diag::err_drv_invalid_value) << Arg->getAsString(Args) << S;
+ else
+ Opts.AllocTokenMax = Value;
+ }
+
+ if (const auto *Arg = Args.getLastArg(options::OPT_falloc_token_mode_EQ)) {
+ StringRef S = Arg->getValue();
+ auto Mode = llvm::StringSwitch<std::optional<llvm::AllocTokenMode>>(S)
----------------
fmayer wrote:
Can we share this with `parseAllocTokenPassOptions`?
https://github.com/llvm/llvm-project/pull/163635
More information about the llvm-branch-commits
mailing list