-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[ADT] Deprecate StringSwitch Cases with 3+ args. NFC. #165119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Suggest the `initializer_list` overload instead. 3+ args is an arbitrary number that allows for incremental depreciation without having to update too many call sites. For more context, see llvm#163117.
|
@llvm/pr-subscribers-lld-wasm @llvm/pr-subscribers-llvm-adt Author: Jakub Kuderski (kuhar) ChangesSuggest the 3+ args is an arbitrary number that allows for incremental depreciation without having to update too many call sites. For more context, see #163117. Full diff: https://github.com/llvm/llvm-project/pull/165119.diff 1 Files Affected:
diff --git a/llvm/include/llvm/ADT/StringSwitch.h b/llvm/include/llvm/ADT/StringSwitch.h
index 2262b1162e330..98685de8573fa 100644
--- a/llvm/include/llvm/ADT/StringSwitch.h
+++ b/llvm/include/llvm/ADT/StringSwitch.h
@@ -93,6 +93,7 @@ class StringSwitch {
return CasesImpl({S0, S1}, Value);
}
+ [[deprecated("Pass cases in std::initializer_list instead")]]
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
T Value) {
return CasesImpl({S0, S1, S2}, Value);
@@ -176,6 +177,7 @@ class StringSwitch {
return CasesLowerImpl({S0, S1}, Value);
}
+ [[deprecated("Pass cases in std::initializer_list instead")]]
StringSwitch &CasesLower(StringLiteral S0, StringLiteral S1, StringLiteral S2,
T Value) {
return CasesLowerImpl({S0, S1, S2}, Value);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
|
✅ With the latest revision this PR passed the C/C++ code linter. |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/63/builds/11476 Here is the relevant piece of the build log for the reference |
Suggest the `initializer_list` overload instead. 3+ args is an arbitrary number that allows for incremental depreciation without having to update too many call sites. For more context, see llvm#163117.
Suggest the `initializer_list` overload instead. 3+ args is an arbitrary number that allows for incremental depreciation without having to update too many call sites. For more context, see llvm#163117.
Suggest the `initializer_list` overload instead. 3+ args is an arbitrary number that allows for incremental depreciation without having to update too many call sites. For more context, see llvm#163117.
Suggest the `initializer_list` overload instead. 3+ args is an arbitrary number that allows for incremental depreciation without having to update too many call sites. For more context, see llvm#163117.
Suggest the
initializer_listoverload instead.3+ args is an arbitrary number that allows for incremental depreciation without having to update too many call sites.
For more context, see #163117.