Closed langston-barrett closed 5 years ago
I think I like the latter approach a little better, as it keeps the value you would be working with (DIFile
) a bit closer to what you'd see in the LLVM textual source.
@elliottt Thanks for the feedback!
It seems the current behavior of both llvm-pretty
and llvm-pretty-bc-parser
is correct; since posting this, the parser moved to the fromMaybe
solution: https://github.com/GaloisInc/llvm-pretty-bc-parser/blob/master/src/Data/LLVM/BitCode/IR/Metadata.hs#L175
Currently,
llvm-pretty
requires that theDirectory
andFile
arguments ofDIFile
be non-null:However, in several LLVM test cases, one or both of these are
""
, which leads the parser to be unable to parse these when they are assembled withllvm-as
.Should we consider making these both
Maybe
s? Or is the correct behavior of the parser to do something like this:here: https://github.com/GaloisInc/llvm-pretty-bc-parser/blob/master/src/Data/LLVM/BitCode/IR/Metadata.hs#L442?
Let me know what you think @elliottt