Ignore:
Timestamp:
Dec 12, 2019, 10:25:49 AM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
983edfd
Parents:
f80f840 (diff), 737c98a (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 relaxed_ready

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/TypeDecl.cc

    rf80f840 r2a3d446  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Aug  9 14:35:00 2017
    13 // Update Count     : 6
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Dec 11 17:56:30 2019
     13// Update Count     : 10
    1414//
    1515
     
    1818
    1919#include "Common/utility.h"  // for maybeClone
     20#include "Parser/ParseNode.h"
    2021#include "Declaration.h"     // for TypeDecl, TypeDecl::Data, TypeDecl::Kind...
    2122#include "Type.h"            // for Type, Type::StorageClasses
     
    3132}
    3233
    33 std::string TypeDecl::typeString() const {
    34         static const std::string kindNames[] = { "object type", "function type", "tuple type" };
     34const char * TypeDecl::typeString() const {
     35        static const char * kindNames[] = { "sized object type", "sized function type", "sized tuple type" };
    3536        assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "typeString: kindNames is out of sync." );
    3637        assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." );
    37         return (isComplete() ? "sized " : "") + kindNames[ kind ];
     38        return isComplete() ? kindNames[ kind ] : &kindNames[ kind ][ sizeof("sized") ]; // sizeof includes '\0'
    3839}
    3940
    40 std::string TypeDecl::genTypeString() const {
    41         static const std::string kindNames[] = { "dtype", "ftype", "ttype" };
     41const char * TypeDecl::genTypeString() const {
     42        static const char * kindNames[] = { "dtype", "ftype", "ttype" };
    4243        assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "genTypeString: kindNames is out of sync." );
    4344        assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." );
Note: See TracChangeset for help on using the changeset viewer.