-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Fix unused private field warning #91500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
After 11a6799 "[clang][CodeGen] Omit pre-opt link when post-opt is link requested (llvm#85672)" I'm seeing a new warning: > BackendConsumer.h:37:22: error: private field 'FileMgr' is not used > [-Werror,-Wunused-private-field] Remove the field since it's no longer used.
@llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Justin Bogner (bogner) ChangesAfter 11a6799 "[clang][CodeGen] Omit pre-opt link when post-opt is link requested (#85672)" I'm seeing a new warning: > BackendConsumer.h:37:22: error: private field 'FileMgr' is not used [-Werror,-Wunused-private-field] Remove the field since it's no longer used. Full diff: https://github.com/llvm/llvm-project/pull/91500.diff 2 Files Affected:
diff --git a/clang/lib/CodeGen/BackendConsumer.h b/clang/lib/CodeGen/BackendConsumer.h
index f9edbe901bb8..0fe9929dca2b 100644
--- a/clang/lib/CodeGen/BackendConsumer.h
+++ b/clang/lib/CodeGen/BackendConsumer.h
@@ -34,7 +34,6 @@ class BackendConsumer : public ASTConsumer {
const CodeGenOptions &CodeGenOpts;
const TargetOptions &TargetOpts;
const LangOptions &LangOpts;
- const FileManager &FileMgr;
std::unique_ptr<raw_pwrite_stream> AsmOutStream;
ASTContext *Context;
IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS;
@@ -76,7 +75,7 @@ class BackendConsumer : public ASTConsumer {
const PreprocessorOptions &PPOpts,
const CodeGenOptions &CodeGenOpts,
const TargetOptions &TargetOpts, const LangOptions &LangOpts,
- const FileManager &FileMgr, const std::string &InFile,
+ const std::string &InFile,
SmallVector<LinkModule, 4> LinkModules,
std::unique_ptr<raw_pwrite_stream> OS, llvm::LLVMContext &C,
CoverageSourceInfo *CoverageInfo = nullptr);
@@ -90,8 +89,8 @@ class BackendConsumer : public ASTConsumer {
const PreprocessorOptions &PPOpts,
const CodeGenOptions &CodeGenOpts,
const TargetOptions &TargetOpts, const LangOptions &LangOpts,
- const FileManager &FileMgr, llvm::Module *Module,
- SmallVector<LinkModule, 4> LinkModules, llvm::LLVMContext &C,
+ llvm::Module *Module, SmallVector<LinkModule, 4> LinkModules,
+ llvm::LLVMContext &C,
CoverageSourceInfo *CoverageInfo = nullptr);
llvm::Module *getModule() const;
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 0255f05b1f90..6d3efdb5ffe3 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -114,13 +114,12 @@ BackendConsumer::BackendConsumer(
const HeaderSearchOptions &HeaderSearchOpts,
const PreprocessorOptions &PPOpts, const CodeGenOptions &CodeGenOpts,
const TargetOptions &TargetOpts, const LangOptions &LangOpts,
- const FileManager &FileMgr, const std::string &InFile,
- SmallVector<LinkModule, 4> LinkModules,
+ const std::string &InFile, SmallVector<LinkModule, 4> LinkModules,
std::unique_ptr<raw_pwrite_stream> OS, LLVMContext &C,
CoverageSourceInfo *CoverageInfo)
: Diags(Diags), Action(Action), HeaderSearchOpts(HeaderSearchOpts),
CodeGenOpts(CodeGenOpts), TargetOpts(TargetOpts), LangOpts(LangOpts),
- FileMgr(FileMgr), AsmOutStream(std::move(OS)), Context(nullptr), FS(VFS),
+ AsmOutStream(std::move(OS)), Context(nullptr), FS(VFS),
LLVMIRGeneration("irgen", "LLVM IR Generation Time"),
LLVMIRGenerationRefCount(0),
Gen(CreateLLVMCodeGen(Diags, InFile, std::move(VFS), HeaderSearchOpts,
@@ -140,12 +139,11 @@ BackendConsumer::BackendConsumer(
const HeaderSearchOptions &HeaderSearchOpts,
const PreprocessorOptions &PPOpts, const CodeGenOptions &CodeGenOpts,
const TargetOptions &TargetOpts, const LangOptions &LangOpts,
- const FileManager &FileMgr, llvm::Module *Module,
- SmallVector<LinkModule, 4> LinkModules, LLVMContext &C,
- CoverageSourceInfo *CoverageInfo)
+ llvm::Module *Module, SmallVector<LinkModule, 4> LinkModules,
+ LLVMContext &C, CoverageSourceInfo *CoverageInfo)
: Diags(Diags), Action(Action), HeaderSearchOpts(HeaderSearchOpts),
CodeGenOpts(CodeGenOpts), TargetOpts(TargetOpts), LangOpts(LangOpts),
- FileMgr(FileMgr), Context(nullptr), FS(VFS),
+ Context(nullptr), FS(VFS),
LLVMIRGeneration("irgen", "LLVM IR Generation Time"),
LLVMIRGenerationRefCount(0),
Gen(CreateLLVMCodeGen(Diags, "", std::move(VFS), HeaderSearchOpts, PPOpts,
@@ -1022,9 +1020,8 @@ CodeGenAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
std::unique_ptr<BackendConsumer> Result(new BackendConsumer(
BA, CI.getDiagnostics(), &CI.getVirtualFileSystem(),
CI.getHeaderSearchOpts(), CI.getPreprocessorOpts(), CI.getCodeGenOpts(),
- CI.getTargetOpts(), CI.getLangOpts(), CI.getFileManager(),
- std::string(InFile), std::move(LinkModules), std::move(OS), *VMContext,
- CoverageInfo));
+ CI.getTargetOpts(), CI.getLangOpts(), std::string(InFile),
+ std::move(LinkModules), std::move(OS), *VMContext, CoverageInfo));
BEConsumer = Result.get();
// Enable generating macro debug info only when debug info is not disabled and
@@ -1195,7 +1192,7 @@ void CodeGenAction::ExecuteAction() {
BackendConsumer Result(BA, CI.getDiagnostics(), &CI.getVirtualFileSystem(),
CI.getHeaderSearchOpts(), CI.getPreprocessorOpts(),
CI.getCodeGenOpts(), CI.getTargetOpts(),
- CI.getLangOpts(), CI.getFileManager(), TheModule.get(),
+ CI.getLangOpts(), TheModule.get(),
std::move(LinkModules), *VMContext, nullptr);
// Link in each pending link module.
|
After 11a6799 "[clang][CodeGen] Omit pre-opt link when post-opt is link requested (llvm#85672)" I'm seeing a new warning: > BackendConsumer.h:37:22: error: private field 'FileMgr' is not used [-Werror,-Wunused-private-field] Remove the field since it's no longer used. Change-Id: Ieb8531ebf020e1a46d257a4c95b0153842af542a
After 11a6799 "[clang][CodeGen] Omit pre-opt link when post-opt is link requested (llvm#85672)" I'm seeing a new warning: > BackendConsumer.h:37:22: error: private field 'FileMgr' is not used [-Werror,-Wunused-private-field] Remove the field since it's no longer used. Change-Id: Ieb8531ebf020e1a46d257a4c95b0153842af542a
After 11a6799 "[clang][CodeGen] Omit pre-opt link when post-opt is link requested (#85672)" I'm seeing a new warning:
Remove the field since it's no longer used.