Ignore:
Timestamp:
Apr 14, 2016, 4:13:10 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, with_gc
Children:
356189a
Parents:
db4ecc5 (diff), 37f0da8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ctor

Conflicts:

src/CodeGen/CodeGenerator.cc
src/GenPoly/Box.cc
src/Parser/DeclarationNode.cc
src/Parser/ParseNode.h
src/Parser/parser.cc
src/Parser/parser.yy
src/SymTab/AddVisit.h
src/SymTab/Validate.cc
src/SynTree/Expression.cc
src/SynTree/Expression.h
src/SynTree/Mutator.cc
src/SynTree/Mutator.h
src/SynTree/SynTree.h
src/SynTree/Visitor.cc
src/SynTree/Visitor.h
src/libcfa/iostream.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/GenPoly.h

    rdb4ecc5 r70a06f6  
    1717#define GENPOLY_H
    1818
    19 #include <map>
    2019#include <string>
    2120#include <iostream>
    2221#include <utility>
     22
     23#include "ErasableScopedMap.h"
     24
     25#include "SymTab/Mangler.h"
    2326
    2427#include "SynTree/Declaration.h"
     
    2730
    2831namespace GenPoly {
    29         typedef std::map< std::string, TypeDecl::Kind > TyVarMap;
     32        typedef ErasableScopedMap< std::string, TypeDecl::Kind > TyVarMap;
    3033
    3134        /// A function needs an adapter if it returns a polymorphic value or if any of its
     
    6972        void printTyVarMap( std::ostream &os, const TyVarMap &tyVarMap );
    7073
    71         /// Gets the name of the sizeof parameter for the type
    72         std::string sizeofName( Type *ty );
     74        /// Gets the mangled name of this type; alias for SymTab::Mangler::mangleType().
     75        inline std::string mangleType( Type *ty ) { return SymTab::Mangler::mangleType( ty ); }
     76       
     77        /// Gets the name of the sizeof parameter for the type, given its mangled name
     78        inline std::string sizeofName( const std::string &name ) { return std::string( "_sizeof_" ) + name; }
    7379
    74         /// Gets the name of the alignof parameter for the type
    75         std::string alignofName( Type *ty );
     80        /// Gets the name of the alignof parameter for the type, given its mangled name
     81        inline std::string alignofName( const std::string &name ) { return std::string( "_alignof_" ) + name; }
    7682
    77         /// Gets the name of the offsetof parameter for the type
    78         std::string offsetofName( Type *ty );
     83        /// Gets the name of the offsetof parameter for the type, given its mangled name
     84        inline std::string offsetofName( const std::string &name ) { return std::string( "_offsetof_" ) + name; }
     85
     86        /// Gets the name of the layout function for a given aggregate type, given its declaration
     87        inline std::string layoutofName( AggregateDecl *decl ) { return std::string( "_layoutof_" ) + decl->get_name(); }
     88       
    7989} // namespace GenPoly
    8090
Note: See TracChangeset for help on using the changeset viewer.