Skip to content

Commit b3b5885

Browse files
committed
follow naming conventions
1 parent c43cf36 commit b3b5885

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

flang/include/flang/Support/Fortran-features.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ class LanguageFeatureControl {
115115
bool ShouldWarn(LanguageFeature f) const { return warnLanguage_.test(f); }
116116
bool ShouldWarn(UsageWarning w) const { return warnUsage_.test(w); }
117117
// CLI options
118-
bool applyCLIOption(std::string input);
119-
void addAlternativeCliSpelling(LanguageFeature f, std::string input) {
118+
bool ApplyCLIOption(std::string input);
119+
void AddAlternativeCliSpelling(LanguageFeature f, std::string input) {
120120
cliOptions_.insert({input, {f}});
121121
}
122-
void addAlternativeCliSpelling(UsageWarning w, std::string input) {
122+
void AddAlternativeCliSpelling(UsageWarning w, std::string input) {
123123
cliOptions_.insert({input, {w}});
124124
}
125-
void replaceCliCanonicalSpelling(LanguageFeature f, std::string input);
126-
void replaceCliCanonicalSpelling(UsageWarning w, std::string input);
125+
void ReplaceCliCanonicalSpelling(LanguageFeature f, std::string input);
126+
void ReplaceCliCanonicalSpelling(UsageWarning w, std::string input);
127127
std::string_view getDefaultCliSpelling(LanguageFeature f) const {
128128
return languageFeatureCliCanonicalSpelling_[EnumToInt(f)];
129129
};

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ static bool parseDiagArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
995995
if (wArg == "error") {
996996
res.setWarnAsErr(true);
997997
// -W(no-)<feature>
998-
} else if (!res.getFrontendOpts().features.applyCLIOption(wArg)) {
998+
} else if (!res.getFrontendOpts().features.ApplyCLIOption(wArg)) {
999999
const unsigned diagID = diags.getCustomDiagID(
10001000
clang::DiagnosticsEngine::Error, "Unknown diagnostic option: -W%0");
10011001
diags.Report(diagID) << wArg;

flang/lib/Support/Fortran-features.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515

1616
namespace Fortran::common {
1717

18-
// Namespace for helper functions for parsing CLI options
19-
// used instead of static so that there can be unit tests for these
20-
// functions.
21-
namespace featuresHelpers {
22-
2318
static std::vector<std::string_view> SplitCamelCase(std::string_view x) {
2419
std::vector<std::string_view> result;
2520
// NB, we start at 1 because the first character is never a word boundary.
@@ -42,6 +37,9 @@ static std::vector<std::string_view> SplitCamelCase(std::string_view x) {
4237
return result;
4338
}
4439

40+
// Namespace for helper functions for parsing CLI options used instead of static
41+
// so that there can be unit tests for this function.
42+
namespace featuresHelpers {
4543
std::string CamelCaseToLowerCaseHyphenated(std::string_view x) {
4644
std::vector<std::string_view> words{SplitCamelCase(x)};
4745
std::string result{};
@@ -160,7 +158,7 @@ LanguageFeatureControl::LanguageFeatureControl() {
160158

161159
// Take a string from the CLI and apply it to the LanguageFeatureControl.
162160
// Return true if the option was applied recognized.
163-
bool LanguageFeatureControl::applyCLIOption(std::string input) {
161+
bool LanguageFeatureControl::ApplyCLIOption(std::string input) {
164162
bool negated{false};
165163
if (input.size() > 3 && input.substr(0, 3) == "no-") {
166164
negated = true;
@@ -179,15 +177,15 @@ bool LanguageFeatureControl::applyCLIOption(std::string input) {
179177
return false;
180178
}
181179

182-
void LanguageFeatureControl::replaceCliCanonicalSpelling(
180+
void LanguageFeatureControl::ReplaceCliCanonicalSpelling(
183181
LanguageFeature f, std::string input) {
184182
std::string_view old{languageFeatureCliCanonicalSpelling_[EnumToInt(f)]};
185183
cliOptions_.erase(std::string{old});
186184
languageFeatureCliCanonicalSpelling_[EnumToInt(f)] = input;
187185
cliOptions_.insert({input, {f}});
188186
}
189187

190-
void LanguageFeatureControl::replaceCliCanonicalSpelling(
188+
void LanguageFeatureControl::ReplaceCliCanonicalSpelling(
191189
UsageWarning w, std::string input) {
192190
std::string_view old{usageWarningCliCanonicalSpelling_[EnumToInt(w)]};
193191
cliOptions_.erase(std::string{old});

0 commit comments

Comments
 (0)