Ignore:
Timestamp:
Apr 23, 2018, 10:08:51 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
de6319f
Parents:
e6d39fe (diff), c8ad5d9 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    re6d39fe r22bdc34  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Apr 19 16:21:44 2018
    13 // Update Count     : 37
     12// Last Modified On : Fri Apr 20 22:35:33 2018
     13// Update Count     : 38
    1414//
    1515
     
    437437
    438438// -----------------------------------------------------------------------------
    439 // O(1) polymorphic integer log2, using clz, which returns the number of leading 0-bits, starting at the most
     439// O(1) polymorphic integer ilog2, using clz, which returns the number of leading 0-bits, starting at the most
    440440// significant bit (single instruction on x86)
    441441
    442442template<typename T>
    443 inline constexpr T log2(const T & t) {
     443inline constexpr T ilog2(const T & t) {
    444444        if ( std::is_integral<T>::value ) {
    445445                const constexpr int r = sizeof(t) * __CHAR_BIT__ - 1;
     
    449449        } // if
    450450        return -1;
    451 }
     451} // ilong2
    452452
    453453
Note: See TracChangeset for help on using the changeset viewer.