This is an archive of the discontinued LLVM Phabricator instance.

[LLVM-C] Add bindings to create macro debug info
ClosedPublic

Authored by Jiboo on Feb 17 2019, 3:43 PM.

Details

Diff Detail

Event Timeline

Jiboo created this revision.Feb 17 2019, 3:43 PM
whitequark added inline comments.Feb 17 2019, 3:45 PM
llvm/include/llvm-c/DebugInfo.h
486

Where are these definitions from?

CodaFi added inline comments.Feb 17 2019, 8:47 PM
llvm/include/llvm-c/DebugInfo.h
486

MacinfoRecordType. I think having a parallel for that type in the C API needs to come along with this patch.

Jiboo updated this revision to Diff 187216.Feb 18 2019, 3:44 AM

Mybad, llvm::dwarf::MacinfoRecordType (in llvm/BinaryFormat/Dwarf.h) isn't generated using Dwarf.def, so I just used the same values for another enum in llvm-c/DebugInfo.h.
The values in llvm::dwarf::MacinfoRecordType won't move as they are defined by the DWARFv4 standard (Figure 39. Macinfo Type Encodings, at page 194/325), so it is safe to static_cast it from the new LLVMDWARFMacinfoRecordType to MacinfoRecordType.

Do we usually add unit tests for the LLVM C API? If so that would be good here, too.

Jiboo updated this revision to Diff 221188.Sep 21 2019, 11:03 AM
Jiboo marked an inline comment as done.

Add tests, added a note that LLVMDWARFMacinfoRecordType values come from the DWARF spec.

Jiboo marked an inline comment as done.Sep 21 2019, 2:20 PM
Jiboo updated this revision to Diff 221205.Sep 21 2019, 4:54 PM

Forgot to apply clang-format-diff.

This revision is now accepted and ready to land.Sep 21 2019, 10:35 PM
Jiboo added a comment.Sep 22 2019, 6:32 AM

I don't have commit rights, I'd be glad if someone could commit this if the review pass, thanks.

Done (rG373903).

whitequark closed this revision.Oct 7 2019, 6:56 AM