summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d3e97c6)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256101
91177308-0d34-0410-b5e6-
96231b3b80d8
// In this case, we can not find the bitcast any more. So we insert a new bitcast
// no matter there is already one or not. In this way, we can handle all cases, and
// the extra bitcast should be optimized away in later passes.
// In this case, we can not find the bitcast any more. So we insert a new bitcast
// no matter there is already one or not. In this way, we can handle all cases, and
// the extra bitcast should be optimized away in later passes.
- Instruction *ActualRelocatedBase = RelocatedBase;
+ Value *ActualRelocatedBase = RelocatedBase;
if (RelocatedBase->getType() != Base->getType()) {
ActualRelocatedBase =
if (RelocatedBase->getType() != Base->getType()) {
ActualRelocatedBase =
- cast<Instruction>(Builder.CreateBitCast(RelocatedBase, Base->getType()));
+ Builder.CreateBitCast(RelocatedBase, Base->getType());
}
Value *Replacement = Builder.CreateGEP(
Derived->getSourceElementType(), ActualRelocatedBase, makeArrayRef(OffsetV));
}
Value *Replacement = Builder.CreateGEP(
Derived->getSourceElementType(), ActualRelocatedBase, makeArrayRef(OffsetV));
- Instruction *ReplacementInst = cast<Instruction>(Replacement);
Replacement->takeName(ToReplace);
// If the newly generated derived pointer's type does not match the original derived
// pointer's type, cast the new derived pointer to match it. Same reasoning as above.
Replacement->takeName(ToReplace);
// If the newly generated derived pointer's type does not match the original derived
// pointer's type, cast the new derived pointer to match it. Same reasoning as above.
- Instruction *ActualReplacement = ReplacementInst;
- if (ReplacementInst->getType() != ToReplace->getType()) {
+ Value *ActualReplacement = Replacement;
+ if (Replacement->getType() != ToReplace->getType()) {
- cast<Instruction>(Builder.CreateBitCast(ReplacementInst, ToReplace->getType()));
+ Builder.CreateBitCast(Replacement, ToReplace->getType());
}
ToReplace->replaceAllUsesWith(ActualReplacement);
ToReplace->eraseFromParent();
}
ToReplace->replaceAllUsesWith(ActualReplacement);
ToReplace->eraseFromParent();