Open xuzhaoch opened 4 months ago
Unfortunately this isn't supported and you will have to parse the file manually.
Unfortunately this isn't supported and you will have to parse the file manually.
If using llvmlite.binding.parse_bitcode to parse the bc file, can I get these metadata lines? Or the only way is to read the ll file and use regex to extract the corresponding content?
Unfortunately this isn't supported and you will have to parse the file manually.
If using llvmlite.binding.parse_bitcode to parse the bc file, can I get these metadata lines? Or the only way is to read the ll file and use regex to extract the corresponding content?
Looking at:
my guess is that the data you are looking for will not be part of the returned ModuleRef
. So yes, as far as I can tell, you'll need to use regular expressions.
My interpretation of this request is that we could support this by wrapping the getDebugLoc()
function (and similar / related APIs as necessary).
I don't think there's availability for anyone to pick this up right now, but I think a contribution that implements support for the required APIs could be considered. However, to provide appropriate expectations: any PR that we could practically review would have to be fairly complete - i.e. include appropriate tests and documentation, and for the changes to be in keeping with the existing codebase - I don't think we have the bandwidth to guide / mentor the development of such a contribution.
Feature request
I am using IR files to construct data flow for some specific static code check. llvmlite helps me to convert ir file to the data which I can use directly. And I also noticed that at the end of the ir file, there are metadata for every instructions, which can offer the source code location. Is there any function or interface in the llvmlite, that can give the source code location of every instruction?