From: Michael Liao Date: Fri, 11 Oct 2019 14:09:44 +0000 (+0000) Subject: Fix compilation warnings. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0b9840743915a974e6daf5a6d332d4f3599b470;p=llvm Fix compilation warnings. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374554 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Metadata.cpp b/lib/IR/Metadata.cpp index d426d8e2fa9..62c2aa86f3b 100644 --- a/lib/IR/Metadata.cpp +++ b/lib/IR/Metadata.cpp @@ -1509,7 +1509,7 @@ GlobalObject::VCallVisibility GlobalObject::getVCallVisibility() const { uint64_t Val = cast( cast(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; diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp index 0b14229ac62..466d18896ed 100644 --- a/lib/Transforms/IPO/GlobalDCE.cpp +++ b/lib/Transforms/IPO/GlobalDCE.cpp @@ -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(&GV)) { - GlobalObject::VCallVisibility TypeVis = GV.getVCallVisibility(); + GlobalObject::VCallVisibility TypeVis = GO->getVCallVisibility(); if (TypeVis == GlobalObject::VCallVisibilityTranslationUnit || (LTOPostLink && TypeVis == GlobalObject::VCallVisibilityLinkageUnit)) {