Changeset d4b37ab for src/CodeGen


Ignore:
Timestamp:
Jul 13, 2022, 11:16:56 AM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
af75a87, d958834b
Parents:
25404c7 (diff), b9f8274 (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:
3 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r25404c7 rd4b37ab  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb  2 20:30:30 2022
    13 // Update Count     : 541
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Jun 29 14:34:00 2022
     13// Update Count     : 542
    1414//
    1515#include "CodeGenerator.h"
     
    1818#include <list>                      // for _List_iterator, list, list<>::it...
    1919
     20#include "AST/Decl.hpp"              // for DeclWithType
    2021#include "Common/UniqueName.h"       // for UniqueName
    2122#include "Common/utility.h"          // for CodeLocation, toString
     
    12381239                } // if
    12391240        }
     1241
     1242std::string genName( ast::DeclWithType const * decl ) {
     1243        if ( const OperatorInfo * opInfo = operatorLookup( decl->name ) ) {
     1244                return opInfo->outputName;
     1245        } else {
     1246                return decl->name;
     1247        }
     1248}
     1249
    12401250} // namespace CodeGen
    12411251
  • src/CodeGen/CodeGenerator.h

    r25404c7 rd4b37ab  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb  1 09:23:21 2022
    13 // Update Count     : 64
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Jun 29 14:32:00 2022
     13// Update Count     : 65
    1414//
    1515
     
    2626#include "SynTree/Visitor.h"      // for Visitor
    2727#include "SynTree/SynTree.h"      // for Visitor Nodes
     28
     29namespace ast {
     30        class DeclWithType;
     31}
    2832
    2933namespace CodeGen {
     
    182186        /// returns C-compatible name of declaration
    183187        std::string genName( DeclarationWithType * decl );
     188        std::string genName( ast::DeclWithType const * decl );
    184189
    185190        inline std::ostream & operator<<( std::ostream & os, const CodeGenerator::LineEnder & endl ) {
  • src/CodeGen/GenType.cc

    r25404c7 rd4b37ab  
    254254
    255255        void GenType::postvisit( EnumInstType * enumInst ) {
    256                 if ( enumInst->baseEnum->base ) {
     256                if ( enumInst->baseEnum && enumInst->baseEnum->base ) {
    257257                        typeString = genType(enumInst->baseEnum->base, "", options) + typeString;
    258258                } else {
Note: See TracChangeset for help on using the changeset viewer.