-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[Debugify] applyDebugify - remove unnecessary defaults arg values and assert dereferencable values #127186
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
… assert dereferencable values The applyDebugify helpers were providing default arguments despite all callers providing them, so strip them for clarity. The Function variant was asserting that DebugInfoBeforePass was non-null before dereferencing so I've added an equivalent assert to the Method variant as well. Fixes llvm#97626
@llvm/pr-subscribers-llvm-transforms @llvm/pr-subscribers-debuginfo Author: Simon Pilgrim (RKSimon) ChangesThe applyDebugify helpers were providing default arguments despite all callers providing them, so strip them for clarity. The Function variant was asserting that DebugInfoBeforePass was non-null before dereferencing so I've added an equivalent assert to the Method variant as well. Fixes #97626 Full diff: https://github.com/llvm/llvm-project/pull/127186.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp
index e47a6ce6e9205..e6b5e267d192b 100644
--- a/llvm/lib/Transforms/Utils/Debugify.cpp
+++ b/llvm/lib/Transforms/Utils/Debugify.cpp
@@ -214,30 +214,27 @@ bool llvm::applyDebugifyMetadata(
return true;
}
-static bool
-applyDebugify(Function &F,
- enum DebugifyMode Mode = DebugifyMode::SyntheticDebugInfo,
- DebugInfoPerPass *DebugInfoBeforePass = nullptr,
- StringRef NameOfWrappedPass = "") {
+static bool applyDebugify(Function &F, enum DebugifyMode Mode,
+ DebugInfoPerPass *DebugInfoBeforePass,
+ StringRef NameOfWrappedPass = "") {
Module &M = *F.getParent();
auto FuncIt = F.getIterator();
if (Mode == DebugifyMode::SyntheticDebugInfo)
return applyDebugifyMetadata(M, make_range(FuncIt, std::next(FuncIt)),
"FunctionDebugify: ", /*ApplyToMF*/ nullptr);
- assert(DebugInfoBeforePass);
+ assert(DebugInfoBeforePass && "Missing debug info metadata");
return collectDebugInfoMetadata(M, M.functions(), *DebugInfoBeforePass,
"FunctionDebugify (original debuginfo)",
NameOfWrappedPass);
}
-static bool
-applyDebugify(Module &M,
- enum DebugifyMode Mode = DebugifyMode::SyntheticDebugInfo,
- DebugInfoPerPass *DebugInfoBeforePass = nullptr,
- StringRef NameOfWrappedPass = "") {
+static bool applyDebugify(Module &M, enum DebugifyMode Mode,
+ DebugInfoPerPass *DebugInfoBeforePass,
+ StringRef NameOfWrappedPass = "") {
if (Mode == DebugifyMode::SyntheticDebugInfo)
return applyDebugifyMetadata(M, M.functions(),
"ModuleDebugify: ", /*ApplyToMF*/ nullptr);
+ assert(DebugInfoBeforePass && "Missing debug info metadata");
return collectDebugInfoMetadata(M, M.functions(), *DebugInfoBeforePass,
"ModuleDebugify (original debuginfo)",
NameOfWrappedPass);
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/11470 Here is the relevant piece of the build log for the reference
|
… assert dereferencable values (llvm#127186) The applyDebugify helpers were providing default arguments despite all callers providing them, so strip them for clarity. The Function variant was asserting that DebugInfoBeforePass was non-null before dereferencing so I've added an equivalent assert to the Method variant as well. Fixes llvm#97626
… assert dereferencable values (llvm#127186) The applyDebugify helpers were providing default arguments despite all callers providing them, so strip them for clarity. The Function variant was asserting that DebugInfoBeforePass was non-null before dereferencing so I've added an equivalent assert to the Method variant as well. Fixes llvm#97626
The applyDebugify helpers were providing default arguments despite all callers providing them, so strip them for clarity.
The Function variant was asserting that DebugInfoBeforePass was non-null before dereferencing so I've added an equivalent assert to the Method variant as well.
Fixes #97626