-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[IR] Fix warnings #143752
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
[IR] Fix warnings #143752
Conversation
This patch fixes: llvm/lib/IR/DIBuilder.cpp:1072:18: error: unused function 'getDeclareIntrin' [-Werror,-Wunused-function] llvm/include/llvm/IR/DIBuilder.h:51:15: error: private field 'DeclareFn' is not used [-Werror,-Wunused-private-field] llvm/include/llvm/IR/DIBuilder.h:52:15: error: private field 'ValueFn' is not used [-Werror,-Wunused-private-field] llvm/include/llvm/IR/DIBuilder.h:53:15: error: private field 'LabelFn' is not used [-Werror,-Wunused-private-field] llvm/include/llvm/IR/DIBuilder.h:54:15: error: private field 'AssignFn' is not used [-Werror,-Wunused-private-field]
@llvm/pr-subscribers-llvm-ir Author: Kazu Hirata (kazutakahirata) ChangesThis patch fixes: llvm/lib/IR/DIBuilder.cpp:1072:18: error: unused function llvm/include/llvm/IR/DIBuilder.h:51:15: error: private field llvm/include/llvm/IR/DIBuilder.h:52:15: error: private field llvm/include/llvm/IR/DIBuilder.h:53:15: error: private field llvm/include/llvm/IR/DIBuilder.h:54:15: error: private field Full diff: https://github.com/llvm/llvm-project/pull/143752.diff 2 Files Affected:
diff --git a/llvm/include/llvm/IR/DIBuilder.h b/llvm/include/llvm/IR/DIBuilder.h
index ebfe41dd59afb..43fca571ee6d5 100644
--- a/llvm/include/llvm/IR/DIBuilder.h
+++ b/llvm/include/llvm/IR/DIBuilder.h
@@ -47,11 +47,7 @@ namespace llvm {
Module &M;
LLVMContext &VMContext;
- DICompileUnit *CUNode; ///< The one compile unit created by this DIBuiler.
- Function *DeclareFn; ///< llvm.dbg.declare
- Function *ValueFn; ///< llvm.dbg.value
- Function *LabelFn; ///< llvm.dbg.label
- Function *AssignFn; ///< llvm.dbg.assign
+ DICompileUnit *CUNode; ///< The one compile unit created by this DIBuiler.
SmallVector<TrackingMDNodeRef, 4> AllEnumTypes;
/// Track the RetainTypes, since they can be updated later on.
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 1484c549dd580..fd8c2d7bb5cc3 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -25,8 +25,7 @@ using namespace llvm;
using namespace llvm::dwarf;
DIBuilder::DIBuilder(Module &m, bool AllowUnresolvedNodes, DICompileUnit *CU)
- : M(m), VMContext(M.getContext()), CUNode(CU), DeclareFn(nullptr),
- ValueFn(nullptr), LabelFn(nullptr), AssignFn(nullptr),
+ : M(m), VMContext(M.getContext()), CUNode(CU),
AllowUnresolvedNodes(AllowUnresolvedNodes) {
if (CUNode) {
if (const auto &ETs = CUNode->getEnumTypes())
@@ -1069,10 +1068,6 @@ static Value *getDbgIntrinsicValueImpl(LLVMContext &VMContext, Value *V) {
return MetadataAsValue::get(VMContext, ValueAsMetadata::get(V));
}
-static Function *getDeclareIntrin(Module &M) {
- return Intrinsic::getOrInsertDeclaration(&M, Intrinsic::dbg_declare);
-}
-
DbgInstPtr DIBuilder::insertDbgValueIntrinsic(llvm::Value *Val,
DILocalVariable *VarInfo,
DIExpression *Expr,
|
@jmorse I normally merge warning fixes myself, but your commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch, my prediction of an hour was for the code in #143746 to remove other unrelated pieces of code, rather than these warnings. And we've now hit the end of the day in the UK, curses. Please do merge this in anyway! (my ancient local compiler doesn't flag these things up ._.).
Awkwardly I did spot one warning and pushed up 7414d88 directly, so now I've given you a merge conflict to deal with sorry.
This patch fixes: llvm/lib/IR/DIBuilder.cpp:1072:18: error: unused function 'getDeclareIntrin' [-Werror,-Wunused-function] llvm/include/llvm/IR/DIBuilder.h:51:15: error: private field 'DeclareFn' is not used [-Werror,-Wunused-private-field] llvm/include/llvm/IR/DIBuilder.h:52:15: error: private field 'ValueFn' is not used [-Werror,-Wunused-private-field] llvm/include/llvm/IR/DIBuilder.h:53:15: error: private field 'LabelFn' is not used [-Werror,-Wunused-private-field] llvm/include/llvm/IR/DIBuilder.h:54:15: error: private field 'AssignFn' is not used [-Werror,-Wunused-private-field]
This patch fixes: llvm/lib/IR/DIBuilder.cpp:1072:18: error: unused function 'getDeclareIntrin' [-Werror,-Wunused-function] llvm/include/llvm/IR/DIBuilder.h:51:15: error: private field 'DeclareFn' is not used [-Werror,-Wunused-private-field] llvm/include/llvm/IR/DIBuilder.h:52:15: error: private field 'ValueFn' is not used [-Werror,-Wunused-private-field] llvm/include/llvm/IR/DIBuilder.h:53:15: error: private field 'LabelFn' is not used [-Werror,-Wunused-private-field] llvm/include/llvm/IR/DIBuilder.h:54:15: error: private field 'AssignFn' is not used [-Werror,-Wunused-private-field]
This patch fixes:
llvm/lib/IR/DIBuilder.cpp:1072:18: error: unused function
'getDeclareIntrin' [-Werror,-Wunused-function]
llvm/include/llvm/IR/DIBuilder.h:51:15: error: private field
'DeclareFn' is not used [-Werror,-Wunused-private-field]
llvm/include/llvm/IR/DIBuilder.h:52:15: error: private field
'ValueFn' is not used [-Werror,-Wunused-private-field]
llvm/include/llvm/IR/DIBuilder.h:53:15: error: private field
'LabelFn' is not used [-Werror,-Wunused-private-field]
llvm/include/llvm/IR/DIBuilder.h:54:15: error: private field
'AssignFn' is not used [-Werror,-Wunused-private-field]