Skip to content
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

EncodeException "The serialized GlobalReference has type PointerType ... #15

Closed
nwtgck opened this issue Feb 7, 2018 · 2 comments
Closed

Comments

@nwtgck
Copy link
Contributor

nwtgck commented Feb 7, 2018

Hi, developers of llvm-hs-quote.

Environment

llvm-hs-quote: e2dec47
stack solver: lts-10.3 (this is the same as llvm-hs-quote)

Error

I had a error with the following code.

module10 :: AST.Module
module10 = [Quote.LLVM.llmod|
  define void @f() {
  entry:
    call void @g()
    ret void
  }
  define void @g() {
  entry:
    ret void
  }
|]

toLLVM :: AST.Module -> IO ()
toLLVM mod = Context.withContext $ \ctx -> do
  llvm <- Module.withModuleFromAST ctx mod Module.moduleLLVMAssembly
  BS.putStrLn llvm

main = toLLVM module10

I think the error occurs in call void @g().

Error message

 EncodeException "The serialized GlobalReference has type PointerType {pointerReferent = FunctionType {resultType = VoidType, argumentTypes = [], isVarArg = False}, pointerAddrSpace = AddrSpace 0} but should have type FunctionType {resultType = VoidType, argumentTypes = [], isVarArg = False}"
@cocreature
Copy link
Member

Should be fixed in 1497273

@nwtgck
Copy link
Contributor Author

nwtgck commented Feb 8, 2018

Thank you very much for your quick fixing! You solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants