[llvm] r374554 - Fix compilation warnings. NFC.
Michael Liao via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 11 07:09:45 PDT 2019
Author: hliao
Date: Fri Oct 11 07:09:44 2019
New Revision: 374554
URL: http://llvm.org/viewvc/llvm-project?rev=374554&view=rev
Log:
Fix compilation warnings. NFC.
Modified:
llvm/trunk/lib/IR/Metadata.cpp
llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp
Modified: llvm/trunk/lib/IR/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=374554&r1=374553&r2=374554&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Metadata.cpp (original)
+++ llvm/trunk/lib/IR/Metadata.cpp Fri Oct 11 07:09:44 2019
@@ -1509,7 +1509,7 @@ GlobalObject::VCallVisibility GlobalObje
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;
Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=374554&r1=374553&r2=374554&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Fri Oct 11 07:09:44 2019
@@ -189,7 +189,7 @@ void GlobalDCEPass::ScanVTables(Module &
// 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)) {
More information about the llvm-commits
mailing list