Changes in src/AST/Pass.proto.hpp [dff6452:0b8bf27]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.proto.hpp
rdff6452 r0b8bf27 115 115 static constexpr bool value = std::is_void< ret_t >::value || 116 116 std::is_base_of<const node_t, typename std::remove_pointer<ret_t>::type >::value; 117 }; 118 119 template<bool is_void> 120 struct __assign; 121 122 template<> 123 struct __assign<true> { 124 template<typename pass_t, typename node_t> 125 static inline void result( pass_t & pass, const node_t * & node ) { 126 pass.previsit( node ); 127 } 128 }; 129 130 template<> 131 struct __assign<false> { 132 template<typename pass_t, typename node_t> 133 static inline void result( pass_t & pass, const node_t * & node ) { 134 node = pass.previsit( node ); 135 assertf(node, "Previsit must not return NULL"); 136 } 117 137 }; 118 138 … … 138 158 "Previsit may not change the type of the node. It must return its paremeter or void." 139 159 ); 140 if(std::is_void< decltype( pass.previsit(node) ) >::value) { 141 pass.previsit( node );142 } else {143 node = pass.previsit( node );144 assert(node);145 }160 161 __assign< 162 std::is_void< 163 decltype( pass.previsit( node ) ) 164 >::value 165 >::result( pass, node ); 146 166 } 147 167
Note:
See TracChangeset
for help on using the changeset viewer.