[PATCH] D72315: [NFC] Simplifying the condition which kind of MCFragment doesn't need to handle fixup

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 13:28:49 PST 2020


efriedma added a comment.

Did you audit the other uses of `dyn_cast<MCEncodedFragment>`?



================
Comment at: llvm/include/llvm/MC/MCFragment.h:220
 
   static bool classof(const MCFragment *F) {
     MCFragment::FragmentType Kind = F->getKind();
----------------
Jim wrote:
> efriedma wrote:
> > MCEncodedFragmentWithFixups::classof is wrong; it allows incorrect casts.
> I don't understand why it is wrong? Thanks
MCEncodedFragmentWithFixups is a template; the specific fragment kinds only inherit from one specific instantiation of the template.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72315/new/

https://reviews.llvm.org/D72315





More information about the llvm-commits mailing list