Changeset 2f26687a
- Timestamp:
- Mar 14, 2017, 3:17:20 PM (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:
- 1fbab5a
- Parents:
- 88d1066 (diff), 4da6a6c (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. - Files:
-
- 3 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified Jenkinsfile ¶
r88d1066 r2f26687a 13 13 14 14 compiler = null 15 arch_name = '' 15 16 architecture = '' 16 17 … … 147 148 148 149 compiler = compiler_from_params( pCompiler ) 149 architecture = architecture_from_params( pArchitecture ) 150 arch_name = pArchitecture 151 architecture = architecture_from_params( arch_name ) 150 152 151 153 do_alltests = (pRunAllTests == 'true') … … 156 158 157 159 echo """Compiler : ${compiler.cc_name} (${compiler.cpp_cc}/${compiler.cfa_cc}) 158 Architecture : ${architecture} 160 Architecture : ${arch_name} 161 Arc Flags : ${architecture} 159 162 Run All Tests : ${ pRunAllTests.toString() } 160 163 Run Benchmark : ${ pRunBenchmark.toString() } … … 287 290 288 291 //Write the commit id to Benchmark 289 writeFile file: 'bench.csv', text:'data=' + gitRefNewValue + ',' 292 writeFile file: 'bench.csv', text:'data=' + gitRefNewValue + ',' + arch_name + ',' 290 293 291 294 //Append bench results -
TabularUnified src/CodeGen/CodeGenerator.cc ¶
r88d1066 r2f26687a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Mar 5 17:13:33201713 // Update Count : 47 512 // Last Modified On : Mon Mar 13 23:56:59 2017 13 // Update Count : 477 14 14 // 15 15 … … 895 895 896 896 void CodeGenerator::handleStorageClass( DeclarationWithType * decl ) { 897 if ( decl->get_storageClasses(). any()) {897 if ( decl->get_storageClasses().val != 0 ) { 898 898 DeclarationNode::print_StorageClass( output, decl->get_storageClasses() ); 899 899 } // if -
TabularUnified src/Common/utility.h ¶
r88d1066 r2f26687a 265 265 reverse_iterate_t< T > reverseIterate( T & ref ) { 266 266 return reverse_iterate_t< T >( ref ); 267 } 268 269 template< typename OutType, typename Range, typename Functor > 270 OutType map_range( const Range& range, Functor&& functor ) { 271 OutType out; 272 273 std::transform( 274 begin( range ), 275 end( range ), 276 std::back_inserter( out ), 277 std::forward< Functor >( functor ) 278 ); 279 280 return out; 267 281 } 268 282 -
TabularUnified src/GenPoly/Box.cc ¶
r88d1066 r2f26687a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 6 23:45:59 201713 // Update Count : 33 012 // Last Modified On : Tue Mar 14 07:45:29 2017 13 // Update Count : 334 14 14 // 15 15 … … 299 299 // because each unit generates copies of the default routines for each aggregate. 300 300 FunctionDecl *layoutDecl = new FunctionDecl( layoutofName( typeDecl ), 301 functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::Static Class),301 functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::Static ), 302 302 LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ), 303 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline Spec) );303 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ); 304 304 layoutDecl->fixUniqueId(); 305 305 return layoutDecl; -
TabularUnified src/InitTweak/FixGlobalInit.cc ¶
r88d1066 r2f26687a 10 10 // Created On : Mon May 04 15:14:56 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 6 23:14:19201713 // Update Count : 1 412 // Last Modified On : Mon Mar 13 23:58:27 2017 13 // Update Count : 16 14 14 // 15 15 … … 87 87 dtorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) ); 88 88 } 89 initFunction = new FunctionDecl( "_init_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::Static Class), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );89 initFunction = new FunctionDecl( "_init_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) ); 90 90 initFunction->get_attributes().push_back( new Attribute( "constructor", ctorParameters ) ); 91 destroyFunction = new FunctionDecl( "_destroy_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::Static Class), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );91 destroyFunction = new FunctionDecl( "_destroy_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) ); 92 92 destroyFunction->get_attributes().push_back( new Attribute( "destructor", dtorParameters ) ); 93 93 } … … 143 143 // compile-command: "make install" // 144 144 // End: // 145 -
TabularUnified src/InitTweak/FixInit.cc ¶
r88d1066 r2f26687a 10 10 // Created On : Wed Jan 13 16:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 7 07:51:40201713 // Update Count : 5912 // Last Modified On : Tue Mar 14 08:05:28 2017 13 // Update Count : 63 14 14 // 15 15 … … 678 678 assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() ); 679 679 if ( Statement * ctor = ctorInit->get_ctor() ) { 680 if ( objDecl->get_storageClasses() [ DeclarationNode::Static ]) {680 if ( objDecl->get_storageClasses().is_static ) { 681 681 // originally wanted to take advantage of gcc nested functions, but 682 682 // we get memory errors with this approach. To remedy this, the static … … 704 704 BasicType * boolType = new BasicType( Type::Qualifiers(), BasicType::Bool ); 705 705 SingleInit * boolInitExpr = new SingleInit( new ConstantExpr( Constant( boolType->clone(), "1" ) ), noDesignators ); 706 ObjectDecl * isUninitializedVar = new ObjectDecl( objDecl->get_mangleName() + "_uninitialized", DeclarationNode::StorageClasses( DeclarationNode::Static Class), LinkageSpec::Cforall, 0, boolType, boolInitExpr );706 ObjectDecl * isUninitializedVar = new ObjectDecl( objDecl->get_mangleName() + "_uninitialized", DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::Cforall, 0, boolType, boolInitExpr ); 707 707 isUninitializedVar->fixUniqueId(); 708 708 … … 731 731 732 732 // void __objName_dtor_atexitN(...) {...} 733 FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), DeclarationNode::StorageClasses( DeclarationNode::Static Class), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );733 FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) ); 734 734 dtorCaller->fixUniqueId(); 735 735 dtorCaller->get_statements()->push_back( dtorStmt ); … … 764 764 // create a new object which is never used 765 765 static UniqueName dummyNamer( "_dummy" ); 766 ObjectDecl * dummy = new ObjectDecl( dummyNamer.newName(), DeclarationNode::StorageClasses( DeclarationNode::Static Class), LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), 0, std::list< Attribute * >{ new Attribute("unused") } );766 ObjectDecl * dummy = new ObjectDecl( dummyNamer.newName(), DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), 0, std::list< Attribute * >{ new Attribute("unused") } ); 767 767 return dummy; 768 768 } … … 821 821 void InsertDtors::visit( ObjectDecl * objDecl ) { 822 822 // remember non-static destructed objects so that their destructors can be inserted later 823 if ( ! objDecl->get_storageClasses() [ DeclarationNode::Static ]) {823 if ( ! objDecl->get_storageClasses().is_static ) { 824 824 if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) { 825 825 // a decision should have been made by the resolver, so ctor and init are not both non-NULL -
TabularUnified src/InitTweak/GenInit.cc ¶
r88d1066 r2f26687a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 7 07:51:38201713 // Update Count : 1 7912 // Last Modified On : Mon Mar 13 23:59:09 2017 13 // Update Count : 180 14 14 // 15 15 … … 186 186 // C doesn't allow variable sized arrays at global scope or for static variables, so don't hoist dimension. 187 187 if ( ! inFunction ) return; 188 if ( storageClasses [ DeclarationNode::StaticClass]) return;188 if ( storageClasses.is_static ) return; 189 189 190 190 if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) { -
TabularUnified src/InitTweak/InitTweak.cc ¶
r88d1066 r2f26687a 260 260 (objDecl->get_init() == NULL || 261 261 ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() )) 262 && ! objDecl->get_storageClasses() [ DeclarationNode::Extern ];262 && ! objDecl->get_storageClasses().is_extern; 263 263 } 264 264 -
TabularUnified src/Makefile.am ¶
r88d1066 r2f26687a 27 27 include CodeGen/module.mk 28 28 include CodeTools/module.mk 29 include Concurrency/module.mk 29 30 include Common/module.mk 30 31 include ControlStruct/module.mk -
TabularUnified src/Makefile.in ¶
r88d1066 r2f26687a 24 24 #SRC += ArgTweak/Rewriter.cc \ 25 25 # ArgTweak/Mutate.cc 26 27 ######################### -*- Mode: Makefile-Gmake -*- ######################## 28 ############################################################################### 26 29 27 30 ######################### -*- Mode: Makefile-Gmake -*- ######################## … … 76 79 DIST_COMMON = $(srcdir)/CodeGen/module.mk \ 77 80 $(srcdir)/CodeTools/module.mk $(srcdir)/Common/module.mk \ 81 $(srcdir)/Concurrency/module.mk \ 78 82 $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk \ 79 83 $(srcdir)/InitTweak/module.mk $(srcdir)/Makefile.am \ … … 104 108 CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT) \ 105 109 CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT) \ 110 Concurrency/driver_cfa_cpp-Keywords.$(OBJEXT) \ 106 111 Common/driver_cfa_cpp-SemanticError.$(OBJEXT) \ 107 112 Common/driver_cfa_cpp-UniqueName.$(OBJEXT) \ … … 383 388 CodeGen/FixNames.cc CodeGen/FixMain.cc \ 384 389 CodeGen/OperatorTable.cc CodeTools/DeclStats.cc \ 385 Co mmon/SemanticError.cc Common/UniqueName.cc \386 Common/ DebugMalloc.cc Common/Assert.cc \390 Concurrency/Keywords.cc Common/SemanticError.cc \ 391 Common/UniqueName.cc Common/DebugMalloc.cc Common/Assert.cc \ 387 392 ControlStruct/LabelGenerator.cc ControlStruct/LabelFixer.cc \ 388 393 ControlStruct/MLEMutator.cc ControlStruct/Mutate.cc \ … … 447 452 .SUFFIXES: 448 453 .SUFFIXES: .cc .ll .o .obj .yy 449 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Co mmon/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(am__configure_deps)454 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(am__configure_deps) 450 455 @for dep in $?; do \ 451 456 case '$(am__configure_deps)' in \ … … 468 473 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 469 474 esac; 470 $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Co mmon/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk:475 $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk: 471 476 472 477 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) … … 541 546 CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT): \ 542 547 CodeTools/$(am__dirstamp) CodeTools/$(DEPDIR)/$(am__dirstamp) 548 Concurrency/$(am__dirstamp): 549 @$(MKDIR_P) Concurrency 550 @: > Concurrency/$(am__dirstamp) 551 Concurrency/$(DEPDIR)/$(am__dirstamp): 552 @$(MKDIR_P) Concurrency/$(DEPDIR) 553 @: > Concurrency/$(DEPDIR)/$(am__dirstamp) 554 Concurrency/driver_cfa_cpp-Keywords.$(OBJEXT): \ 555 Concurrency/$(am__dirstamp) \ 556 Concurrency/$(DEPDIR)/$(am__dirstamp) 543 557 Common/$(am__dirstamp): 544 558 @$(MKDIR_P) Common … … 833 847 -rm -f Common/driver_cfa_cpp-SemanticError.$(OBJEXT) 834 848 -rm -f Common/driver_cfa_cpp-UniqueName.$(OBJEXT) 849 -rm -f Concurrency/driver_cfa_cpp-Keywords.$(OBJEXT) 835 850 -rm -f ControlStruct/driver_cfa_cpp-ForExprMutator.$(OBJEXT) 836 851 -rm -f ControlStruct/driver_cfa_cpp-LabelFixer.$(OBJEXT) … … 943 958 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po@am__quote@ 944 959 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po@am__quote@ 960 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Po@am__quote@ 945 961 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Po@am__quote@ 946 962 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Po@am__quote@ … … 1179 1195 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-DeclStats.obj `if test -f 'CodeTools/DeclStats.cc'; then $(CYGPATH_W) 'CodeTools/DeclStats.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/DeclStats.cc'; fi` 1180 1196 1197 Concurrency/driver_cfa_cpp-Keywords.o: Concurrency/Keywords.cc 1198 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Keywords.o -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo -c -o Concurrency/driver_cfa_cpp-Keywords.o `test -f 'Concurrency/Keywords.cc' || echo '$(srcdir)/'`Concurrency/Keywords.cc 1199 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Po 1200 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Concurrency/Keywords.cc' object='Concurrency/driver_cfa_cpp-Keywords.o' libtool=no @AMDEPBACKSLASH@ 1201 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1202 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Keywords.o `test -f 'Concurrency/Keywords.cc' || echo '$(srcdir)/'`Concurrency/Keywords.cc 1203 1204 Concurrency/driver_cfa_cpp-Keywords.obj: Concurrency/Keywords.cc 1205 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Keywords.obj -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo -c -o Concurrency/driver_cfa_cpp-Keywords.obj `if test -f 'Concurrency/Keywords.cc'; then $(CYGPATH_W) 'Concurrency/Keywords.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Keywords.cc'; fi` 1206 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Po 1207 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Concurrency/Keywords.cc' object='Concurrency/driver_cfa_cpp-Keywords.obj' libtool=no @AMDEPBACKSLASH@ 1208 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1209 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Keywords.obj `if test -f 'Concurrency/Keywords.cc'; then $(CYGPATH_W) 'Concurrency/Keywords.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Keywords.cc'; fi` 1210 1181 1211 Common/driver_cfa_cpp-SemanticError.o: Common/SemanticError.cc 1182 1212 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-SemanticError.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Tpo -c -o Common/driver_cfa_cpp-SemanticError.o `test -f 'Common/SemanticError.cc' || echo '$(srcdir)/'`Common/SemanticError.cc … … 2666 2696 -rm -f Common/$(DEPDIR)/$(am__dirstamp) 2667 2697 -rm -f Common/$(am__dirstamp) 2698 -rm -f Concurrency/$(DEPDIR)/$(am__dirstamp) 2699 -rm -f Concurrency/$(am__dirstamp) 2668 2700 -rm -f ControlStruct/$(DEPDIR)/$(am__dirstamp) 2669 2701 -rm -f ControlStruct/$(am__dirstamp) … … 2697 2729 2698 2730 distclean: distclean-am 2699 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Con trolStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)2731 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) 2700 2732 -rm -f Makefile 2701 2733 distclean-am: clean-am distclean-compile distclean-generic \ … … 2743 2775 2744 2776 maintainer-clean: maintainer-clean-am 2745 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Con trolStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)2777 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) 2746 2778 -rm -f Makefile 2747 2779 maintainer-clean-am: distclean-am maintainer-clean-generic -
TabularUnified src/Parser/DeclarationNode.cc ¶
r88d1066 r2f26687a 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 7 17:28:56201713 // Update Count : 9 3712 // Last Modified On : Tue Mar 14 10:19:38 2017 13 // Update Count : 964 14 14 // 15 15 … … 90 90 newnode->type = maybeClone( type ); 91 91 newnode->storageClasses = storageClasses; 92 newnode->funcSpecs = funcSpecs; 92 93 newnode->bitfieldWidth = maybeClone( bitfieldWidth ); 93 newnode->funcSpecs = funcSpecs;94 94 newnode->enumeratorValue.reset( maybeClone( enumeratorValue.get() ) ); 95 95 newnode->hasEllipsis = hasEllipsis; … … 117 117 118 118 void DeclarationNode::print_StorageClass( std::ostream & output, StorageClasses storageClasses ) { 119 if ( storageClasses. any() ) { // function specifiers?119 if ( storageClasses.val != 0 ) { // storage classes ? 120 120 for ( unsigned int i = 0; i < DeclarationNode::NoStorageClass; i += 1 ) { 121 121 if ( storageClasses[i] ) { … … 127 127 128 128 void DeclarationNode::print_FuncSpec( std::ostream & output, DeclarationNode::FuncSpecifiers funcSpec ) { 129 if ( funcSpec. any() ) { // function specifiers?129 if ( funcSpec.val != 0 ) { // function specifiers ? 130 130 for ( unsigned int i = 0; i < DeclarationNode::NoFuncSpecifier; i += 1 ) { 131 131 if ( funcSpec[i] ) { … … 202 202 203 203 204 DeclarationNode * DeclarationNode::newStorageClass( DeclarationNode::StorageClass sc ) {205 DeclarationNode * newnode = new DeclarationNode; 206 newnode->storageClasses [ sc ] = true;204 DeclarationNode * DeclarationNode::newStorageClass( DeclarationNode::StorageClasses sc ) { 205 DeclarationNode * newnode = new DeclarationNode; 206 newnode->storageClasses = sc; 207 207 return newnode; 208 208 } // DeclarationNode::newStorageClass 209 209 210 DeclarationNode * DeclarationNode::newFuncSpecifier( DeclarationNode::FuncSpecifier fs ) {211 DeclarationNode * newnode = new DeclarationNode; 212 newnode->funcSpecs [ fs ] = true;210 DeclarationNode * DeclarationNode::newFuncSpecifier( DeclarationNode::FuncSpecifiers fs ) { 211 DeclarationNode * newnode = new DeclarationNode; 212 newnode->funcSpecs = fs; 213 213 return newnode; 214 214 } // DeclarationNode::newFuncSpecifier … … 459 459 const TypeData::TypeQualifiers qsrc = src->typeQualifiers, qdst = dst->typeQualifiers; // optimization 460 460 461 if ( (qsrc & qdst).any() ) { // common qualifier?462 for ( unsigned int i = 0; i < NoTypeQualifier; i += 1 ) { // find common qualifiers461 if ( (qsrc & qdst).any() ) { // duplicates ? 462 for ( unsigned int i = 0; i < NoTypeQualifier; i += 1 ) { // find duplicates 463 463 if ( qsrc[i] && qdst[i] ) { 464 464 appendError( error, string( "duplicate " ) + DeclarationNode::typeQualifierNames[i] ); … … 469 469 470 470 void DeclarationNode::checkSpecifiers( DeclarationNode * src ) { 471 if ( (funcSpecs & src->funcSpecs).any() ) { // common specifier?472 for ( unsigned int i = 0; i < NoFuncSpecifier; i += 1 ) { // find common specifier471 if ( (funcSpecs.val & src->funcSpecs.val) != 0 ) { // duplicates ? 472 for ( unsigned int i = 0; i < NoFuncSpecifier; i += 1 ) { // find duplicates 473 473 if ( funcSpecs[i] && src->funcSpecs[i] ) { 474 474 appendError( error, string( "duplicate " ) + DeclarationNode::funcSpecifierNames[i] ); … … 477 477 } // if 478 478 479 if ( storageClasses != 0 && src->storageClasses!= 0 ) { // any reason to check ?480 if ( (storageClasses & src->storageClasses).any()) { // duplicates ?479 if ( storageClasses.val != 0 && src->storageClasses.val != 0 ) { // any reason to check ? 480 if ( (storageClasses.val & src->storageClasses.val ) != 0 ) { // duplicates ? 481 481 for ( unsigned int i = 0; i < NoStorageClass; i += 1 ) { // find duplicates 482 482 if ( storageClasses[i] && src->storageClasses[i] ) { … … 485 485 } // for 486 486 // src is the new item being added and has a single bit 487 } else if ( ! src->storageClasses [ Threadlocal ]) { // conflict ?488 appendError( error, string( "conflicting " ) + storageClassNames[ffs( storageClasses. to_ulong()) - 1] +489 " & " + storageClassNames[ffs( src->storageClasses. to_ulong()) - 1] );490 src->storageClasses. reset(); // FIX to preserve invariant of one basic storage specifier487 } else if ( ! src->storageClasses.is_threadlocal ) { // conflict ? 488 appendError( error, string( "conflicting " ) + storageClassNames[ffs( storageClasses.val ) - 1] + 489 " & " + storageClassNames[ffs( src->storageClasses.val ) - 1] ); 490 src->storageClasses.val = 0; // FIX to preserve invariant of one basic storage specifier 491 491 } // if 492 492 } // if … … 496 496 497 497 DeclarationNode * DeclarationNode::copySpecifiers( DeclarationNode * q ) { 498 funcSpecs = funcSpecs | q->funcSpecs;499 storageClasses = storageClasses | q->storageClasses;498 funcSpecs.val = funcSpecs.val | q->funcSpecs.val; 499 storageClasses.val = storageClasses.val | q->storageClasses.val; 500 500 501 501 for ( Attribute *attr: reverseIterate( q->attributes ) ) { … … 1058 1058 // inline _Noreturn int g( int i ); // allowed 1059 1059 // inline _Noreturn int i; // disallowed 1060 if ( type->kind != TypeData::Function && funcSpecs. any()) {1060 if ( type->kind != TypeData::Function && funcSpecs.val != 0 ) { 1061 1061 throw SemanticError( "invalid function specifier for ", this ); 1062 1062 } // if … … 1068 1068 // inlne _Noreturn struct S { ... }; // disallowed 1069 1069 // inlne _Noreturn enum E { ... }; // disallowed 1070 if ( funcSpecs. any()) {1070 if ( funcSpecs.val != 0 ) { 1071 1071 throw SemanticError( "invalid function specifier for ", this ); 1072 1072 } // if -
TabularUnified src/Parser/ParseNode.h ¶
r88d1066 r2f26687a 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 7 08:10:53201713 // Update Count : 7 2612 // Last Modified On : Tue Mar 14 11:05:05 2017 13 // Update Count : 752 14 14 // 15 15 … … 204 204 // These must remain in the same order as the corresponding DeclarationNode names. 205 205 206 enum StorageClass { Extern, Static, Auto, Register, Threadlocal, NoStorageClass, 207 ExternClass = 1 << Extern, StaticClass = 1 << Static, AutoClass = 1 << Auto, RegisterClass = 1 << Register, ThreadlocalClass = 1 << Threadlocal }; 208 enum FuncSpecifier { Inline, Noreturn, Fortran, NoFuncSpecifier, 209 InlineSpec = 1 << Inline, NoreturnSpec = 1 << Noreturn, FortranSpec = 1 << Fortran }; 206 enum { Extern = 1 << 0, Static = 1 << 1, Auto = 1 << 2, Register = 1 << 3, Threadlocal = 1 << 4, NoStorageClass = 5 }; 207 union StorageClasses { 208 unsigned int val; 209 struct { 210 bool is_extern : 1; 211 bool is_static : 1; 212 bool is_auto : 1; 213 bool is_register : 1; 214 bool is_threadlocal : 1; 215 }; 216 StorageClasses() : val( 0 ) {} 217 StorageClasses( unsigned int val ) : val( val ) {} 218 bool operator[]( unsigned int i ) const { return val & (1 << i); } 219 }; // StorageClasses 220 221 enum { Inline = 1 << 0, Noreturn = 1 << 1, Fortran = 1 << 2, NoFuncSpecifier = 3 }; 222 union FuncSpecifiers { 223 unsigned int val; 224 struct { 225 bool is_inline : 1; 226 bool is_noreturn : 1; 227 bool is_fortran : 1; 228 }; 229 FuncSpecifiers() : val( 0 ) {} 230 FuncSpecifiers( unsigned int val ) : val( val ) {} 231 bool operator[]( unsigned int i ) const { return val & (1 << i); } 232 }; // FuncSpecifiers 233 210 234 enum TypeQualifier { Const, Restrict, Volatile, Lvalue, Mutex, Atomic, NoTypeQualifier }; 211 235 enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, NoBasicType }; … … 228 252 static const char * builtinTypeNames[]; 229 253 230 static DeclarationNode * newStorageClass( StorageClass );231 static DeclarationNode * newFuncSpecifier( FuncSpecifier );254 static DeclarationNode * newStorageClass( StorageClasses ); 255 static DeclarationNode * newFuncSpecifier( FuncSpecifiers ); 232 256 static DeclarationNode * newTypeQualifier( TypeQualifier ); 233 257 static DeclarationNode * newBasicType( BasicType ); … … 326 350 TypeData * type; 327 351 328 typedef std::bitset< DeclarationNode::NoStorageClass > StorageClasses;329 352 StorageClasses storageClasses; 330 353 static void print_StorageClass( std::ostream & output, StorageClasses storageClasses ); 331 354 332 typedef std::bitset< DeclarationNode::NoFuncSpecifier > FuncSpecifiers;333 355 FuncSpecifiers funcSpecs; 334 356 static void print_FuncSpec( std::ostream & output, FuncSpecifiers funcSpecs ); -
TabularUnified src/SymTab/Autogen.cc ¶
r88d1066 r2f26687a 10 10 // Created On : Thu Mar 03 15:45:56 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 7 07:42:44201713 // Update Count : 5 112 // Last Modified On : Tue Mar 14 07:45:00 2017 13 // Update Count : 54 14 14 // 15 15 … … 162 162 // because each unit generates copies of the default routines for each aggregate. 163 163 // DeclarationNode::StorageClass sc = functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static; 164 DeclarationNode::StorageClasses scs = functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::Static Class);164 DeclarationNode::StorageClasses scs = functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::Static ); 165 165 LinkageSpec::Spec spec = isIntrinsic ? LinkageSpec::Intrinsic : LinkageSpec::AutoGen; 166 166 FunctionDecl * decl = new FunctionDecl( fname, scs, spec, ftype, new CompoundStmt( noLabels ), 167 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline Spec) );167 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ); 168 168 decl->fixUniqueId(); 169 169 return decl; … … 720 720 TypeInstType * inst = new TypeInstType( Type::Qualifiers(), newDecl->get_name(), newDecl ); 721 721 newDecl->get_assertions().push_back( new FunctionDecl( "?=?", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genAssignType( inst ), nullptr, 722 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline Spec) ) );722 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) ); 723 723 newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genDefaultType( inst ), nullptr, 724 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline Spec) ) );724 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) ); 725 725 newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genCopyType( inst ), nullptr, 726 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline Spec) ) );726 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) ); 727 727 newDecl->get_assertions().push_back( new FunctionDecl( "^?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genDefaultType( inst ), nullptr, 728 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline Spec) ) );728 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) ); 729 729 typeParams.push_back( newDecl ); 730 730 done.insert( ty->get_baseType() ); -
TabularUnified src/SymTab/Autogen.h ¶
r88d1066 r2f26687a 58 58 assert( type ); 59 59 Type * castType = type->clone(); 60 castType->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true );60 castType->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true, false); 61 61 castType->set_isLvalue( true ); // xxx - might not need this 62 62 dstParam = new CastExpr( dstParam, new PointerType( Type::Qualifiers(), castType ) ); -
TabularUnified src/SymTab/Indexer.cc ¶
r88d1066 r2f26687a 10 10 // Created On : Sun May 17 21:37:33 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 7 07:45:32201713 // Update Count : 1 612 // Last Modified On : Tue Mar 14 08:07:34 2017 13 // Update Count : 17 14 14 // 15 15 … … 743 743 ObjectDecl *newobj = dynamic_cast< ObjectDecl* >( added ); 744 744 ObjectDecl *oldobj = dynamic_cast< ObjectDecl* >( existing ); 745 if ( ! newobj->get_storageClasses() [ DeclarationNode::Extern ] && ! oldobj->get_storageClasses()[ DeclarationNode::Extern ]) {745 if ( ! newobj->get_storageClasses().is_extern && ! oldobj->get_storageClasses().is_extern ) { 746 746 throw SemanticError( "duplicate object definition for ", added ); 747 747 } // if -
TabularUnified src/SymTab/Validate.cc ¶
r88d1066 r2f26687a 323 323 ObjectDecl * obj = dynamic_cast< ObjectDecl * >( *i ); 324 324 assert( obj ); 325 obj->set_type( new EnumInstType( Type::Qualifiers( true, false, false, false, false ), enumDecl->get_name() ) );325 obj->set_type( new EnumInstType( Type::Qualifiers( true, false, false, false, false, false ), enumDecl->get_name() ) ); 326 326 } // for 327 327 Parent::visit( enumDecl ); -
TabularUnified src/SynTree/Type.h ¶
r88d1066 r2f26687a 25 25 public: 26 26 struct Qualifiers { 27 Qualifiers(): isConst( false ), isVolatile( false ), isRestrict( false ), isLvalue( false ), isAtomic( false ) {}28 Qualifiers( bool isConst, bool isVolatile, bool isRestrict, bool isLvalue, bool isAtomic ): isConst( isConst ), isVolatile( isVolatile ), isRestrict( isRestrict ), isLvalue( isLvalue ), isAtomic( isAtomic) {}27 Qualifiers(): isConst( false ), isVolatile( false ), isRestrict( false ), isLvalue( false ), isAtomic( false ), isMutex( false ) {} 28 Qualifiers( bool isConst, bool isVolatile, bool isRestrict, bool isLvalue, bool isAtomic, bool isMutex ): isConst( isConst ), isVolatile( isVolatile ), isRestrict( isRestrict ), isLvalue( isLvalue ), isAtomic( isAtomic ), isMutex( isMutex ) {} 29 29 30 30 Qualifiers &operator&=( const Qualifiers &other ); … … 45 45 bool isLvalue; 46 46 bool isAtomic; 47 bool isMutex; 47 48 }; 48 49 … … 511 512 isLvalue &= other.isLvalue; 512 513 isAtomic &= other.isAtomic; 514 isMutex &= other.isMutex; 513 515 return *this; 514 516 } … … 520 522 isLvalue |= other.isLvalue; 521 523 isAtomic |= other.isAtomic; 524 isMutex |= other.isMutex; 522 525 return *this; 523 526 } … … 528 531 if ( other.isRestrict ) isRestrict = 0; 529 532 if ( other.isAtomic ) isAtomic = 0; 533 if ( other.isMutex ) isMutex = 0; 530 534 return *this; 531 535 } -
TabularUnified src/Tuples/TupleAssignment.cc ¶
r88d1066 r2f26687a 199 199 Type * type = InitTweak::getPointerBase( castType ); 200 200 assert( type ); 201 type->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true );201 type->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true, false); 202 202 type->set_isLvalue( true ); // xxx - might not need this 203 203 expr = new CastExpr( expr, castType ); -
TabularUnified src/Tuples/TupleExpansion.cc ¶
r88d1066 r2f26687a 305 305 Type * makeTupleType( const std::list< Expression * > & exprs ) { 306 306 // produce the TupleType which aggregates the types of the exprs 307 TupleType *tupleType = new TupleType( Type::Qualifiers(true, true, true, true, true ) );307 TupleType *tupleType = new TupleType( Type::Qualifiers(true, true, true, true, true, true) ); 308 308 Type::Qualifiers &qualifiers = tupleType->get_qualifiers(); 309 309 for ( Expression * expr : exprs ) { -
TabularUnified src/main.cc ¶
r88d1066 r2f26687a 32 32 #include "GenPoly/CopyParams.h" 33 33 #include "GenPoly/InstantiateGeneric.h" 34 #include "Concurrency/Keywords.h" 34 35 #include "CodeGen/Generate.h" 35 36 #include "CodeGen/FixNames.h" … … 236 237 OPTPRINT( "mutate" ) 237 238 ControlStruct::mutate( translationUnit ); 239 OPTPRINT( "Concurrency" ) 240 Concurrency::applyKeywords( translationUnit ); 238 241 OPTPRINT( "fixNames" ) 239 242 CodeGen::fixNames( translationUnit );
Note: See TracChangeset
for help on using the changeset viewer.