forked from OSchip/llvm-project
[DebugInfo] Only perform TypeSize -> unsigned cast when necessary
This commit moves a line in SelectionDAGBuilder::handleDebugValue to avoid implicitly casting a TypeSize object to an unsigned earlier than necessary. It was possible that we bail out of the loop before the value is ever used, which means we could create a superfluous TypeSize warning. Reviewed By: DavidTruby Differential Revision: https://reviews.llvm.org/D96423
This commit is contained in:
parent
0881a4f1bf
commit
67464dfe36
|
@ -1321,10 +1321,11 @@ bool SelectionDAGBuilder::handleDebugValue(const Value *V, DILocalVariable *Var,
|
|||
if (auto Fragment = Expr->getFragmentInfo())
|
||||
BitsToDescribe = Fragment->SizeInBits;
|
||||
for (auto RegAndSize : RFV.getRegsAndSizes()) {
|
||||
unsigned RegisterSize = RegAndSize.second;
|
||||
// Bail out if all bits are described already.
|
||||
if (Offset >= BitsToDescribe)
|
||||
break;
|
||||
// TODO: handle scalable vectors.
|
||||
unsigned RegisterSize = RegAndSize.second;
|
||||
unsigned FragmentSize = (Offset + RegisterSize > BitsToDescribe)
|
||||
? BitsToDescribe - Offset
|
||||
: RegisterSize;
|
||||
|
|
Loading…
Reference in New Issue