[MC] Delete MCFragment::isDummy. NFC
authorFangrui Song <maskray@google.com>
Mon, 6 Jan 2020 02:44:22 +0000 (18:44 -0800)
committerFangrui Song <maskray@google.com>
Mon, 6 Jan 2020 02:49:47 +0000 (18:49 -0800)
isa<...>, dyn_cast<...> and cast<...> are used by other fragments.
Don't make MCDummyFragment special.

llvm/include/llvm/MC/MCFragment.h
llvm/lib/MC/MCFragment.cpp

index edc25ec..1ecbdbf 100644 (file)
@@ -106,9 +106,6 @@ public:
   /// 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;
 };
 
index 5192948..f6b64c8 100644 (file)
@@ -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);
 }