[llvm] 2c05310 - [MC] Delete MCFragment::isDummy. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 5 18:50:05 PST 2020
Author: Fangrui Song
Date: 2020-01-05T18:49:47-08:00
New Revision: 2c053109fa83dc260042552c9132f3f528eb894e
URL: https://github.com/llvm/llvm-project/commit/2c053109fa83dc260042552c9132f3f528eb894e
DIFF: https://github.com/llvm/llvm-project/commit/2c053109fa83dc260042552c9132f3f528eb894e.diff
LOG: [MC] Delete MCFragment::isDummy. NFC
isa<...>, dyn_cast<...> and cast<...> are used by other fragments.
Don't make MCDummyFragment special.
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 edc25ec38b7b..1ecbdbfa9806 100644
--- a/llvm/include/llvm/MC/MCFragment.h
+++ b/llvm/include/llvm/MC/MCFragment.h
@@ -106,9 +106,6 @@ class MCFragment : public ilist_node_with_parent<MCFragment, MCSection> {
/// this is false, but specific fragment types may set it to true.
bool hasInstructions() const { return HasInstructions; }
- /// Return true if given frgment has FT_Dummy type.
- bool isDummy() const { return Kind == FT_Dummy; }
-
void dump() const;
};
diff --git a/llvm/lib/MC/MCFragment.cpp b/llvm/lib/MC/MCFragment.cpp
index 5192948ed39f..f6b64c8fa95d 100644
--- a/llvm/lib/MC/MCFragment.cpp
+++ b/llvm/lib/MC/MCFragment.cpp
@@ -236,7 +236,7 @@ MCFragment::MCFragment(FragmentType Kind, bool HasInstructions,
MCSection *Parent)
: Kind(Kind), HasInstructions(HasInstructions), LayoutOrder(0),
Parent(Parent), Atom(nullptr), Offset(~UINT64_C(0)) {
- if (Parent && !isDummy())
+ if (Parent && !isa<MCDummyFragment>(*this))
Parent->getFragmentList().push_back(this);
}
More information about the llvm-commits
mailing list