Skip to content

Commit 146fa52

Browse files
committed
Move internal details to internal namespace
1 parent 07d0234 commit 146fa52

File tree

8 files changed

+20
-19
lines changed

8 files changed

+20
-19
lines changed

mlir/include/mlir/Query/Matcher/Diagnostics.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <string>
2222
#include <vector>
2323

24-
namespace mlir::query::matcher {
24+
namespace mlir::query::matcher::internal {
2525

2626
// Represents the line and column numbers in a source query.
2727
struct SourceLocation {
@@ -114,6 +114,6 @@ class Diagnostics {
114114
std::vector<ErrorContent> errorValues;
115115
};
116116

117-
} // namespace mlir::query::matcher
117+
} // namespace mlir::query::matcher::internal
118118

119119
#endif // MLIR_TOOLS_MLIRQUERY_MATCHER_DIAGNOSTICS_H

mlir/include/mlir/Query/Matcher/Parser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "llvm/ADT/StringMap.h"
3434
#include "llvm/ADT/StringRef.h"
3535

36-
namespace mlir::query::matcher {
36+
namespace mlir::query::matcher::internal {
3737

3838
// Matcher expression parser.
3939
class Parser {
@@ -169,6 +169,6 @@ class Parser {
169169
std::vector<MatcherCompletion> completions;
170170
};
171171

172-
} // namespace mlir::query::matcher
172+
} // namespace mlir::query::matcher::internal
173173

174174
#endif // MLIR_TOOLS_MLIRQUERY_MATCHER_PARSER_H

mlir/include/mlir/Query/Matcher/Registry.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ class Registry {
5656
getMatcherCompletions(ArrayRef<ArgKind> acceptedTypes);
5757

5858
static VariantMatcher constructMatcher(MatcherCtor ctor,
59-
SourceRange nameRange,
59+
internal::SourceRange nameRange,
6060
ArrayRef<ParserValue> args,
61-
Diagnostics *error);
61+
internal::Diagnostics *error);
6262
};
6363

6464
} // namespace mlir::query::matcher

mlir/include/mlir/Query/Matcher/VariantValue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class VariantValue {
132132
struct ParserValue {
133133
ParserValue() {}
134134
llvm::StringRef text;
135-
SourceRange range;
135+
internal::SourceRange range;
136136
VariantValue value;
137137
};
138138

mlir/lib/Query/Matcher/Diagnostics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "mlir/Query/Matcher/Diagnostics.h"
1010

11-
namespace mlir::query::matcher {
11+
namespace mlir::query::matcher::internal {
1212

1313
Diagnostics::ArgStream &
1414
Diagnostics::ArgStream::operator<<(const llvm::Twine &arg) {
@@ -124,4 +124,4 @@ void Diagnostics::print(llvm::raw_ostream &OS) const {
124124
}
125125
}
126126

127-
} // namespace mlir::query::matcher
127+
} // namespace mlir::query::matcher::internal

mlir/lib/Query/Matcher/Parser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "llvm/Support/ManagedStatic.h"
1616
#include <vector>
1717

18-
namespace mlir::query::matcher {
18+
namespace mlir::query::matcher::internal {
1919

2020
// Simple structure to hold information for one token from the parser.
2121
struct Parser::TokenInfo {
@@ -556,4 +556,4 @@ Parser::parseMatcherExpression(llvm::StringRef &code, Sema *sema,
556556
return result;
557557
}
558558

559-
} // namespace mlir::query::matcher
559+
} // namespace mlir::query::matcher::internal

mlir/lib/Query/Matcher/Registry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ Registry::getMatcherCompletions(ArrayRef<ArgKind> acceptedTypes) {
162162
}
163163

164164
VariantMatcher Registry::constructMatcher(MatcherCtor ctor,
165-
SourceRange nameRange,
165+
internal::SourceRange nameRange,
166166
ArrayRef<ParserValue> args,
167-
Diagnostics *error) {
167+
internal::Diagnostics *error) {
168168
return ctor->create(nameRange, args, error);
169169
}
170170

mlir/lib/Query/QueryParser.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ enum ParsedQueryKind {
122122
PQK_Match,
123123
};
124124

125-
QueryRef makeInvalidQueryFromDiagnostics(const matcher::Diagnostics &diag) {
125+
QueryRef
126+
makeInvalidQueryFromDiagnostics(const matcher::internal::Diagnostics &diag) {
126127
std::string errStr;
127128
llvm::raw_string_ostream OS(errStr);
128129
diag.print(OS);
@@ -132,8 +133,8 @@ QueryRef makeInvalidQueryFromDiagnostics(const matcher::Diagnostics &diag) {
132133

133134
QueryRef QueryParser::completeMatcherExpression() {
134135
std::vector<matcher::MatcherCompletion> comps =
135-
matcher::Parser::completeExpression(line, completionPos - line.begin(),
136-
nullptr, &QS.namedValues);
136+
matcher::internal::Parser::completeExpression(
137+
line, completionPos - line.begin(), nullptr, &QS.namedValues);
137138
for (const auto &comp : comps) {
138139
completions.emplace_back(comp.typedText, comp.matcherDecl);
139140
}
@@ -168,12 +169,12 @@ QueryRef QueryParser::doParse() {
168169
return completeMatcherExpression();
169170
}
170171

171-
matcher::Diagnostics diag;
172+
matcher::internal::Diagnostics diag;
172173
auto matcherSource = line.ltrim();
173174
auto origMatcherSource = matcherSource;
174175
std::optional<matcher::DynMatcher> matcher =
175-
matcher::Parser::parseMatcherExpression(matcherSource, nullptr,
176-
&QS.namedValues, &diag);
176+
matcher::internal::Parser::parseMatcherExpression(
177+
matcherSource, nullptr, &QS.namedValues, &diag);
177178
if (!matcher) {
178179
return makeInvalidQueryFromDiagnostics(diag);
179180
}

0 commit comments

Comments
 (0)