OSDN Git Service

Various MSVC warning fixes about truncated 64 bit shifts and const pointers passed...
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 8 Apr 2010 15:25:57 +0000 (15:25 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 8 Apr 2010 15:25:57 +0000 (15:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100767 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MachObjectWriter.cpp
lib/Support/regengine.inc
utils/TableGen/ARMDecoderEmitter.cpp

index fc35c36..a533ccf 100644 (file)
@@ -477,7 +477,7 @@ public:
       // actual expression addend without the PCrel bias. However, instructions
       // with data following the relocation are not accomodated for (see comment
       // below regarding SIGNED{1,2,4}), so it isn't exactly that either.
-      Value += 1 << Log2Size;
+      Value += 1LL << Log2Size;
     }
 
     if (Target.isAbsolute()) { // constant
@@ -605,7 +605,7 @@ public:
         // well based on the actual encoded instruction (the additional bias),
         // but instead appear to just look at the final offset.
         if (IsRIPRel) {
-          switch (-(Target.getConstant() + (1 << Log2Size))) {
+          switch (-(Target.getConstant() + (1LL << Log2Size))) {
           case 1: Type = RIT_X86_64_Signed1; break;
           case 2: Type = RIT_X86_64_Signed2; break;
           case 4: Type = RIT_X86_64_Signed4; break;
index bf55543..7e41f96 100644 (file)
@@ -185,7 +185,7 @@ matcher(struct re_guts *g, const char *string, size_t nmatch,
                endp = fast(m, start, stop, gf, gl);
                if (endp == NULL) {             /* a miss */
                        free(m->pmatch);
-                       free(m->lastpos);
+                       free((void*)m->lastpos);
                        STATETEARDOWN(m);
                        return(REG_NOMATCH);
                }
index b9dcd43..29e9b8a 100644 (file)
@@ -635,7 +635,7 @@ void Filter::recurse() {
 
     // Marks all the segment positions with either BIT_TRUE or BIT_FALSE.
     for (bitIndex = 0; bitIndex < NumBits; bitIndex++) {
-      if (mapIterator->first & (1 << bitIndex))
+      if (mapIterator->first & (1ULL << bitIndex))
         BitValueArray[StartBit + bitIndex] = BIT_TRUE;
       else
         BitValueArray[StartBit + bitIndex] = BIT_FALSE;
@@ -857,7 +857,7 @@ bool FilterChooser::fieldFromInsn(uint64_t &Field, insn_t &Insn,
       return false;
 
     if (Insn[StartBit + i] == BIT_TRUE)
-      Field = Field | (1 << i);
+      Field = Field | (1ULL << i);
   }
 
   return true;