Changes in / [70284830:0a5b683]
- Files:
-
- 5 added
- 1 deleted
- 15 edited
-
Makefile.in (modified) (1 diff)
-
doc/proposals/tagged-struct.txt (added)
-
doc/working/resolver_design.md (modified) (1 diff)
-
src/CodeGen/CodeGenerator.cc (modified) (13 diffs)
-
src/CodeGen/CodeGenerator.h (modified) (3 diffs)
-
src/Common/Indenter.h (deleted)
-
src/Common/utility.h (modified) (5 diffs)
-
src/ControlStruct/MLEMutator.cc (modified) (2 diffs)
-
src/Makefile.in (modified) (5 diffs)
-
src/Parser/DeclarationNode.cc (modified) (2 diffs)
-
src/Parser/ParseNode.h (modified) (3 diffs)
-
src/Parser/TypeData.cc (modified) (4 diffs)
-
src/ResolvExpr/CurrentObject.cc (modified) (2 diffs)
-
src/ResolvExpr/CurrentObject.h (modified) (1 diff)
-
src/SymTab/TreeStruct.cc (added)
-
src/SymTab/TreeStruct.h (added)
-
src/SymTab/module.mk (modified) (2 diffs)
-
src/SynTree/Declaration.h (modified) (4 diffs)
-
src/libcfa/typeobject.c (added)
-
src/libcfa/typeobject.h (added)
-
src/tests/pybin/tools.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Makefile.in
r70284830 r0a5b683 198 198 $(top_srcdir)/automake/install-sh \ 199 199 $(top_srcdir)/automake/missing INSTALL README automake/compile \ 200 automake/config.guess automake/config.sub automake/ depcomp\201 automake/ install-sh automake/missing automake/ylwrap200 automake/config.guess automake/config.sub automake/install-sh \ 201 automake/missing 202 202 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 203 203 distdir = $(PACKAGE)-$(VERSION) -
doc/working/resolver_design.md
r70284830 r0a5b683 91 91 ## Conversion Costs ## 92 92 Each possible resolution of an expression has a _cost_ tuple consisting of 93 the following components: 94 1. _unsafe_ conversion cost: summed degree of unsafe conversions; unlike CFA03, this is not a simple count of conversions (for symmetry with the safe conversions) 95 2. _polymorphic unifications_: count of parameters and return values bound to some polymorphic type for boxing 96 3. _type variables_: number of polymorphic type variables bound 97 4. negated _type specializations_: Each type assertion specializes the polymorphism, thus decreasing the cost; nested polymorphic types (e.g. `T*`) are also counted as specializations 98 5. _safe_ conversions: summed degree of safe conversions 99 6. _qualifier_ conversions: summed degree of qualifier and reference conversions 93 the following components: _unsafe_ conversion cost, _polymorphic_ 94 specialization cost, _safe_ conversion cost, a count of _explicit_ 95 conversions, and _qualifier_ conversion cost. 100 96 These components are lexically-ordered and can be summed element-wise; 101 97 summation starts at `(0, 0, 0, 0, 0)`. 102 103 **TODO** update below for consistency with this104 98 105 99 ### Lvalue and Qualifier Conversions ### -
src/CodeGen/CodeGenerator.cc
r70284830 r0a5b683 64 64 } // extension 65 65 66 ostream & CodeGenerator::Indenter::operator()( ostream & output ) const { 67 return output << string( cg.cur_indent, ' ' ); 68 } 69 70 ostream & operator<<( ostream & output, const CodeGenerator::Indenter &indent ) { 71 return indent( output ); 72 } 73 66 74 CodeGenerator::LabelPrinter & CodeGenerator::LabelPrinter::operator()( std::list< Label > & l ) { 67 75 labels = &l; … … 101 109 } 102 110 103 CodeGenerator::CodeGenerator( std::ostream & os, bool pretty, bool genC, bool lineMarks ) : indent( CodeGenerator::tabsize), insideFunction( false ), output( os ), printLabels( *this ), pretty( pretty ), genC( genC ), lineMarks( lineMarks ) {}111 CodeGenerator::CodeGenerator( std::ostream & os, bool pretty, bool genC, bool lineMarks ) : indent( *this), cur_indent( 0 ), insideFunction( false ), output( os ), printLabels( *this ), pretty( pretty ), genC( genC ), lineMarks( lineMarks ) {} 104 112 105 113 string CodeGenerator::mangleName( DeclarationWithType * decl ) { … … 192 200 output << " {" << endl; 193 201 194 ++indent;202 cur_indent += CodeGenerator::tabsize; 195 203 for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end(); i++ ) { 196 204 output << lineDirective( *i ) << indent; … … 199 207 } // for 200 208 201 --indent;209 cur_indent -= CodeGenerator::tabsize; 202 210 203 211 output << indent << "}"; … … 229 237 output << " {" << endl; 230 238 231 ++indent;239 cur_indent += CodeGenerator::tabsize; 232 240 for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end(); i++) { 233 241 ObjectDecl * obj = dynamic_cast< ObjectDecl* >( *i ); … … 241 249 } // for 242 250 243 --indent;251 cur_indent -= CodeGenerator::tabsize; 244 252 245 253 output << indent << "}"; … … 753 761 std::list< Statement * > & stmts = stmtExpr->get_statements()->get_kids(); 754 762 output << lineDirective( stmtExpr) << "({" << std::endl; 755 ++indent;763 cur_indent += CodeGenerator::tabsize; 756 764 unsigned int numStmts = stmts.size(); 757 765 unsigned int i = 0; … … 776 784 ++i; 777 785 } 778 --indent;786 cur_indent -= CodeGenerator::tabsize; 779 787 output << indent << "})"; 780 788 } … … 785 793 output << "{" << endl; 786 794 787 ++indent;795 cur_indent += CodeGenerator::tabsize; 788 796 789 797 for ( std::list<Statement *>::iterator i = ks.begin(); i != ks.end(); i++ ) { … … 796 804 } // if 797 805 } // for 798 --indent;806 cur_indent -= CodeGenerator::tabsize; 799 807 800 808 output << indent << "}"; … … 864 872 865 873 output << "{" << std::endl; 866 ++indent;874 cur_indent += CodeGenerator::tabsize; 867 875 acceptAll( switchStmt->get_statements(), *this ); 868 --indent;876 cur_indent -= CodeGenerator::tabsize; 869 877 output << indent << "}"; 870 878 } … … 883 891 std::list<Statement *> sts = caseStmt->get_statements(); 884 892 885 ++indent;893 cur_indent += CodeGenerator::tabsize; 886 894 for ( std::list<Statement *>::iterator i = sts.begin(); i != sts.end(); i++) { 887 895 output << indent << printLabels( (*i)->get_labels() ) ; … … 889 897 output << endl; 890 898 } // for 891 --indent;899 cur_indent -= CodeGenerator::tabsize; 892 900 } 893 901 -
src/CodeGen/CodeGenerator.h
r70284830 r0a5b683 23 23 #include "SynTree/Visitor.h" // for Visitor 24 24 #include "SynTree/SynTree.h" // for Visitor Nodes 25 26 #include "Common/Indenter.h" // for Indenter27 25 28 26 namespace CodeGen { … … 102 100 template< class Iterator > void genCommaList( Iterator begin, Iterator end ); 103 101 102 struct Indenter { 103 Indenter(CodeGenerator &cg) : cg(cg) {} 104 CodeGenerator & cg; 105 std::ostream& operator()(std::ostream & os) const; 106 }; 107 104 108 struct LabelPrinter { 105 109 LabelPrinter(CodeGenerator &cg) : cg(cg), labels( 0 ) {} … … 124 128 private: 125 129 Indenter indent; 130 int cur_indent; 126 131 bool insideFunction; 127 132 std::ostream &output; -
src/Common/utility.h
r70284830 r0a5b683 24 24 #include <sstream> 25 25 #include <string> 26 #include <type_traits>27 26 28 27 #include <cassert> … … 305 304 // for ( val : group_iterate( container1, container2, ... ) ) {} 306 305 // syntax to have a for each that iterates multiple containers of the same length 307 // TODO: update to use variadic arguments 306 // TODO: update to use variadic arguments, perfect forwarding 308 307 309 308 template< typename T1, typename T2 > … … 314 313 315 314 struct iterator { 316 typedef typename std::remove_reference<T1>::type T1val; 317 typedef typename std::remove_reference<T2>::type T2val; 318 typedef std::tuple<typename T1val::value_type &, typename T2val::value_type &> value_type; 319 typedef typename T1val::iterator T1Iter; 320 typedef typename T2val::iterator T2Iter; 315 typedef std::tuple<typename T1::value_type, typename T2::value_type> value_type; 316 typedef typename T1::iterator T1Iter; 317 typedef typename T2::iterator T2Iter; 321 318 typedef std::tuple<T1Iter, T2Iter> IterTuple; 322 319 IterTuple it; … … 326 323 } 327 324 bool operator!=( const iterator &other ) const { return it != other.it; } 328 value_type operator*() const { return std:: tie( *std::get<0>(it), *std::get<1>(it) ); }325 value_type operator*() const { return std::make_tuple( *std::get<0>(it), *std::get<1>(it) ); } 329 326 }; 330 327 iterator begin() { return iterator( std::get<0>(args).begin(), std::get<1>(args).begin() ); } … … 336 333 337 334 template< typename... Args > 338 group_iterate_t<Args...> group_iterate( Args &&... args ) {339 return group_iterate_t<Args...>( std::forward<Args>( args )...);335 group_iterate_t<Args...> group_iterate( const Args &... args ) { 336 return group_iterate_t<Args...>(args...); 340 337 } 341 338 -
src/ControlStruct/MLEMutator.cc
r70284830 r0a5b683 154 154 return switchStmt; 155 155 } 156 157 void addUnused( Statement * stmt, const Label & originalTarget ) {158 // break/continue without a label doesn't need unused attribute159 if ( originalTarget == "" ) return;160 // add unused attribute to the originalTarget of a labelled break/continue161 for ( Label & l : stmt->get_labels() ) {162 // find the label to add unused attribute to163 if ( l == originalTarget ) {164 for ( Attribute * attr : l.get_attributes() ) {165 // ensure attribute isn't added twice166 if ( attr->get_name() == "unused" ) return;167 }168 l.get_attributes().push_back( new Attribute( "unused" ) );169 return;170 }171 }172 assertf( false, "Could not find label '%s' on statement %s", originalTarget.get_name().c_str(), toString( stmt ).c_str() );173 }174 175 156 176 157 Statement *MLEMutator::mutate( BranchStmt *branchStmt ) throw ( SemanticError ) { … … 223 204 } // switch 224 205 225 // add unused attribute to label to silence warnings226 addUnused( targetEntry->get_controlStructure(), branchStmt->get_originalTarget() );227 228 206 // transform break/continue statements into goto to simplify later handling of branches 229 207 delete branchStmt; -
src/Makefile.in
r70284830 r0a5b683 219 219 SymTab/driver_cfa_cpp-TypeEquality.$(OBJEXT) \ 220 220 SymTab/driver_cfa_cpp-Autogen.$(OBJEXT) \ 221 SymTab/driver_cfa_cpp-TreeStruct.$(OBJEXT) \ 221 222 SynTree/driver_cfa_cpp-Type.$(OBJEXT) \ 222 223 SynTree/driver_cfa_cpp-VoidType.$(OBJEXT) \ … … 517 518 SymTab/Indexer.cc SymTab/Mangler.cc SymTab/Validate.cc \ 518 519 SymTab/FixFunction.cc SymTab/ImplementationType.cc \ 519 SymTab/TypeEquality.cc SymTab/Autogen.cc Sy nTree/Type.cc \520 SynTree/ VoidType.cc SynTree/BasicType.cc \520 SymTab/TypeEquality.cc SymTab/Autogen.cc SymTab/TreeStruct.cc \ 521 SynTree/Type.cc SynTree/VoidType.cc SynTree/BasicType.cc \ 521 522 SynTree/PointerType.cc SynTree/ArrayType.cc \ 522 523 SynTree/FunctionType.cc SynTree/ReferenceToType.cc \ … … 851 852 SymTab/driver_cfa_cpp-Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \ 852 853 SymTab/$(DEPDIR)/$(am__dirstamp) 854 SymTab/driver_cfa_cpp-TreeStruct.$(OBJEXT): SymTab/$(am__dirstamp) \ 855 SymTab/$(DEPDIR)/$(am__dirstamp) 853 856 SynTree/$(am__dirstamp): 854 857 @$(MKDIR_P) SynTree … … 1045 1048 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Po@am__quote@ 1046 1049 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Po@am__quote@ 1050 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Po@am__quote@ 1047 1051 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-TypeEquality.Po@am__quote@ 1048 1052 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Po@am__quote@ … … 2097 2101 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2098 2102 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Autogen.obj `if test -f 'SymTab/Autogen.cc'; then $(CYGPATH_W) 'SymTab/Autogen.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Autogen.cc'; fi` 2103 2104 SymTab/driver_cfa_cpp-TreeStruct.o: SymTab/TreeStruct.cc 2105 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-TreeStruct.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo -c -o SymTab/driver_cfa_cpp-TreeStruct.o `test -f 'SymTab/TreeStruct.cc' || echo '$(srcdir)/'`SymTab/TreeStruct.cc 2106 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Po 2107 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/TreeStruct.cc' object='SymTab/driver_cfa_cpp-TreeStruct.o' libtool=no @AMDEPBACKSLASH@ 2108 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2109 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-TreeStruct.o `test -f 'SymTab/TreeStruct.cc' || echo '$(srcdir)/'`SymTab/TreeStruct.cc 2110 2111 SymTab/driver_cfa_cpp-TreeStruct.obj: SymTab/TreeStruct.cc 2112 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-TreeStruct.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo -c -o SymTab/driver_cfa_cpp-TreeStruct.obj `if test -f 'SymTab/TreeStruct.cc'; then $(CYGPATH_W) 'SymTab/TreeStruct.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/TreeStruct.cc'; fi` 2113 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Po 2114 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/TreeStruct.cc' object='SymTab/driver_cfa_cpp-TreeStruct.obj' libtool=no @AMDEPBACKSLASH@ 2115 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2116 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-TreeStruct.obj `if test -f 'SymTab/TreeStruct.cc'; then $(CYGPATH_W) 'SymTab/TreeStruct.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/TreeStruct.cc'; fi` 2099 2117 2100 2118 SynTree/driver_cfa_cpp-Type.o: SynTree/Type.cc -
src/Parser/DeclarationNode.cc
r70284830 r0a5b683 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Aug 10 17:02:00 201713 // Update Count : 102 112 // Last Modified On : Fri Jul 14 16:55:00 2017 13 // Update Count : 1020 14 14 // 15 15 … … 275 275 return newnode; 276 276 } // DeclarationNode::newEnumConstant 277 278 DeclarationNode * DeclarationNode::newTreeStruct( Aggregate kind, const string * name, const string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body ) { 279 assert( name ); 280 DeclarationNode * newnode = new DeclarationNode; 281 newnode->type = new TypeData( TypeData::Aggregate ); 282 newnode->type->aggregate.kind = kind; 283 newnode->type->aggregate.name = name; 284 newnode->type->aggregate.actuals = actuals; 285 newnode->type->aggregate.fields = fields; 286 newnode->type->aggregate.body = body; 287 newnode->type->aggregate.tagged = true; 288 newnode->type->aggregate.parent = parent; 289 return newnode; 290 } // DeclarationNode::newTreeStruct 277 291 278 292 DeclarationNode * DeclarationNode::newName( string * name ) { -
src/Parser/ParseNode.h
r70284830 r0a5b683 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:28:16 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thu Aug 10 16:54:00201713 // Update Count : 78 911 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 27 12:08:08 2017 13 // Update Count : 788 14 14 // 15 15 … … 248 248 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 249 249 250 // Perhaps this would best fold into newAggragate. 251 static DeclarationNode * newTreeStruct( Aggregate kind, const std::string * name, const std::string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body ); 252 250 253 DeclarationNode(); 251 254 ~DeclarationNode(); … … 332 335 333 336 static UniqueName anonymous; 337 338 // Temp to test TreeStruct 339 const std::string * parent_name; 334 340 }; // DeclarationNode 335 341 -
src/Parser/TypeData.cc
r70284830 r0a5b683 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Aug 11 10:50:00 201712 // Last Modified On : Wed Aug 9 13:50:00 2017 13 13 // Update Count : 567 14 14 // … … 63 63 aggregate.fields = nullptr; 64 64 aggregate.body = false; 65 aggregate.tagged = false; 66 aggregate.parent = nullptr; 65 67 break; 66 68 case AggregateInst: … … 121 123 delete aggregate.actuals; 122 124 delete aggregate.fields; 125 delete aggregate.parent; 123 126 // delete aggregate; 124 127 break; … … 621 624 switch ( td->aggregate.kind ) { 622 625 case DeclarationNode::Struct: 626 if ( td->aggregate.tagged ) { 627 at = new StructDecl( *td->aggregate.name, td->aggregate.parent, attributes, linkage ); 628 buildForall( td->aggregate.params, at->get_parameters() ); 629 break; 630 } 623 631 case DeclarationNode::Coroutine: 624 632 case DeclarationNode::Monitor: -
src/ResolvExpr/CurrentObject.cc
r70284830 r0a5b683 19 19 #include "CurrentObject.h" 20 20 21 #include "Common/Indenter.h"22 23 21 #include "SynTree/Declaration.h" 24 22 #include "SynTree/Initializer.h" … … 47 45 assertf( false, "unhandled type on getConstValue %s", toString( constExpr->get_result() ).c_str() ); // xxx - might be semantic error 48 46 } 47 } 48 49 struct Indenter { 50 static const int amt = 2; 51 unsigned int indent = 0; 52 53 Indenter & operator+=(int nlevels) { indent += amt*nlevels; return *this; } 54 Indenter & operator-=(int nlevels) { indent -= amt*nlevels; return *this; } 55 Indenter operator+(int nlevels) { Indenter indenter = *this; return indenter += nlevels; } 56 Indenter operator-(int nlevels) { Indenter indenter = *this; return indenter -= nlevels; } 57 Indenter & operator++() { return *this += 1; } 58 Indenter & operator--() { return *this -= 1; } 59 }; 60 std::ostream & operator<<( std::ostream & out, Indenter & indent ) { 61 return out << std::string(indent.indent, ' '); 49 62 } 50 63 -
src/ResolvExpr/CurrentObject.h
r70284830 r0a5b683 24 24 class MemberIterator; 25 25 26 // TODO: memory management of MemberIterators27 26 class CurrentObject { 28 27 public: -
src/SymTab/module.mk
r70284830 r0a5b683 11 11 ## Created On : Mon Jun 1 17:49:17 2015 12 12 ## Last Modified By : Andrew Beach 13 ## Last Modified On : Thr Aug 10 16:08:00 201714 ## Update Count : 413 ## Last Modified On : Wed Jul 12 13:06:00 2017 14 ## Update Count : 3 15 15 ############################################################################### 16 16 … … 21 21 SymTab/ImplementationType.cc \ 22 22 SymTab/TypeEquality.cc \ 23 SymTab/Autogen.cc 23 SymTab/Autogen.cc \ 24 SymTab/TreeStruct.cc -
src/SynTree/Declaration.h
r70284830 r0a5b683 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Aug 11 10:20:00 201713 // Update Count : 12 712 // Last Modified On : Wed Aug 9 14:45:00 2017 13 // Update Count : 126 14 14 // 15 15 … … 269 269 typedef AggregateDecl Parent; 270 270 public: 271 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {} 272 StructDecl( const StructDecl &other ) : Parent( other ), kind( other.kind ) {} 271 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ), tagged( false ), parent_name( "" ) {} 272 StructDecl( const std::string &name, const std::string *parent, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( DeclarationNode::Struct ), tagged( true ), parent_name( parent ? *parent : "" ) {} 273 StructDecl( const StructDecl &other ) : Parent( other ) {} 273 274 274 275 bool is_coroutine() { return kind == DeclarationNode::Coroutine; } … … 276 277 bool is_thread() { return kind == DeclarationNode::Thread; } 277 278 279 // Tagged/Tree Structure Excetion 280 bool get_tagged() { return tagged; } 281 void set_tagged( bool newValue ) { tagged = newValue; } 282 bool has_parent() { return parent_name != ""; } 283 std::string get_parentName() { return parent_name; } 284 278 285 virtual StructDecl *clone() const { return new StructDecl( *this ); } 279 286 virtual void accept( Visitor &v ) { v.visit( this ); } … … 282 289 DeclarationNode::Aggregate kind; 283 290 virtual std::string typeString() const; 291 292 bool tagged; 293 std::string parent_name; 284 294 }; 285 295 -
src/tests/pybin/tools.py
r70284830 r0a5b683 85 85 "--unchanged-group-format='%%=' \\" 86 86 "--changed-group-format='\t\texpected :\n" 87 "%%< "87 "%%<\n" 88 88 "\t\tgot :\n" 89 "%%> \n' \\\n"89 "%%>' \\\n" 90 90 "--new-line-format='\t\t%%dn\t%%L' \\\n" 91 91 "--old-line-format='\t\t%%dn\t%%L' \\\n" … … 94 94 95 95 # fetch return code and error from the diff command 96 return sh(diff_cmd % (lhs, rhs), dry_run, False) 96 return sh(diff_cmd % (lhs, rhs), dry_run, False)
Note:
See TracChangeset
for help on using the changeset viewer.