Skip to content

Commit 5d2a8a3

Browse files
committed
Rename apply to consume
1 parent 073a878 commit 5d2a8a3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

llvm/include/llvm/Frontend/OpenMP/DirectiveNameParser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace llvm::omp {
3030
///
3131
/// DirectiveNameParser::State *S = Parser.initial();
3232
/// for (StringRef Token : Tokens)
33-
/// S = Parser.apply(S, Token); // Passing nullptr is ok.
33+
/// S = Parser.consume(S, Token); // Passing nullptr is ok.
3434
///
3535
/// if (S == nullptr) {
3636
/// // Error: ended up in a state from which there is no possible path
@@ -62,7 +62,7 @@ struct DirectiveNameParser {
6262
};
6363

6464
const State *initial() const { return &InitialState; }
65-
const State *apply(const State *Current, StringRef Tok) const;
65+
const State *consume(const State *Current, StringRef Tok) const;
6666

6767
static SmallVector<StringRef> tokenize(StringRef N);
6868

llvm/lib/Frontend/OpenMP/DirectiveNameParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ DirectiveNameParser::DirectiveNameParser(SourceLanguage L) {
2828
}
2929

3030
const DirectiveNameParser::State *
31-
DirectiveNameParser::apply(const State *Current, StringRef Tok) const {
31+
DirectiveNameParser::consume(const State *Current, StringRef Tok) const {
3232
if (!Current)
3333
return Current;
3434
assert(Current->isValid() && "Invalid input state");

llvm/unittests/Frontend/OpenMPDirectiveNameParserTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ TEST_P(ParseValid, T) {
114114

115115
std::vector<std::string> Tokens = tokenize(Name);
116116
for (auto &Tok : Tokens) {
117-
State = Parser.apply(State, Tok);
117+
State = Parser.consume(State, Tok);
118118
ASSERT_TRUE(State != nullptr);
119119
}
120120

@@ -150,7 +150,7 @@ TEST_P(ParseInvalid, T) {
150150

151151
std::vector<std::string> Tokens = tokenize(Name);
152152
for (auto &Tok : Tokens)
153-
State = Parser.apply(State, Tok);
153+
State = Parser.consume(State, Tok);
154154

155155
ASSERT_TRUE(State == nullptr || State->Value == omp::Directive::OMPD_unknown);
156156
}

0 commit comments

Comments
 (0)