This is an archive of the discontinued LLVM Phabricator instance.

[LLVM-C] Add Bindings to Access an Instruction's DebugLoc
ClosedPublic

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

Details

Summary

Provide direct accessors to supplement LLVMSetInstDebugLocation. In addition, properly accept and return the NULL location. The old accessors provided no way to do this, so the current debug location cannot currently be cleared.

Diff Detail

Repository
rL LLVM

Event Timeline

CodaFi created this revision.Apr 9 2019, 1:02 PM
Herald added a project: Restricted Project. · View Herald Transcript
CodaFi updated this revision to Diff 194387.Apr 9 2019, 1:25 PM
CodaFi edited the summary of this revision. (Show Details)

Correctly handle the NULL location

CodaFi edited the summary of this revision. (Show Details)Apr 9 2019, 1:26 PM
whitequark added inline comments.Apr 9 2019, 2:51 PM
llvm/include/llvm-c/DebugInfo.h
1206 ↗(On Diff #194387)

What does "consumed" mean here exactly? Aren't metadata owned by the context anyway?

CodaFi marked an inline comment as done.Apr 9 2019, 2:59 PM
CodaFi added inline comments.
llvm/include/llvm-c/DebugInfo.h
1206 ↗(On Diff #194387)

Whoops, I read the std::move in the accessor and figured it would steal the data from the tracking ref. But it appears that is not the case. I'll update this.

CodaFi updated this revision to Diff 194405.Apr 9 2019, 3:00 PM
This revision is now accepted and ready to land.Apr 9 2019, 3:10 PM
This revision was automatically updated to reflect the committed changes.