[PATCH] D89787: [AsmParser] Add source location to all errors related to .cfi directives

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 30 10:06:48 PDT 2020


arichardson added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp:245
   case MCCFIInstruction::OpDefCfaOffset:
-    OutStreamer->emitCFIDefCfaOffset(Inst.getOffset());
+    OutStreamer->emitCFIDefCfaOffset(Inst.getOffset(), Loc);
     break;
----------------
arichardson wrote:
> MaskRay wrote:
> > These can be simplified by switching to default arguments in the declarations.
> Yes. However, I chose to not add default arguments to ensure that all callers from the asmparser side are forced to pass the argument. I initially had default arguments but missed a lot of call sites before I removed the default.
To simplify the cases where there is no Loc, we could do something like `void emitCFIEndProc(MCSTREAMER_SMLOC(Loc));` 

The files that don't can't to pass a SMLoc could then do
`#define MCSTREAMER_SMLOC(name) SMLoc name = SMLoc()`
but I'm not sure this is worth the effort.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89787



More information about the llvm-commits mailing list