This is an archive of the discontinued LLVM Phabricator instance.

[LLVM-C] Correct The Current Debug Location Accessors
ClosedPublic

Authored by CodaFi on Apr 9 2019, 1:34 PM.

Details

Summary

Deprecate the existing accessors for the "current debug location" of an IRBuilder. The setter could not handle being reset to NULL, and the getter would create bogus metadata if the NULL location was returned. Provide direct metadata-based accessors instead.

Diff Detail

Event Timeline

CodaFi created this revision.Apr 9 2019, 1:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 9 2019, 1:34 PM
whitequark added inline comments.
llvm/include/llvm-c/Core.h
3531

Let's add the 2 suffix here for consistency as well.

CodaFi marked an inline comment as done.Apr 9 2019, 3:01 PM
CodaFi added inline comments.
llvm/include/llvm-c/Core.h
3531

This API didn't change, the diff is just a mess!

CodaFi updated this revision to Diff 194406.Apr 9 2019, 3:02 PM
whitequark added inline comments.Apr 9 2019, 3:11 PM
llvm/include/llvm-c/Core.h
3531

Oh... Can you add some docs for this API? I had to look up the C++ source to even understand what it's supposed to do.

CodaFi updated this revision to Diff 194408.Apr 9 2019, 3:24 PM
CodaFi marked an inline comment as done.

Add documentation to LLVMSetInstDebugLocation

This revision is now accepted and ready to land.Apr 9 2019, 3:28 PM
This revision was automatically updated to reflect the committed changes.

These symbols conflict with identically-named symbols in llvm/bindings/go/llvm/IRBindings.h, going to revert (I don't know what the right name is, and in the C API that's probably important)

*sigh*, I'll resubmit this and nuke the ones in the Go bindings then.