[PATCH] D122258: [MC] Omit DWARF unwind info if compact unwind is present for all archs

Lang Hames via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 26 14:26:42 PDT 2022

lhames added inline comments.

Comment at: llvm/tools/llc/llc.cpp:697-700
+    auto &Ctx = MMIWP->getMMI().getContext();
+    Ctx.setGenDwarfForAssembly(Target->Options.ForceDwarfFrameSection);
     const_cast<TargetLoweringObjectFile *>(LLVMTM.getObjFileLowering())
+        ->Initialize(Ctx, *Target);
int3 wrote:
> int3 wrote:
> > lhames wrote:
> > > This option hand-off feels very manual. I wonder if we should add a `propagateTargetOptionsToMC` function, but maybe the set of options that it would apply to is small enough not to bother for now?
> > > 
> > > I would add something like this to `LLVMTargetMachine::addPassesToEmitMC` too, for the the case where the caller passes in a null `MCContext*`. 
> > thanks for the pointers! I'll look into that
> actually, I'm not sure I understood your suggestion... which class do you envision `propagateTargetOptionsToMC` being defined in? How would it make things "less manual"?
Oh! `TargetOptions` has an `MCTargetOptions` member already. If `GenDwarfUnwindInfo` === `ForceDwarfUnwindInfo`, could you just sink `ForceDwarfUnwindInfo` into `MCTargetOptions`? 

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list