mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[Debugify] Handle failure to get fragment size when checking dbg.values
It's not possible to get the fragment size of some dbg.values. Teach the mis-sized dbg.value diagnostic to detect this scenario and bail out. Tested with: $ find test/Transforms -print -exec opt -debugify-each -instcombine {} \; llvm-svn: 335695
This commit is contained in:
parent
be4feb18ce
commit
8c93d49cb8
@ -1,4 +1,5 @@
|
||||
; RUN: opt < %s -ipsccp -S | FileCheck %s
|
||||
; RUN: opt < %s -enable-debugify -ipsccp -debugify-quiet -disable-output
|
||||
|
||||
;;======================== test1
|
||||
|
||||
|
@ -184,12 +184,15 @@ bool diagnoseMisSizedDbgValue(Module &M, DbgValueInst *DVI) {
|
||||
|
||||
Type *Ty = V->getType();
|
||||
uint64_t ValueOperandSize = getAllocSizeInBits(M, Ty);
|
||||
uint64_t DbgVarSize = *DVI->getFragmentSizeInBits();
|
||||
bool HasBadSize = Ty->isIntegerTy() ? (ValueOperandSize < DbgVarSize)
|
||||
: (ValueOperandSize != DbgVarSize);
|
||||
Optional<uint64_t> DbgVarSize = DVI->getFragmentSizeInBits();
|
||||
if (!ValueOperandSize || !DbgVarSize)
|
||||
return false;
|
||||
|
||||
bool HasBadSize = Ty->isIntegerTy() ? (ValueOperandSize < *DbgVarSize)
|
||||
: (ValueOperandSize != *DbgVarSize);
|
||||
if (HasBadSize) {
|
||||
dbg() << "ERROR: dbg.value operand has size " << ValueOperandSize
|
||||
<< ", but its variable has size " << DbgVarSize << ": ";
|
||||
<< ", but its variable has size " << *DbgVarSize << ": ";
|
||||
DVI->print(dbg());
|
||||
dbg() << "\n";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user