[llvm] Revert "[NFC]Add assert to avoid possibly deref nullptr (#65564)" (PR #66187)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 13 02:15:13 PDT 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-debuginfo
<details>
<summary>Changes</summary>
This reverts commit 99fb65fa7a65b9a3f961d6ef715324c2f8637766 because it won't benefit.
--
Full diff: https://github.com/llvm/llvm-project/pull/66187.diff
2 Files Affected:
- (modified) llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp (-1)
- (modified) llvm/lib/Target/X86/X86AsmPrinter.cpp (-1)
<pre>
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
index d6add5768951cd3..d0ef3e5a19391cc 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
@@ -400,7 +400,6 @@ void AsmPrinter::emitInlineAsm(const MachineInstr *MI) const {
"Reserved registers on the clobber list may not be "
"preserved across the asm statement, and clobbering them may "
"lead to undefined behaviour.";
- assert(MMI && "MMI can not be nullptr!");
MMI->getModule()->getContext().diagnose(DiagnosticInfoInlineAsm(
LocCookie, Msg, DiagnosticSeverity::DS_Warning));
MMI->getModule()->getContext().diagnose(
diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index d09732274f5c1df..bb94444525fb89a 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -769,7 +769,6 @@ void X86AsmPrinter::emitStartOfAsmFile(Module &M) {
if (!TT.isArch32Bit() && !TT.isArch64Bit())
llvm_unreachable("CFProtection used on invalid architecture!");
MCSection *Cur = OutStreamer->getCurrentSectionOnly();
- assert(MMI && "MMI can not be nullptr!");
MCSection *Nt = MMI->getContext().getELFSection(
".note.gnu.property", ELF::SHT_NOTE, ELF::SHF_ALLOC);
OutStreamer->switchSection(Nt);
</pre>
</details>
https://github.com/llvm/llvm-project/pull/66187
More information about the llvm-commits
mailing list