]> granicus.if.org Git - llvm/commitdiff
[Lint] Use LocationSize instead of ints; NFC
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Sun, 23 Dec 2018 02:50:08 +0000 (02:50 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Sun, 23 Dec 2018 02:50:08 +0000 (02:50 +0000)
Keeping these patches super small so they're easily post-commit
verifiable, as requested in D44748.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350015 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/Lint.cpp

index db919bd233bf89e547c9c05721027ec143c9dc64..5d0a627f842629ef0feb16f4875d91fbb1b9fb8c 100644 (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);