Changeset e5d9274 for src/CodeGen


Ignore:
Timestamp:
Jun 2, 2022, 3:11:21 PM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
ced5e2a
Parents:
015925a (diff), fc134a48 (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/CodeGen
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r015925a re5d9274  
    12381238} // namespace CodeGen
    12391239
    1240 
    1241 unsigned Indenter::tabsize = 2;
    1242 
    1243 std::ostream & operator<<( std::ostream & out, const BaseSyntaxNode * node ) {
    1244         if ( node ) {
    1245                 node->print( out );
    1246         } else {
    1247                 out << "nullptr";
    1248         }
    1249         return out;
    1250 }
    1251 
    12521240// Local Variables: //
    12531241// tab-width: 4 //
  • src/CodeGen/FixMain.cc

    r015925a re5d9274  
    4949
    5050}
    51 
    52         bool FixMain::replace_main = false;
    5351
    5452        template<typename container>
  • src/CodeGen/GenType.cc

    r015925a re5d9274  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed May  1 15:24:00 2019
    13 // Update Count     : 23
     12// Last Modified On : Fri May 20 11:18:00 2022
     13// Update Count     : 24
    1414//
    1515#include "GenType.h"
     
    5050                void postvisit( TraitInstType * inst );
    5151                void postvisit( TypeofType * typeof );
     52                void postvisit( VTableType * vtable );
    5253                void postvisit( QualifiedType * qualType );
    5354
     
    259260                        if ( options.genC ) {
    260261                                typeString = "enum " + typeString;
    261                         } 
    262                 } 
     262                        }
     263                }
    263264                handleQualifiers( enumInst );
    264265        }
    265266
    266267        void GenType::postvisit( TypeInstType * typeInst ) {
     268                assertf( ! options.genC, "Type instance types should not reach code generation." );
    267269                typeString = typeInst->name + " " + typeString;
    268270                handleQualifiers( typeInst );
     
    320322        }
    321323
     324        void GenType::postvisit( VTableType * vtable ) {
     325                assertf( ! options.genC, "Virtual table types should not reach code generation." );
     326                std::ostringstream os;
     327                os << "vtable(" << genType( vtable->base, "", options ) << ") " << typeString;
     328                typeString = os.str();
     329                handleQualifiers( vtable );
     330        }
     331
    322332        void GenType::postvisit( QualifiedType * qualType ) {
    323333                assertf( ! options.genC, "Qualified types should not reach code generation." );
  • src/CodeGen/LinkOnce.cc

    r015925a re5d9274  
    5353                                new ConstantExpr( Constant::from_string( section_name ) )
    5454                        );
     55
     56                        // Unconditionnaly add "visibility(default)" to anything with gnu.linkonce
     57                        // visibility is a mess otherwise
     58                        attributes.push_back(new Attribute("visibility", {new ConstantExpr( Constant::from_string( "default" ) )}));
     59
    5560                }
    5661                visit_children = false;
  • src/CodeGen/module.mk

    r015925a re5d9274  
    1010## Author           : Richard C. Bilson
    1111## Created On       : Mon Jun  1 17:49:17 2015
    12 ## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Sat Dec 14 07:29:42 2019
    14 ## Update Count     : 4
     12## Last Modified By : Andrew Beach
     13## Last Modified On : Tue May 17 14:26:00 2022
     14## Update Count     : 5
    1515###############################################################################
    1616
    17 #SRC +=  ArgTweak/Rewriter.cc \
    18 #       ArgTweak/Mutate.cc
     17SRC_CODEGEN = \
     18        CodeGen/FixMain2.cc \
     19        CodeGen/FixMain.h \
     20        CodeGen/OperatorTable.cc \
     21        CodeGen/OperatorTable.h
    1922
    20 SRC_CODEGEN = \
     23SRC += $(SRC_CODEGEN) \
    2124        CodeGen/CodeGenerator.cc \
    2225        CodeGen/CodeGenerator.h \
     26        CodeGen/Generate.cc \
     27        CodeGen/Generate.h \
    2328        CodeGen/FixMain.cc \
    24         CodeGen/FixMain.h \
     29        CodeGen/FixNames.cc \
     30        CodeGen/FixNames.h \
    2531        CodeGen/GenType.cc \
    2632        CodeGen/GenType.h \
    2733        CodeGen/LinkOnce.cc \
    2834        CodeGen/LinkOnce.h \
    29         CodeGen/OperatorTable.cc \
    30         CodeGen/OperatorTable.h \
    3135        CodeGen/Options.h
    3236
    33 SRC += $(SRC_CODEGEN) CodeGen/Generate.cc CodeGen/Generate.h CodeGen/FixNames.cc CodeGen/FixNames.h
    3437SRCDEMANGLE += $(SRC_CODEGEN)
Note: See TracChangeset for help on using the changeset viewer.