-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give call
/callbr
function types instead of pointer types
#207
Conversation
There are a handful of places in `crucible-llvm` where we assume that the `Call` and `CallBr` instructions have pointer types. As noted in GaloisInc/llvm-pretty-bc-parser#189, however, this is subtly incorrect. This patch: * Bumps the `llvm-pretty-bc-parser` submodule to bring in the changes from GaloisInc/llvm-pretty-bc-parser#207, which corrects this mistake, and * Changes the parts of `crucible-llvm` that match on pointer type to no longer do so.
There are a handful of places in `crucible-llvm` where we assume that the `Call` and `CallBr` instructions have pointer types. As noted in GaloisInc/llvm-pretty-bc-parser#189, however, this is subtly incorrect. This patch: * Bumps the `llvm-pretty-bc-parser` submodule to bring in the changes from GaloisInc/llvm-pretty-bc-parser#207, which corrects this mistake. * Bumps the `llvm-pretty` submodule to be in tandem with `llvm-pretty-bc-parser`. * Changes the parts of `crucible-llvm` that match on pointer type to no longer do so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm aligned with the changes, but is there a way to add a test to at least validate the parse/print round-trip is valid (and agrees with llvm-dis
)?
I'm glad you prompted me to look, because it turns out that ppCallSym :: LLVM => Type -> Value -> Doc
ppCallSym (PtrTo (FunTy res args va)) val = ppType res <+> ppArgList va (map ppType args) <+> ppValue val
ppCallSym ty val = ppType ty <+> ppValue val We shouldn't be using |
I have submitted GaloisInc/llvm-pretty#104 with the necessary changes to support pretty-printing Because bumping the |
I've added a (Note that I haven't yet added a test case that uses opaque pointers, as I will do that in a separate patch.) |
There are a handful of places in `crucible-llvm` where we assume that the `Call` and `CallBr` instructions have pointer types. As noted in GaloisInc/llvm-pretty-bc-parser#189, however, this is subtly incorrect. This patch: * Bumps the `llvm-pretty-bc-parser` submodule to bring in the changes from GaloisInc/llvm-pretty-bc-parser#207, which corrects this mistake. * Bumps the `llvm-pretty` submodule to be in tandem with `llvm-pretty-bc-parser`. Note that because this brings in the changes from GaloisInc/llvm-pretty#104, I opted to explicitly disallow LLVM's opaque pointers in `crucible-llvm` for now, but this is something that will likely change in subsequent patches. * Changes the parts of `crucible-llvm` that match on pointer types to no longer do so.
See
Note [Typing function applications]
for the rationale.This fixes #189. This is also an important step towards being able to support opaque pointers, as described in #177.