Changeset 78dd0da for src/GenPoly/ScrubTyVars.cc
- Timestamp:
- Dec 15, 2015, 2:56:43 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 4389966, ffad73a
- Parents:
- 5e92fee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/ScrubTyVars.cc
r5e92fee r78dd0da 14 14 // 15 15 16 #include <sstream> 16 17 #include <string> 17 18 18 19 #include "GenPoly.h" 19 20 #include "ScrubTyVars.h" 21 22 #include "SymTab/Mangler.h" 20 23 21 24 #include "SynTree/Mutator.h" … … 46 49 // sizeof( T ) => _sizeof_T parameter, which is the size of T 47 50 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType * >( szeof->get_type() ) ) { 48 Expression *expr = new NameExpr( s td::string("_sizeof_") + typeInst->get_name() );51 Expression *expr = new NameExpr( sizeofName( typeInst ) ); 49 52 return expr; 50 53 } else { … … 56 59 // alignof( T ) => _alignof_T parameter, which is the alignment of T 57 60 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType * >( algnof->get_type() ) ) { 58 Expression *expr = new NameExpr( std::string("_alignof_") + typeInst->get_name() );61 Expression *expr = new NameExpr( alignofName( typeInst ) ); 59 62 return expr; 60 63 } else { … … 75 78 return Mutator::mutate( pointer ); 76 79 } 80 81 std::string sizeofName( Type *ty ) { 82 return std::string( "_sizeof_" ) + SymTab::Mangler::mangle( ty, false, false ); 83 } 84 85 std::string alignofName( Type *ty ) { 86 return std::string( "_alignof_" ) + SymTab::Mangler::mangle( ty, false, false ); 87 } 77 88 } // namespace GenPoly 78 89
Note: See TracChangeset
for help on using the changeset viewer.