[llvm] f93a6aa - [Inliner][NFC] silence gcc 'overloaded-virtual' warning on hiding of Pass::doInitialization
Fedor Sergeev via llvm-commits
llvm-commits at lists.llvm.org
Sun May 17 02:52:13 PDT 2020
Author: Fedor Sergeev
Date: 2020-05-17T16:31:33+07:00
New Revision: f93a6aaebcf47528e51a6d943ca7699412f30234
URL: https://github.com/llvm/llvm-project/commit/f93a6aaebcf47528e51a6d943ca7699412f30234
DIFF: https://github.com/llvm/llvm-project/commit/f93a6aaebcf47528e51a6d943ca7699412f30234.diff
LOG: [Inliner][NFC] silence gcc 'overloaded-virtual' warning on hiding of Pass::doInitialization
When compiling with -Werror=overloaded-virtual, gcc emits this:
====
llvm/include/llvm/Pass.h:102:16: error: ‘virtual bool llvm::Pass::doInitialization(llvm::Module&)’ was hidden [-Werror=overloaded-virtual]
virtual bool doInitialization(Module &) { return false; }
^~~~~~~~~~~~~~~~
In file included from llvm/lib/Transforms/IPO/Inliner.cpp:20:0:
llvm/include/llvm/Transforms/IPO/Inliner.h:38:8: error: by ‘virtual bool llvm::LegacyInlinerBase::doInitialization(llvm::CallGraph&)’ [-Werror=overloaded-virtual]
bool doInitialization(CallGraph &CG) override;
^~~~~~~~~~~~~~~~
====
This is an old issue which has just started biting our downstream after
a slight rearrangement of includes around Inliner.
Fixing it similar to how doFinalization was done years ago.
Added:
Modified:
llvm/include/llvm/Transforms/IPO/Inliner.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/IPO/Inliner.h b/llvm/include/llvm/Transforms/IPO/Inliner.h
index 5a5b561adde0..447616102c0d 100644
--- a/llvm/include/llvm/Transforms/IPO/Inliner.h
+++ b/llvm/include/llvm/Transforms/IPO/Inliner.h
@@ -36,6 +36,8 @@ struct LegacyInlinerBase : public CallGraphSCCPass {
/// call the implementation here.
void getAnalysisUsage(AnalysisUsage &Info) const override;
+ using llvm::Pass::doInitialization;
+
bool doInitialization(CallGraph &CG) override;
/// Main run interface method, this implements the interface required by the
More information about the llvm-commits
mailing list