[llvm] 3b916ad - [MC] Remove duplicate Contents field from MCLEBFragment.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 18 10:37:26 PST 2023
Author: Craig Topper
Date: 2023-11-18T10:30:17-08:00
New Revision: 3b916ad6733b04a86ca0aec57be647daf4647d5b
URL: https://github.com/llvm/llvm-project/commit/3b916ad6733b04a86ca0aec57be647daf4647d5b
DIFF: https://github.com/llvm/llvm-project/commit/3b916ad6733b04a86ca0aec57be647daf4647d5b.diff
LOG: [MC] Remove duplicate Contents field from MCLEBFragment.
There's already a Contents field in the MCEncodedFragmentWithFixups
base class. The Contents field in MCLEBFragment is private and there
is no accessor for it. It is initialized in the constructor, but that
should probably initialize the base class version.
Added:
Modified:
llvm/include/llvm/MC/MCFragment.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/MC/MCFragment.h b/llvm/include/llvm/MC/MCFragment.h
index efe44b0b6917e10..c314fdd3aa69730 100644
--- a/llvm/include/llvm/MC/MCFragment.h
+++ b/llvm/include/llvm/MC/MCFragment.h
@@ -435,13 +435,11 @@ class MCLEBFragment final : public MCEncodedFragmentWithFixups<10, 1> {
/// The value this fragment should contain.
const MCExpr *Value;
- SmallString<8> Contents;
-
public:
MCLEBFragment(const MCExpr &Value, bool IsSigned, MCSection *Sec = nullptr)
: MCEncodedFragmentWithFixups<10, 1>(FT_LEB, false, Sec),
IsSigned(IsSigned), Value(&Value) {
- Contents.push_back(0);
+ getContents().push_back(0);
}
const MCExpr &getValue() const { return *Value; }
More information about the llvm-commits
mailing list