Changeset fb114fa1
- Timestamp:
- Sep 27, 2016, 11:22:48 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 4b1fd2c
- Parents:
- 3b5e3aa
- Location:
- src
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/SemanticError.h
r3b5e3aa rfb114fa1 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 8 14:38:53 201513 // Update Count : 412 // Last Modified On : Sat Sep 24 15:13:42 2016 13 // Update Count : 5 14 14 // 15 15 … … 46 46 } 47 47 48 49 48 #endif // SEMANTICERROR_H 50 49 -
src/Common/module.mk
r3b5e3aa rfb114fa1 11 11 ## Created On : Mon Jun 1 17:49:17 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : T hu Aug 18 13:29:04201614 ## Update Count : 213 ## Last Modified On : Tue Sep 27 11:06:38 2016 14 ## Update Count : 4 15 15 ############################################################################### 16 16 17 17 SRC += Common/SemanticError.cc \ 18 18 Common/UniqueName.cc \ 19 Common/DebugMalloc.cc \ 19 20 Common/Assert.cc -
src/Makefile.am
r3b5e3aa rfb114fa1 11 11 ## Created On : Sun May 31 08:51:46 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sat Aug 20 11:13:12 201614 ## Update Count : 7 113 ## Last Modified On : Sat Sep 24 15:03:52 2016 14 ## Update Count : 73 15 15 ############################################################################### 16 16 … … 40 40 cfa_cpplib_PROGRAMS = driver/cfa-cpp 41 41 driver_cfa_cpp_SOURCES = ${SRC} 42 driver_cfa_cpp_LDADD = ${LEXLIB} # yywrap42 driver_cfa_cpp_LDADD = ${LEXLIB} -ldl # yywrap 43 43 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include 44 44 -
src/Makefile.in
r3b5e3aa rfb114fa1 98 98 Common/driver_cfa_cpp-SemanticError.$(OBJEXT) \ 99 99 Common/driver_cfa_cpp-UniqueName.$(OBJEXT) \ 100 Common/driver_cfa_cpp-Interpose.$(OBJEXT) \ 100 101 Common/driver_cfa_cpp-Assert.$(OBJEXT) \ 101 102 ControlStruct/driver_cfa_cpp-LabelGenerator.$(OBJEXT) \ … … 359 360 CodeGen/CodeGenerator.cc CodeGen/GenType.cc \ 360 361 CodeGen/FixNames.cc CodeGen/OperatorTable.cc \ 361 Common/SemanticError.cc Common/UniqueName.cc Common/Assert.cc \ 362 Common/SemanticError.cc Common/UniqueName.cc \ 363 Common/Interpose.cc Common/Assert.cc \ 362 364 ControlStruct/LabelGenerator.cc ControlStruct/LabelFixer.cc \ 363 365 ControlStruct/MLEMutator.cc ControlStruct/Mutate.cc \ … … 414 416 cfa_cpplibdir = ${libdir} 415 417 driver_cfa_cpp_SOURCES = ${SRC} 416 driver_cfa_cpp_LDADD = ${LEXLIB} # yywrap418 driver_cfa_cpp_LDADD = ${LEXLIB} -ldl # yywrap 417 419 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include 418 420 all: $(BUILT_SOURCES) … … 514 516 Common/$(DEPDIR)/$(am__dirstamp) 515 517 Common/driver_cfa_cpp-UniqueName.$(OBJEXT): Common/$(am__dirstamp) \ 518 Common/$(DEPDIR)/$(am__dirstamp) 519 Common/driver_cfa_cpp-Interpose.$(OBJEXT): Common/$(am__dirstamp) \ 516 520 Common/$(DEPDIR)/$(am__dirstamp) 517 521 Common/driver_cfa_cpp-Assert.$(OBJEXT): Common/$(am__dirstamp) \ … … 789 793 -rm -f CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT) 790 794 -rm -f Common/driver_cfa_cpp-Assert.$(OBJEXT) 795 -rm -f Common/driver_cfa_cpp-Interpose.$(OBJEXT) 791 796 -rm -f Common/driver_cfa_cpp-SemanticError.$(OBJEXT) 792 797 -rm -f Common/driver_cfa_cpp-UniqueName.$(OBJEXT) … … 895 900 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po@am__quote@ 896 901 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po@am__quote@ 902 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-Interpose.Po@am__quote@ 897 903 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po@am__quote@ 898 904 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po@am__quote@ … … 1132 1138 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-UniqueName.obj `if test -f 'Common/UniqueName.cc'; then $(CYGPATH_W) 'Common/UniqueName.cc'; else $(CYGPATH_W) '$(srcdir)/Common/UniqueName.cc'; fi` 1133 1139 1140 Common/driver_cfa_cpp-Interpose.o: Common/Interpose.cc 1141 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-Interpose.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-Interpose.Tpo -c -o Common/driver_cfa_cpp-Interpose.o `test -f 'Common/Interpose.cc' || echo '$(srcdir)/'`Common/Interpose.cc 1142 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-Interpose.Tpo Common/$(DEPDIR)/driver_cfa_cpp-Interpose.Po 1143 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/Interpose.cc' object='Common/driver_cfa_cpp-Interpose.o' libtool=no @AMDEPBACKSLASH@ 1144 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1145 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-Interpose.o `test -f 'Common/Interpose.cc' || echo '$(srcdir)/'`Common/Interpose.cc 1146 1147 Common/driver_cfa_cpp-Interpose.obj: Common/Interpose.cc 1148 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-Interpose.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-Interpose.Tpo -c -o Common/driver_cfa_cpp-Interpose.obj `if test -f 'Common/Interpose.cc'; then $(CYGPATH_W) 'Common/Interpose.cc'; else $(CYGPATH_W) '$(srcdir)/Common/Interpose.cc'; fi` 1149 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-Interpose.Tpo Common/$(DEPDIR)/driver_cfa_cpp-Interpose.Po 1150 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/Interpose.cc' object='Common/driver_cfa_cpp-Interpose.obj' libtool=no @AMDEPBACKSLASH@ 1151 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1152 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-Interpose.obj `if test -f 'Common/Interpose.cc'; then $(CYGPATH_W) 'Common/Interpose.cc'; else $(CYGPATH_W) '$(srcdir)/Common/Interpose.cc'; fi` 1153 1134 1154 Common/driver_cfa_cpp-Assert.o: Common/Assert.cc 1135 1155 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-Assert.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo -c -o Common/driver_cfa_cpp-Assert.o `test -f 'Common/Assert.cc' || echo '$(srcdir)/'`Common/Assert.cc -
src/Parser/DeclarationNode.cc
r3b5e3aa rfb114fa1 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Sep 24 11:12:52201613 // Update Count : 6 2712 // Last Modified On : Mon Sep 26 22:18:40 2016 13 // Update Count : 640 14 14 // 15 15 … … 92 92 93 93 newnode->variable.name = variable.name ? new string( *variable.name ) : nullptr; 94 newnode->variable.tyClass = variable.tyClass; 94 95 newnode->variable.assertions = maybeClone( variable.assertions ); 95 newnode->variable.tyClass = variable.tyClass;96 96 97 97 newnode->attr.name = attr.name ? new string( *attr.name ) : nullptr; … … 148 148 } 149 149 150 DeclarationNode * DeclarationNode::newFunction( st d::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle ) {150 DeclarationNode * DeclarationNode::newFunction( string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle ) { 151 151 DeclarationNode * newnode = new DeclarationNode; 152 152 newnode->name = name; 153 154 153 newnode->type = new TypeData( TypeData::Function ); 155 154 newnode->type->function.params = param; … … 222 221 } // DeclarationNode::newLength 223 222 224 DeclarationNode * DeclarationNode::newFromTypedef( st d::string * name ) {223 DeclarationNode * DeclarationNode::newFromTypedef( string * name ) { 225 224 DeclarationNode * newnode = new DeclarationNode; 226 225 newnode->type = new TypeData( TypeData::SymbolicInst ); 227 newnode->type->symbolic.name = name ? new string( *name ) : nullptr;226 newnode->type->symbolic.name = name; 228 227 newnode->type->symbolic.isTypedef = true; 229 228 newnode->type->symbolic.params = nullptr; … … 231 230 } // DeclarationNode::newFromTypedef 232 231 233 DeclarationNode * DeclarationNode::newAggregate( Aggregate kind, const st d::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ) {232 DeclarationNode * DeclarationNode::newAggregate( Aggregate kind, const string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ) { 234 233 DeclarationNode * newnode = new DeclarationNode; 235 234 newnode->type = new TypeData( TypeData::Aggregate ); 236 235 newnode->type->aggregate.kind = kind; 237 236 if ( name ) { 238 newnode->type->aggregate.name = n ew string( *name );237 newnode->type->aggregate.name = name; 239 238 } else { // anonymous aggregate ? 240 239 newnode->type->aggregate.name = new string( anonymous.newName() ); … … 246 245 } // DeclarationNode::newAggregate 247 246 248 DeclarationNode * DeclarationNode::newEnum( std::string * name, DeclarationNode * constants ) { 249 DeclarationNode * newnode = new DeclarationNode; 250 newnode->name = name; 247 DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants ) { 248 DeclarationNode * newnode = new DeclarationNode; 251 249 newnode->type = new TypeData( TypeData::Enum ); 252 250 if ( name ) { 253 newnode->type->enumeration.name = n ew string( *name );251 newnode->type->enumeration.name = name; 254 252 } else { // anonymous aggregate ? 255 253 newnode->type->enumeration.name = new string( anonymous.newName() ); … … 259 257 } // DeclarationNode::newEnum 260 258 261 DeclarationNode * DeclarationNode::newEnumConstant( st d::string * name, ExpressionNode * constant ) {259 DeclarationNode * DeclarationNode::newEnumConstant( string * name, ExpressionNode * constant ) { 262 260 DeclarationNode * newnode = new DeclarationNode; 263 261 newnode->name = name; … … 267 265 } // DeclarationNode::newEnumConstant 268 266 269 DeclarationNode * DeclarationNode::newName( st d::string * name ) {267 DeclarationNode * DeclarationNode::newName( string * name ) { 270 268 DeclarationNode * newnode = new DeclarationNode; 271 269 newnode->name = name; … … 273 271 } // DeclarationNode::newName 274 272 275 DeclarationNode * DeclarationNode::newFromTypeGen( st d::string * name, ExpressionNode * params ) {273 DeclarationNode * DeclarationNode::newFromTypeGen( string * name, ExpressionNode * params ) { 276 274 DeclarationNode * newnode = new DeclarationNode; 277 275 newnode->type = new TypeData( TypeData::SymbolicInst ); 278 newnode->type->symbolic.name = name ? new string( *name ) : nullptr;276 newnode->type->symbolic.name = name; 279 277 newnode->type->symbolic.isTypedef = false; 280 278 newnode->type->symbolic.actuals = params; … … 282 280 } // DeclarationNode::newFromTypeGen 283 281 284 DeclarationNode * DeclarationNode::newTypeParam( TypeClass tc, std::string * name ) { 285 DeclarationNode * newnode = new DeclarationNode; 286 newnode->name = name; 287 // newnode->type = new TypeData( TypeData::Variable ); 282 DeclarationNode * DeclarationNode::newTypeParam( TypeClass tc, string * name ) { 283 DeclarationNode * newnode = new DeclarationNode; 288 284 newnode->type = nullptr; 289 285 newnode->variable.tyClass = tc; 290 newnode->variable.name = n ewnode->name ? new string( *newnode->name ) : nullptr;286 newnode->variable.name = name; 291 287 return newnode; 292 288 } // DeclarationNode::newTypeParam 293 289 294 DeclarationNode * DeclarationNode::newTrait( const st d::string * name, DeclarationNode * params, DeclarationNode * asserts ) {290 DeclarationNode * DeclarationNode::newTrait( const string * name, DeclarationNode * params, DeclarationNode * asserts ) { 295 291 DeclarationNode * newnode = new DeclarationNode; 296 292 newnode->type = new TypeData( TypeData::Aggregate ); … … 302 298 } // DeclarationNode::newTrait 303 299 304 DeclarationNode * DeclarationNode::newTraitUse( const st d::string * name, ExpressionNode * params ) {300 DeclarationNode * DeclarationNode::newTraitUse( const string * name, ExpressionNode * params ) { 305 301 DeclarationNode * newnode = new DeclarationNode; 306 302 newnode->type = new TypeData( TypeData::AggregateInst ); … … 312 308 } // DeclarationNode::newTraitUse 313 309 314 DeclarationNode * DeclarationNode::newTypeDecl( std::string * name, DeclarationNode * typeParams ) { 315 DeclarationNode * newnode = new DeclarationNode; 316 newnode->name = name; 310 DeclarationNode * DeclarationNode::newTypeDecl( string * name, DeclarationNode * typeParams ) { 311 DeclarationNode * newnode = new DeclarationNode; 317 312 newnode->type = new TypeData( TypeData::Symbolic ); 318 313 newnode->type->symbolic.isTypedef = false; 319 314 newnode->type->symbolic.params = typeParams; 320 newnode->type->symbolic.name = n ewnode->name;315 newnode->type->symbolic.name = name; 321 316 return newnode; 322 317 } // DeclarationNode::newTypeDecl … … 377 372 } // DeclarationNode::newBuiltinType 378 373 379 DeclarationNode * DeclarationNode::newAttr( std::string * name, ExpressionNode * expr ) { 380 DeclarationNode * newnode = new DeclarationNode; 381 // newnode->type = new TypeData( TypeData::Attr ); 374 DeclarationNode * DeclarationNode::newAttr( string * name, ExpressionNode * expr ) { 375 DeclarationNode * newnode = new DeclarationNode; 382 376 newnode->type = nullptr; 383 377 newnode->attr.name = name; … … 386 380 } 387 381 388 DeclarationNode * DeclarationNode::newAttr( std::string * name, DeclarationNode * type ) { 389 DeclarationNode * newnode = new DeclarationNode; 390 // newnode->type = new TypeData( TypeData::Attr ); 382 DeclarationNode * DeclarationNode::newAttr( string * name, DeclarationNode * type ) { 383 DeclarationNode * newnode = new DeclarationNode; 391 384 newnode->type = nullptr; 392 385 newnode->attr.name = name; … … 520 513 dst->basictype = src->basictype; 521 514 } else if ( src->basictype != DeclarationNode::NoBasicType ) 522 throw SemanticError( st d::string( "conflicting type specifier " ) + DeclarationNode::basicTypeName[ src->basictype ] + " in type: ", src );515 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::basicTypeName[ src->basictype ] + " in type: ", src ); 523 516 524 517 if ( dst->complextype == DeclarationNode::NoComplexType ) { 525 518 dst->complextype = src->complextype; 526 519 } else if ( src->complextype != DeclarationNode::NoComplexType ) 527 throw SemanticError( st d::string( "conflicting type specifier " ) + DeclarationNode::complexTypeName[ src->complextype ] + " in type: ", src );520 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::complexTypeName[ src->complextype ] + " in type: ", src ); 528 521 529 522 if ( dst->signedness == DeclarationNode::NoSignedness ) { 530 523 dst->signedness = src->signedness; 531 524 } else if ( src->signedness != DeclarationNode::NoSignedness ) 532 throw SemanticError( st d::string( "conflicting type specifier " ) + DeclarationNode::signednessName[ src->signedness ] + " in type: ", src );525 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::signednessName[ src->signedness ] + " in type: ", src ); 533 526 534 527 if ( dst->length == DeclarationNode::NoLength ) { … … 537 530 dst->length = DeclarationNode::LongLong; 538 531 } else if ( src->length != DeclarationNode::NoLength ) 539 throw SemanticError( st d::string( "conflicting type specifier " ) + DeclarationNode::lengthName[ src->length ] + " in type: ", src );532 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::lengthName[ src->length ] + " in type: ", src ); 540 533 } // if 541 534 break; … … 643 636 } 644 637 645 DeclarationNode * DeclarationNode::addName( st d::string * newname ) {638 DeclarationNode * DeclarationNode::addName( string * newname ) { 646 639 assert( ! name ); 647 640 name = newname;
Note: See TracChangeset
for help on using the changeset viewer.