[llvm-commits] [llvm] r137975 - /llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
Akira Hatanaka
ahatanak at gmail.com
Thu Aug 18 13:07:42 PDT 2011
Author: ahatanak
Date: Thu Aug 18 15:07:42 2011
New Revision: 137975
URL: http://llvm.org/viewvc/llvm-project?rev=137975&view=rev
Log:
Make IsShiftedMask a static function rather than defining it in an
anonymous namespace.
Modified:
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=137975&r1=137974&r2=137975&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Thu Aug 18 15:07:42 2011
@@ -35,22 +35,20 @@
#include "llvm/Support/ErrorHandling.h"
using namespace llvm;
-namespace {
- // If I is a shifted mask, set the size (Size) and the first bit of the
- // mask (Pos), and return true.
- bool IsShiftedMask(uint64_t I, unsigned SizeInBits, uint64_t &Pos,
- uint64_t &Size) {
- assert(SizeInBits == 32 || SizeInBits == 64);
- bool Is32Bits = (SizeInBits == 32);
-
- if ((Is32Bits == 32 && !isShiftedMask_32(I)) ||
- (!Is32Bits && !isShiftedMask_64(I)))
- return false;
+// If I is a shifted mask, set the size (Size) and the first bit of the
+// mask (Pos), and return true.
+static bool IsShiftedMask(uint64_t I, unsigned SizeInBits, uint64_t &Pos,
+ uint64_t &Size) {
+ assert(SizeInBits == 32 || SizeInBits == 64);
+ bool Is32Bits = (SizeInBits == 32);
- Size = Is32Bits ? CountPopulation_32(I) : CountPopulation_64(I);
- Pos = Is32Bits ? CountTrailingZeros_32(I) : CountTrailingZeros_64(I);
- return true;
- }
+ if ((Is32Bits == 32 && !isShiftedMask_32(I)) ||
+ (!Is32Bits && !isShiftedMask_64(I)))
+ return false;
+
+ Size = Is32Bits ? CountPopulation_32(I) : CountPopulation_64(I);
+ Pos = Is32Bits ? CountTrailingZeros_32(I) : CountTrailingZeros_64(I);
+ return true;
}
const char *MipsTargetLowering::getTargetNodeName(unsigned Opcode) const {
More information about the llvm-commits
mailing list