Skip to content

Commit 86ec6a0

Browse files
author
David Ungar
committed
Remove include order dependency
1 parent 5908cfc commit 86ec6a0

File tree

5 files changed

+11
-18
lines changed

5 files changed

+11
-18
lines changed

include/swift/AST/ASTScope.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030

3131
#include "swift/AST/ASTNode.h"
3232
#include "swift/AST/NameLookup.h" // for DeclVisibilityKind
33-
// extractNearestSourceLoc, simple_display declarations must come before this
34-
// Alternatively, declare these in SimpleDisplay.h or elsewhere
35-
//#include "swift/AST/SimpleRequest.h"
33+
#include "swift/AST/SimpleRequest.h"
3634
#include "swift/Basic/Compiler.h"
3735
#include "swift/Basic/LLVM.h"
3836
#include "swift/Basic/NullablePtr.h"
@@ -93,11 +91,13 @@ struct AnnotatedInsertionPoint {
9391
};
9492
} // namespace ast_scope
9593

96-
SourceLoc extractNearestSourceLoc(
97-
std::tuple<ast_scope::ASTScopeImpl *, ast_scope::ScopeCreator *>);
98-
9994
namespace ast_scope {
10095

96+
void simple_display(llvm::raw_ostream &out, const ASTScopeImpl *);
97+
void simple_display(llvm::raw_ostream &out, const ScopeCreator *);
98+
99+
SourceLoc extractNearestSourceLoc(std::tuple<ASTScopeImpl *, ScopeCreator *>);
100+
101101
#pragma mark the root ASTScopeImpl class
102102

103103
/// Describes a lexical scope within a source file.

include/swift/Basic/SimpleDisplay.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ namespace swift {
5454

5555
#undef HAS_TRIVIAL_DISPLAY
5656

57-
namespace ast_scope {
58-
class ASTScopeImpl;
59-
class ScopeCreator;
60-
} // namespace ast_scope
61-
void simple_display(llvm::raw_ostream &out, const ast_scope::ASTScopeImpl *);
62-
void simple_display(llvm::raw_ostream &out, const ast_scope::ScopeCreator *);
63-
6457
template<typename T>
6558
typename std::enable_if<HasTrivialDisplay<T>::value>::type
6659
simple_display(llvm::raw_ostream &out, const T &value) {

lib/AST/ASTScopeCreation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,7 +2088,7 @@ bool ASTSourceFileScope::crossCheckWithAST() {
20882088
return scopeCreator->containsAllDeclContextsFromAST();
20892089
}
20902090

2091-
void swift::simple_display(llvm::raw_ostream &out,
2092-
const ast_scope::ScopeCreator *scopeCreator) {
2091+
void ast_scope::simple_display(llvm::raw_ostream &out,
2092+
const ScopeCreator *scopeCreator) {
20932093
scopeCreator->print(out);
20942094
}

lib/AST/ASTScopePrinting.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ bool IterableTypeScope::doesDeclHaveABody() const {
202202
return getBraces().Start != getBraces().End;
203203
}
204204

205-
void swift::simple_display(llvm::raw_ostream &out,
206-
const ast_scope::ASTScopeImpl *scope) {
205+
void ast_scope::simple_display(llvm::raw_ostream &out,
206+
const ASTScopeImpl *scope) {
207207
scope->print(out);
208208
}

lib/AST/ASTScopeSourceRange.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ SourceLoc getLocAfterExtendedNominal(const ExtensionDecl *const ext) {
757757
.getEnd();
758758
}
759759

760-
SourceLoc swift::extractNearestSourceLoc(
760+
SourceLoc ast_scope::extractNearestSourceLoc(
761761
std::tuple<ASTScopeImpl *, ScopeCreator *> scopeAndCreator) {
762762
const ASTScopeImpl *scope = std::get<0>(scopeAndCreator);
763763
return scope->getSourceRangeOfThisASTNode().Start;

0 commit comments

Comments
 (0)