[llvm] r350015 - [Lint] Use LocationSize instead of ints; NFC

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 22 18:50:08 PST 2018


Author: gbiv
Date: Sat Dec 22 18:50:08 2018
New Revision: 350015

URL: http://llvm.org/viewvc/llvm-project?rev=350015&view=rev
Log:
[Lint] Use LocationSize instead of ints; NFC

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


Modified:
    llvm/trunk/lib/Analysis/Lint.cpp

Modified: llvm/trunk/lib/Analysis/Lint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=350015&r1=350014&r2=350015&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/Lint.cpp (original)
+++ llvm/trunk/lib/Analysis/Lint.cpp Sat Dec 22 18:50:08 2018
@@ -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);




More information about the llvm-commits mailing list