Changeset 2a3d446 for src/SynTree/TypeDecl.cc
- Timestamp:
- Dec 12, 2019, 10:25:49 AM (4 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/TypeDecl.cc
rf80f840 r2a3d446 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Wed Aug 9 14:35:00 201713 // Update Count : 611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 11 17:56:30 2019 13 // Update Count : 10 14 14 // 15 15 … … 18 18 19 19 #include "Common/utility.h" // for maybeClone 20 #include "Parser/ParseNode.h" 20 21 #include "Declaration.h" // for TypeDecl, TypeDecl::Data, TypeDecl::Kind... 21 22 #include "Type.h" // for Type, Type::StorageClasses … … 31 32 } 32 33 33 std::stringTypeDecl::typeString() const {34 static const std::string kindNames[] = { "object type", "function type", "tuple type" };34 const char * TypeDecl::typeString() const { 35 static const char * kindNames[] = { "sized object type", "sized function type", "sized tuple type" }; 35 36 assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "typeString: kindNames is out of sync." ); 36 37 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' 38 39 } 39 40 40 std::stringTypeDecl::genTypeString() const {41 static const std::stringkindNames[] = { "dtype", "ftype", "ttype" };41 const char * TypeDecl::genTypeString() const { 42 static const char * kindNames[] = { "dtype", "ftype", "ttype" }; 42 43 assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "genTypeString: kindNames is out of sync." ); 43 44 assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." );
Note: See TracChangeset
for help on using the changeset viewer.