[lld] r233219 - Use llvm::isPowerOf2. NFC.

Rui Ueyama ruiu at google.com
Wed Mar 25 14:21:57 PDT 2015


Author: ruiu
Date: Wed Mar 25 16:21:57 2015
New Revision: 233219

URL: http://llvm.org/viewvc/llvm-project?rev=233219&view=rev
Log:
Use llvm::isPowerOf2. NFC.

Modified:
    lld/trunk/lib/Driver/DarwinLdDriver.cpp

Modified: lld/trunk/lib/Driver/DarwinLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/DarwinLdDriver.cpp?rev=233219&r1=233218&r2=233219&view=diff
==============================================================================
--- lld/trunk/lib/Driver/DarwinLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/DarwinLdDriver.cpp Wed Mar 25 16:21:57 2015
@@ -480,7 +480,7 @@ bool DarwinLdDriver::parse(int argc, con
       return false;
     }
     uint8_t align2 = llvm::countTrailingZeros(alignValue);
-    if ( (unsigned long)(1 << align2) != alignValue ) {
+    if (!llvm::isPowerOf2_64(alignValue)) {
       diagnostics << "warning: alignment for '-sectalign "
                   << segName << " " << sectName
                   << llvm::format(" 0x%llX", alignValue)





More information about the llvm-commits mailing list