This is an archive of the discontinued LLVM Phabricator instance.

[LLVM-C] Add Accessors For A Module's Source File Name
ClosedPublic

Authored by CodaFi on Jan 27 2018, 5:06 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

CodaFi created this revision.Jan 27 2018, 5:06 PM
whitequark added inline comments.Jan 28 2018, 6:00 AM
lib/IR/Core.cpp
240

Shouldn't the result be returned in a newly allocated buffer here?

CodaFi added inline comments.Jan 28 2018, 10:47 AM
lib/IR/Core.cpp
240

The lifetime of the string for the source file name is tied to the module itself - just like the string for the module identifier. Non-owning references seem like the norm in the wrappers.

whitequark accepted this revision.Jan 28 2018, 11:39 AM
This revision is now accepted and ready to land.Jan 28 2018, 11:39 AM
deadalnix added inline comments.Jan 29 2018, 4:00 AM
tools/llvm-c-test/echo.cpp
938

There should be some module that actually check this code ran properly by having a filename defined in there.

CodaFi updated this revision to Diff 131804.Jan 29 2018, 7:59 AM

Added source_filename to the echo test

CodaFi marked an inline comment as done.Jan 29 2018, 7:59 AM
This revision was automatically updated to reflect the committed changes.