- File:
-
- 1 edited
-
src/Common/CodeLocationTools.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/CodeLocationTools.cpp
r561354f rc86b08d 105 105 macro(UnionDecl, Decl) \ 106 106 macro(EnumDecl, Decl) \ 107 macro(AdtDecl, Decl) \108 107 macro(TraitDecl, Decl) \ 109 108 macro(TypeDecl, Decl) \ … … 129 128 macro(FinallyClause, FinallyClause) \ 130 129 macro(SuspendStmt, Stmt) \ 130 macro(WhenClause, WhenClause) \ 131 131 macro(WaitForStmt, Stmt) \ 132 132 macro(WaitForClause, WaitForClause) \ 133 macro(WaitUntilStmt, Stmt) \ 133 134 macro(WithStmt, Decl) \ 134 135 macro(NullStmt, NullStmt) \ … … 209 210 210 211 struct LeafKindVisitor : public ast::Visitor { 211 LeafKind result;212 LeafKind kind; 212 213 213 214 #define VISIT(node_type, return_type) \ 214 215 const ast::return_type * visit( const ast::node_type * ) final { \ 215 result= LeafKind::node_type; \216 kind = LeafKind::node_type; \ 216 217 return nullptr; \ 217 218 } … … 223 224 224 225 LeafKind get_leaf_kind( ast::Node const * node ) { 225 return ast::Pass<LeafKindVisitor>::read( node ); 226 LeafKindVisitor visitor; 227 node->accept( visitor ); 228 return visitor.kind; 226 229 } 227 230
Note:
See TracChangeset
for help on using the changeset viewer.