forked from OSchip/llvm-project
parent
391f69b0ff
commit
727c03a665
|
@ -143,13 +143,13 @@ bool ExpressionConvertibleToType(Value *V, const Type *Ty,
|
||||||
ValueTypeCache::iterator CTMI = CTMap.find(V);
|
ValueTypeCache::iterator CTMI = CTMap.find(V);
|
||||||
if (CTMI != CTMap.end()) return CTMI->second == Ty;
|
if (CTMI != CTMap.end()) return CTMI->second == Ty;
|
||||||
|
|
||||||
// If it's a constant... all constants can be converted to a different type. We
|
// If it's a constant... all constants can be converted to a different
|
||||||
// just ask the constant propagator to see if it can convert the value...
|
// type. We just ask the constant propagator to see if it can convert the
|
||||||
|
// value...
|
||||||
//
|
//
|
||||||
if (Constant *CPV = dyn_cast<Constant>(V))
|
if (Constant *CPV = dyn_cast<Constant>(V))
|
||||||
return ConstantFoldCastInstruction(CPV, Ty);
|
return ConstantFoldCastInstruction(CPV, Ty);
|
||||||
|
|
||||||
|
|
||||||
CTMap[V] = Ty;
|
CTMap[V] = Ty;
|
||||||
if (V->getType() == Ty) return true; // Expression already correct type!
|
if (V->getType() == Ty) return true; // Expression already correct type!
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue