Changes in src/AST/Pass.proto.hpp [0b8bf27:dff6452]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.proto.hpp
r0b8bf27 rdff6452 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 }137 117 }; 138 118 … … 158 138 "Previsit may not change the type of the node. It must return its paremeter or void." 159 139 ); 160 161 __assign<162 std::is_void<163 decltype( pass.previsit( node ) )164 >::value165 >::result( pass, node );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 } 166 146 } 167 147
Note:
See TracChangeset
for help on using the changeset viewer.