[PATCH] D101921: [MC] Make it possible for targets to define their own MCObjectFileInfo

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 11 12:20:37 PDT 2021


MaskRay added inline comments.


================
Comment at: llvm/include/llvm/MC/MCObjectFileInfo.h:255
 
+  virtual unsigned getTextSectionAlignment() const { return 4; }
   MCSection *getTextSection() const { return TextSection; }
----------------
This should be moved to D102052


================
Comment at: llvm/lib/DWARFLinker/DWARFStreamer.cpp:57
 
-  MOFI.reset(new MCObjectFileInfo);
-  MC.reset(
-      new MCContext(TheTriple, MAI.get(), MRI.get(), MOFI.get(), MSTI.get()));
-  MOFI->initMCObjectFileInfo(*MC, /*PIC=*/false);
+  MC.reset(new MCContext(TheTriple, MAI.get(), MRI.get(), /*MOFI=*/nullptr,
+                         MSTI.get()));
----------------
flip1995 wrote:
> MaskRay wrote:
> > The argument is almost always `/*MOFI=*/nullptr`. Doesn't this regress a bit?
> I agree. I think the best thing to do here would be to just remove this argument?
I think so. Since MOFI is guaranteed to be constructed after MCContext now. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101921



More information about the cfe-commits mailing list