mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-24 08:18:33 +00:00
Add simplify_type<const WeakVH>; simplify IndVarSimplify
r240214 fixed some UB in IndVarSimplify, and it needed a temporary `WeakVH` to do it. Add `simplify_type<const WeakVH>` so that this temporary isn't necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240599 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -159,11 +159,13 @@ public:
|
||||
|
||||
// Specialize simplify_type to allow WeakVH to participate in
|
||||
// dyn_cast, isa, etc.
|
||||
template<> struct simplify_type<WeakVH> {
|
||||
typedef Value* SimpleType;
|
||||
static SimpleType getSimplifiedValue(WeakVH &WVH) {
|
||||
return WVH;
|
||||
}
|
||||
template <> struct simplify_type<WeakVH> {
|
||||
typedef Value *SimpleType;
|
||||
static SimpleType getSimplifiedValue(WeakVH &WVH) { return WVH; }
|
||||
};
|
||||
template <> struct simplify_type<const WeakVH> {
|
||||
typedef Value *SimpleType;
|
||||
static SimpleType getSimplifiedValue(const WeakVH &WVH) { return WVH; }
|
||||
};
|
||||
|
||||
/// \brief Value handle that asserts if the Value is deleted.
|
||||
|
||||
Reference in New Issue
Block a user