diff options
author | Yevgeny Rouban <yrouban@azul.com> | 2022-03-09 18:10:21 +0700 |
---|---|---|
committer | Yevgeny Rouban <yrouban@azul.com> | 2022-03-10 08:26:34 +0700 |
commit | fcd9fa416d0d3585f9d6c68302df8ba39889608a (patch) | |
tree | f65dd18cd20cb7200f92ae6bf2dee689da9d9878 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 43f208e94c246fbb9dc5463c1a8af8eb00d4c7e5 (diff) | |
download | llvm-fcd9fa416d0d3585f9d6c68302df8ba39889608a.zip llvm-fcd9fa416d0d3585f9d6c68302df8ba39889608a.tar.gz llvm-fcd9fa416d0d3585f9d6c68302df8ba39889608a.tar.bz2 |
[Support] Try 2: Reset option to its default if its Default field is undefined
opt::setDefaultImpl() is changed to set the option value to the option
type's default if the Default field is not set. This results in option
value reset by Option::reset() or ResetAllOptionOccurrences() even if
the cl::init() is not specified.
Example:
StackOption<std::string> Str("str"); // No cl::init().
Str = "some value";
cl::ResetAllOptionOccurrences();
EXPECT_EQ("", Str); // The Str is reset.
Reviewed By: lattner
Differential Revision: https://reviews.llvm.org/D115433
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions