Changeset 0026d67 for src/SymTab
- Timestamp:
- Oct 27, 2022, 12:29:48 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 22a0e87
- Parents:
- 63d1ebe
- Location:
- src/SymTab
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Mangler.cc
r63d1ebe r0026d67 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 21:40:29 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Jan 11 21:56:06 202113 // Update Count : 7 411 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Oct 21 16:18:00 2022 13 // Update Count : 75 14 14 // 15 15 #include "Mangler.h" … … 418 418 void postvisit( const ast::QualifiedType * qualType ); 419 419 420 std::string get_mangleName() { return mangleName; } 420 /// The result is the current constructed mangled name. 421 std::string result() const { return mangleName; } 421 422 private: 422 423 std::string mangleName; ///< Mangled name being constructed … … 444 445 } // namespace 445 446 446 447 447 std::string mangle( const ast::Node * decl, Mangle::Mode mode ) { 448 ast::Pass<Mangler_new> mangler( mode ); 449 maybeAccept( decl, mangler ); 450 return mangler.core.get_mangleName(); 448 return ast::Pass<Mangler_new>::read( decl, mode ); 451 449 } 452 450 … … 689 687 } // for 690 688 for ( auto & assert : ptype->assertions ) { 691 ast::Pass<Mangler_new> sub_mangler( 692 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums ); 693 assert->var->accept( sub_mangler ); 694 assertionNames.push_back( sub_mangler.core.get_mangleName() ); 689 assertionNames.push_back( ast::Pass<Mangler_new>::read( 690 assert->var.get(), 691 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums ) ); 695 692 acount++; 696 693 } // for -
src/SymTab/Mangler.h
r63d1ebe r0026d67 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 21:44:03 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Jul 22 09:45:30 201713 // Update Count : 1 511 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Oct 27 11:58:00 2022 13 // Update Count : 16 14 14 // 15 15 … … 22 22 23 23 #include "AST/Bitfield.hpp" 24 #include "AST/Fwd.hpp"25 24 #include "SynTree/SynTree.h" // for Types 26 25 #include "SynTree/Visitor.h" // for Visitor, maybeAccept … … 33 32 // * Currently name compression is not implemented. 34 33 34 namespace ast { 35 class Node; 36 } 35 37 namespace ResolvExpr { 36 38 class TypeEnvironment; … … 101 103 using Mode = bitfield<mangle_flags>; 102 104 103 static inline Mode typeMode() { return NoOverrideable | Type; } 105 /// Mangle declaration name. 106 std::string mangle( const ast::Node * decl, Mode mode = {} ); 104 107 105 /// Mangle declaration name 106 std::string mangle( const ast::Node * decl, Mode mode = {} ); 108 /// Most common mangle configuration for types. 109 static inline std::string mangleType( const ast::Node * type ) { 110 return mangle( type, { NoOverrideable | Type } ); 111 } 107 112 108 113 namespace Encoding {
Note: See TracChangeset
for help on using the changeset viewer.