[llvm] 82f9b0f - [MC] Remove Parent initializer from MCFragment ctor
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 21 23:02:35 PDT 2024
Author: Fangrui Song
Date: 2024-06-21T23:02:30-07:00
New Revision: 82f9b0fbda81232d1294aafa2611a84bba082da6
URL: https://github.com/llvm/llvm-project/commit/82f9b0fbda81232d1294aafa2611a84bba082da6
DIFF: https://github.com/llvm/llvm-project/commit/82f9b0fbda81232d1294aafa2611a84bba082da6.diff
LOG: [MC] Remove Parent initializer from MCFragment ctor
Added:
Modified:
llvm/include/llvm/MC/MCFragment.h
llvm/lib/MC/MCFragment.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/MC/MCFragment.h b/llvm/include/llvm/MC/MCFragment.h
index e7675481610f4..72db28cb5eb67 100644
--- a/llvm/include/llvm/MC/MCFragment.h
+++ b/llvm/include/llvm/MC/MCFragment.h
@@ -58,7 +58,7 @@ class MCFragment {
MCFragment *Next = nullptr;
/// The data for the section this fragment is in.
- MCSection *Parent;
+ MCSection *Parent = nullptr;
/// The offset of this fragment in its section.
uint64_t Offset = 0;
diff --git a/llvm/lib/MC/MCFragment.cpp b/llvm/lib/MC/MCFragment.cpp
index ea5bf7b58cdb8..d90fd34815bda 100644
--- a/llvm/lib/MC/MCFragment.cpp
+++ b/llvm/lib/MC/MCFragment.cpp
@@ -199,8 +199,7 @@ uint64_t llvm::computeBundlePadding(const MCAssembler &Assembler,
/* *** */
MCFragment::MCFragment(FragmentType Kind, bool HasInstructions)
- : Parent(Parent), Kind(Kind), HasInstructions(HasInstructions),
- LinkerRelaxable(false) {}
+ : Kind(Kind), HasInstructions(HasInstructions), LinkerRelaxable(false) {}
void MCFragment::destroy() {
// First check if we are the sentinel.
More information about the llvm-commits
mailing list