[PATCH] D79484: [DebugInfo] Fortran module DebugInfo support in LLVM

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 10:47:16 PDT 2020


aprantl added inline comments.


================
Comment at: llvm/include/llvm/IR/DebugInfoMetadata.h:2139
   StringRef getAPINotesFile() const { return getStringOperand(4); }
+  DIFile *getFile() const { return cast_or_null<DIFile>(getRawFile()); }
+  unsigned getLineNo() const { return LineNo; }
----------------
SouraVX wrote:
> aprantl wrote:
> > The parent class DIScope already provides a `getFile()` method. Are we storing the file operand twice?
> Didn't get you completely here, I think that's needed, if you're asking.
> Is there better way to accomplish this ? I remember noting some failures when using parent `DIScope`  `getFile`.
> I remember noting some failures when using parent DIScope  getFile.

We'll have to figure that out first.
Looking at the definition of `getRawFile()` in `DIScope`, it expects the File to be Operand[0]. Did you take this into account? I think if you change the order of metadata operands to have the File first, you should be able to just use the parent DIScope's getFile functionality. Is that perhaps why it didn't work when you first tried it?


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

https://reviews.llvm.org/D79484





More information about the llvm-commits mailing list