This is an archive of the discontinued LLVM Phabricator instance.

[LLVM-C] Add Bindings For Module Flags
ClosedPublic

Authored by CodaFi on May 11 2018, 9:17 PM.

Details

Summary

The first foray into merging debug info into the echo tests.

  • Add bindings to Module::getModuleFlagsMetadata() in the form of LLVMCopyModuleFlagsMetadata
  • Add the opaque type LLVMModuleFlagEntry to represent Module::ModuleFlagEntry
  • Add accessors for LLVMModuleFlagEntry's behavior, key, and metadata node.

Diff Detail

Repository
rL LLVM

Event Timeline

CodaFi created this revision.May 11 2018, 9:17 PM
CodaFi updated this revision to Diff 146460.May 11 2018, 9:21 PM
aprantl added inline comments.May 12 2018, 9:01 AM
include/llvm-c/Core.h
385 ↗(On Diff #146460)

The /**< style comments are useful when the comment fits on the same line, but if not, it just ends up looking silly :-)
Can you move the comment to the line above the enumerator?

CodaFi updated this revision to Diff 146478.May 12 2018, 11:39 AM
CodaFi marked an inline comment as done.
whitequark requested changes to this revision.May 13 2018, 9:55 PM
whitequark added inline comments.
include/llvm-c/Core.h
721 ↗(On Diff #146478)

The caller is going to free this array how? LLVM provides dispose functions but I don't see one here.

This revision now requires changes to proceed.May 13 2018, 9:55 PM
CodaFi added inline comments.May 13 2018, 10:49 PM
include/llvm-c/Core.h
721 ↗(On Diff #146478)

The data for the entries is owned by the module, the array is just an adapter for those entries - the user need only free. I can provide an explicit dispose for this in case we decide to change that user model or for clarity if you want.

The data for the entries is owned by the module, the array is just an adapter for those entries - the user need only free. I can provide an explicit dispose for this in case we decide to change that user model or for clarity if you want.

Yes, the specific allocator used by LLVM is an implementation detail.

CodaFi updated this revision to Diff 146541.May 13 2018, 10:56 PM
CodaFi marked 2 inline comments as done.
whitequark accepted this revision.May 13 2018, 10:58 PM
This revision is now accepted and ready to land.May 13 2018, 10:58 PM
This revision was automatically updated to reflect the committed changes.