我正在尝试在this code中重现Haskell编译 与该帖子中的内容相似:
ghc -fllvm quicksort.hs
这是quicksort.hs:
module Test where
quicksort [] = []
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
where
lesser = filter (< p) xs
greater = filter (>= p) xs
但是我收到以下消息:llvm太新了:
[1 of 1] Compiling Test ( quicksort.hs, quicksort.o )
You are using a new version of LLVM that hasn't been tested yet!
We will try though...
opt: /tmp/ghc6115_0/ghc6115_0.ll:12:6: error: unexpected type in metadata definition
!0 = metadata !{metadata !"top"}
^
现在这很奇怪,因为我正在使用llvm 3.8.0。这里发生了什么? 谢谢!