1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

[Lint] Use LocationSize instead of ints; NFC

Keeping these patches super small so they're easily post-commit
verifiable, as requested in D44748.

llvm-svn: 350015
This commit is contained in:
George Burgess IV 2018-12-23 02:50:08 +00:00
parent 584e0434bb
commit 304a7e4519

View File

@ -330,12 +330,12 @@ void Lint::visitCallSite(CallSite CS) {
// Check that the memcpy arguments don't overlap. The AliasAnalysis API
// isn't expressive enough for what we really want to do. Known partial
// overlap is not distinguished from the case where nothing is known.
uint64_t Size = 0;
auto Size = LocationSize::unknown();
if (const ConstantInt *Len =
dyn_cast<ConstantInt>(findValue(MCI->getLength(),
/*OffsetOk=*/false)))
if (Len->getValue().isIntN(32))
Size = Len->getValue().getZExtValue();
Size = LocationSize::precise(Len->getValue().getZExtValue());
Assert(AA->alias(MCI->getSource(), Size, MCI->getDest(), Size) !=
MustAlias,
"Undefined behavior: memcpy source and destination overlap", &I);