mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
TBAA: fix PR17620.
We can have a struct type with a single field and the field does not start with 0. In that case, we should correctly update the offset. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193137 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -231,8 +231,12 @@ namespace {
|
||||
if (Node->getNumOperands() < 2)
|
||||
return TBAAStructTypeNode();
|
||||
|
||||
// Special handling for a scalar type node.
|
||||
// Fast path for a scalar type node and a struct type node with a single
|
||||
// field.
|
||||
if (Node->getNumOperands() <= 3) {
|
||||
uint64_t Cur = Node->getNumOperands() == 2 ? 0 :
|
||||
cast<ConstantInt>(Node->getOperand(2))->getZExtValue();
|
||||
Offset -= Cur;
|
||||
MDNode *P = dyn_cast_or_null<MDNode>(Node->getOperand(1));
|
||||
if (!P)
|
||||
return TBAAStructTypeNode();
|
||||
|
Reference in New Issue
Block a user