- Timestamp:
- Jan 31, 2024, 6:40:25 PM (12 months ago)
- Branches:
- master
- Children:
- 496ffc17
- Parents:
- c75b30a (diff), e71b09a (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. - Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/utility.h
rc75b30a r32490deb 111 111 }; 112 112 113 // -----------------------------------------------------------------------------114 // O(1) polymorphic integer ilog2, using clz, which returns the number of leading 0-bits, starting at the most115 // significant bit (single instruction on x86)116 117 template<typename T>118 inline119 #if defined(__GNUC__) && __GNUC__ > 4120 constexpr121 #endif122 T ilog2(const T & t) {123 if(std::is_integral<T>::value) {124 const constexpr int r = sizeof(t) * __CHAR_BIT__ - 1;125 if( sizeof(T) == sizeof(unsigned int) ) return r - __builtin_clz ( t );126 if( sizeof(T) == sizeof(unsigned long) ) return r - __builtin_clzl ( t );127 if( sizeof(T) == sizeof(unsigned long long) ) return r - __builtin_clzll( t );128 }129 assert(false);130 return -1;131 } // ilog2132 133 113 // Local Variables: // 134 114 // tab-width: 4 // -
src/ResolvExpr/Resolver.cc
rc75b30a r32490deb 50 50 51 51 namespace ResolvExpr { 52 template< typename iterator_t >53 inline bool advance_to_mutex( iterator_t & it, const iterator_t & end ) {54 while( it != end && !(*it)->get_type()->get_mutex() ) {55 it++;56 }57 58 return it != end;59 }60 61 52 namespace { 62 53 /// Finds deleted expressions in an expression tree
Note: See TracChangeset
for help on using the changeset viewer.