[llvm] a84eb24 - [RemoveDIs] Add additional debug-mode verifier checks (#84308)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 11 04:47:41 PDT 2024
Author: Orlando Cazalet-Hyams
Date: 2024-03-11T11:47:38Z
New Revision: a84eb244129f288d609307ad42ab5e6c8e1cc795
URL: https://github.com/llvm/llvm-project/commit/a84eb244129f288d609307ad42ab5e6c8e1cc795
DIFF: https://github.com/llvm/llvm-project/commit/a84eb244129f288d609307ad42ab5e6c8e1cc795.diff
LOG: [RemoveDIs] Add additional debug-mode verifier checks (#84308)
Separated from #83251
Added:
Modified:
llvm/lib/IR/Verifier.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index ce090c3b8a7444..0e6c01802cfb8c 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -2691,6 +2691,11 @@ void Verifier::visitFunction(const Function &F) {
Check(verifyAttributeCount(Attrs, FT->getNumParams()),
"Attribute after last parameter!", &F);
+ CheckDI(F.IsNewDbgInfoFormat == F.getParent()->IsNewDbgInfoFormat,
+ "Function debug format should match parent module", &F,
+ F.IsNewDbgInfoFormat, F.getParent(),
+ F.getParent()->IsNewDbgInfoFormat);
+
bool IsIntrinsic = F.isIntrinsic();
// Check function attributes.
@@ -3034,6 +3039,11 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
Check(I.getParent() == &BB, "Instruction has bogus parent pointer!");
}
+ CheckDI(BB.IsNewDbgInfoFormat == BB.getParent()->IsNewDbgInfoFormat,
+ "BB debug format should match parent function", &BB,
+ BB.IsNewDbgInfoFormat, BB.getParent(),
+ BB.getParent()->IsNewDbgInfoFormat);
+
// Confirm that no issues arise from the debug program.
if (BB.IsNewDbgInfoFormat)
CheckDI(!BB.getTrailingDPValues(), "Basic Block has trailing DbgRecords!",
More information about the llvm-commits
mailing list