- Timestamp:
- May 22, 2019, 1:00:28 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 3f840e3
- Parents:
- ca8704f
- Location:
- src/AST
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Bitfield.hpp
rca8704f r461046f 57 57 }; 58 58 59 /// Adds default printing operator to a bitfield type. 60 /// Include in definition to add print function, requires other bitfield operators. 61 /// @param N Number of bits in bitfield 62 #define MakeBitfieldPrint( N ) \ 63 static const char* Names[]; \ 64 \ 65 void print( std::ostream & os ) const { \ 66 if ( (*this).any() ) { \ 67 for ( unsigned int i = 0; i < N; i += 1 ) { \ 68 if ( (*this)[i] ) { \ 69 os << Names[i] << ' '; \ 70 } \ 71 } \ 72 } \ 73 } 59 template<typename T> 60 inline bool operator== ( const bitfield<T> & a, const bitfield<T> & b ) { 61 return a.val == b.val; 62 } 63 64 template<typename T> 65 inline bool operator!= ( const bitfield<T> & a, const bitfield<T> & b ) { 66 return !(a == b); 67 } 74 68 75 69 // Local Variables: // -
src/AST/Node.cpp
rca8704f r461046f 26 26 #include "Type.hpp" 27 27 #include "TypeSubstitution.hpp" 28 29 #include "Print.hpp" 28 30 29 31 template< typename node_t, enum ast::Node::ref_type ref_t > … … 47 49 48 50 std::ostream & ast::operator<< ( std::ostream & out, const ast::Node * node ) { 49 (void)node; 50 #warning unimplemented 51 assertf(false, "Unimplemented"); 51 print(out, node); 52 52 return out; 53 53 } -
src/AST/module.mk
rca8704f r461046f 24 24 AST/LinkageSpec.cpp \ 25 25 AST/Node.cpp \ 26 AST/Print.cpp \ 26 27 AST/Stmt.cpp \ 27 28 AST/Type.cpp \
Note: See TracChangeset
for help on using the changeset viewer.