This is an archive of the discontinued LLVM Phabricator instance.

[LLVM-C] Add more debug information accessors to GlobalObject and Instruction
ClosedPublic

Authored by CodaFi on Aug 30 2018, 4:03 PM.

Details

Summary

Adds missing debug information accessors to GlobalObject. This puts the finishing touches on cloning debug info in the echo tests.

Diff Detail

Repository
rL LLVM

Event Timeline

CodaFi created this revision.Aug 30 2018, 4:03 PM

How is a user of this API supposed to map the unsigned Kind values to something meaningful? We don't have an enum LLVMMetadataKind, do we?

include/llvm-c/Core.h
2150 ↗(On Diff #163439)

Very small nit: Global. There's some code out there that generates a higher level API by parsing the C headers and inferring semantics from names, let's keep it easy to maintain.

How is a user of this API supposed to map the unsigned Kind values to something meaningful? We don't have an enum LLVMMetadataKind, do we?

You’re supposed to be able to register your own kinds with LLVMContext::getMDKindID et al. I was planning to wrap those in a follow-up.

include/llvm-c/Core.h
2150 ↗(On Diff #163439)

I wanted to distinguish these from their unnamedspaced counterparts that seem to work exclusively with the parallel APIs in llvm::Instruction. Is there some middle ground naming scheme here or should I remove the Global bits and add GlobalObject support to the Instruction one?

whitequark added inline comments.Aug 30 2018, 10:17 PM
include/llvm-c/Core.h
2150 ↗(On Diff #163439)

Oh I just mean the argument name.

CodaFi updated this revision to Diff 163554.Aug 31 2018, 10:22 AM
CodaFi marked 3 inline comments as done.
This revision is now accepted and ready to land.Sep 28 2018, 8:05 AM
This revision was automatically updated to reflect the committed changes.