diff options
Diffstat (limited to 'include/llvm/Transforms')
| -rw-r--r-- | include/llvm/Transforms/Utils/BypassSlowDivision.h | 11 | 
1 files changed, 7 insertions, 4 deletions
| diff --git a/include/llvm/Transforms/Utils/BypassSlowDivision.h b/include/llvm/Transforms/Utils/BypassSlowDivision.h index 471055921fa8..994b6ec9c229 100644 --- a/include/llvm/Transforms/Utils/BypassSlowDivision.h +++ b/include/llvm/Transforms/Utils/BypassSlowDivision.h @@ -19,6 +19,7 @@  #include "llvm/ADT/DenseMap.h"  #include "llvm/ADT/DenseMapInfo.h" +#include "llvm/IR/ValueHandle.h"  #include <cstdint>  namespace llvm { @@ -28,8 +29,8 @@ class Value;  struct DivRemMapKey {    bool SignedOp; -  Value *Dividend; -  Value *Divisor; +  AssertingVH<Value> Dividend; +  AssertingVH<Value> Divisor;    DivRemMapKey(bool InSignedOp, Value *InDividend, Value *InDivisor)        : SignedOp(InSignedOp), Dividend(InDividend), Divisor(InDivisor) {} @@ -50,8 +51,10 @@ template <> struct DenseMapInfo<DivRemMapKey> {    }    static unsigned getHashValue(const DivRemMapKey &Val) { -    return (unsigned)(reinterpret_cast<uintptr_t>(Val.Dividend) ^ -                      reinterpret_cast<uintptr_t>(Val.Divisor)) ^ +    return (unsigned)(reinterpret_cast<uintptr_t>( +                          static_cast<Value *>(Val.Dividend)) ^ +                      reinterpret_cast<uintptr_t>( +                          static_cast<Value *>(Val.Divisor))) ^             (unsigned)Val.SignedOp;    }  }; | 
