Changeset f14d956
- Timestamp:
- Apr 20, 2018, 10:56:45 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 58caf150
- Parents:
- 88f15ae
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/utility.h
r88f15ae rf14d956 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Apr 19 16:21:44201813 // Update Count : 3 712 // Last Modified On : Fri Apr 20 22:35:33 2018 13 // Update Count : 38 14 14 // 15 15 … … 437 437 438 438 // ----------------------------------------------------------------------------- 439 // O(1) polymorphic integer log2, using clz, which returns the number of leading 0-bits, starting at the most439 // O(1) polymorphic integer ilog2, using clz, which returns the number of leading 0-bits, starting at the most 440 440 // significant bit (single instruction on x86) 441 441 442 442 template<typename T> 443 inline constexpr T log2(const T & t) {443 inline constexpr T ilog2(const T & t) { 444 444 if ( std::is_integral<T>::value ) { 445 445 const constexpr int r = sizeof(t) * __CHAR_BIT__ - 1; … … 449 449 } // if 450 450 return -1; 451 } 451 } // ilong2 452 452 453 453 -
src/Parser/DeclarationNode.cc
r88f15ae rf14d956 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Apr 19 15:09:29201813 // Update Count : 106 212 // Last Modified On : Fri Apr 20 22:37:20 2018 13 // Update Count : 1063 14 14 // 15 15 … … 562 562 checkQualifiers( type, q->type ); 563 563 if ( (builtin == Zero || builtin == One) && error.length() == 0 ) { 564 SemanticWarning( yylloc, Warning::BadQualifiersZeroOne, Type::QualifiersNames[ log2( q->type->qualifiers.val )], builtinTypeNames[builtin] );564 SemanticWarning( yylloc, Warning::BadQualifiersZeroOne, Type::QualifiersNames[ilog2( q->type->qualifiers.val )], builtinTypeNames[builtin] ); 565 565 // appendError( error, string( "questionable qualifiers" ) ); 566 566 } // if
Note: See TracChangeset
for help on using the changeset viewer.