]> granicus.if.org Git - llvm/commitdiff
Fix compilation warnings. NFC.
authorMichael Liao <michael.hliao@gmail.com>
Fri, 11 Oct 2019 14:09:44 +0000 (14:09 +0000)
committerMichael Liao <michael.hliao@gmail.com>
Fri, 11 Oct 2019 14:09:44 +0000 (14:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374554 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/Metadata.cpp
lib/Transforms/IPO/GlobalDCE.cpp

index d426d8e2fa9cae6fdd818798c32f758fc1e8eaa3..62c2aa86f3b037e3c94e61186226ef8e13e13222 100644 (file)
@@ -1509,7 +1509,7 @@ GlobalObject::VCallVisibility GlobalObject::getVCallVisibility() const {
     uint64_t Val = cast<ConstantInt>(
                        cast<ConstantAsMetadata>(MD->getOperand(0))->getValue())
                        ->getZExtValue();
-    assert((Val >= 0 && Val <= 2) && "unknown vcall visibility!");
+    assert(Val <= 2 && "unknown vcall visibility!");
     return (VCallVisibility)Val;
   }
   return VCallVisibility::VCallVisibilityPublic;
index 0b14229ac6201e02e3ec89a63bde3419bea945e1..466d18896ed62affcd61d9dfc4931e6cb9740f99 100644 (file)
@@ -189,7 +189,7 @@ void GlobalDCEPass::ScanVTables(Module &M) {
     // unit, we know that we can see all virtual functions which might use it,
     // so VFE is safe.
     if (auto GO = dyn_cast<GlobalObject>(&GV)) {
-      GlobalObject::VCallVisibility TypeVis = GV.getVCallVisibility();
+      GlobalObject::VCallVisibility TypeVis = GO->getVCallVisibility();
       if (TypeVis == GlobalObject::VCallVisibilityTranslationUnit ||
           (LTOPostLink &&
            TypeVis == GlobalObject::VCallVisibilityLinkageUnit)) {