Skip to content

Remove SyntaxASTMap #35446

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

Merged
merged 1 commit into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions include/swift/AST/SyntaxASTMap.h

This file was deleted.

3 changes: 0 additions & 3 deletions include/swift/Syntax/Syntax.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@

namespace swift {

class SyntaxASTMap;

namespace syntax {

struct SyntaxVisitor;
Expand All @@ -58,7 +56,6 @@ const auto NoParent = llvm::None;
/// their children.
class Syntax {
friend struct SyntaxFactory;
friend class swift::SyntaxASTMap;

protected:
/// A strong reference to the root node of the tree in which this piece of
Expand Down
26 changes: 0 additions & 26 deletions include/swift/Syntax/SyntaxData.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,30 +295,4 @@ class SyntaxData final
} // end namespace syntax
} // end namespace swift

// DenseMapInfo for RC<SyntaxData>, used for a Syntax Node -> lib/AST mapping.
namespace llvm {
using SD = swift::syntax::SyntaxData;
using RCSD = swift::RC<SD>;
template <> struct DenseMapInfo<RCSD> {
static inline RCSD getEmptyKey() {
return SD::make(nullptr, nullptr, 0);
}
static inline RCSD getTombstoneKey() {
return SD::make(nullptr, nullptr, 0);
}
static unsigned getHashValue(const RCSD Value) {
unsigned H = 0;
H ^= DenseMapInfo<uintptr_t>::getHashValue(reinterpret_cast<const uintptr_t>(Value->getRaw().get()));
H ^= DenseMapInfo<uintptr_t>::getHashValue(reinterpret_cast<const uintptr_t>(Value->getParent()));
H ^= DenseMapInfo<swift::syntax::CursorIndex>::getHashValue(Value->getIndexInParent());
return H;
}
static bool isEqual(const RCSD LHS, const RCSD RHS) {
return LHS->getRaw().get() == RHS->getRaw().get() &&
LHS->getParent() == RHS->getParent() &&
LHS->getIndexInParent() == RHS->getIndexInParent();
}
};
}

#endif // SWIFT_SYNTAX_SYNTAXDATA_H
1 change: 0 additions & 1 deletion lib/AST/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ add_swift_host_library(swiftAST STATIC
ProtocolConformance.cpp
RawComment.cpp
RequirementEnvironment.cpp
SyntaxASTMap.cpp
SILLayout.cpp
Stmt.cpp
SubstitutionMap.cpp
Expand Down
68 changes: 0 additions & 68 deletions lib/AST/SyntaxASTMap.cpp

This file was deleted.