構建LLVM時,必須在配置期間啓用LLVM C++後端。它在默認情況下在
configure
(autotools)構建中啓用,但在Windows上構建時不在CMake構建中。您可以通過在使用CMake進行配置時設置適當的標誌來啓用它。有關更多信息,請參閱
this page。
報價:
LLVM_TARGETS_TO_BUILD:目標STRING 分號分隔的列表來構建,或者全部建築物的所有目標。區分大小寫。對於Visual C++,默認爲X86。在 其他情況下默認爲全部。示例: -DLLVM_TARGETS_TO_BUILD =「X86; PowerPC」。
UPDATE
由於version 3.9
的CppBackend不再是一個有效的目標。由於生成的代碼呈現幾個問題,他們已從代碼中刪除。
Check this commit
Remove bit-rotten CppBackend.
This backend was supposed to generate C++ code which will re-construct
the LLVM IR passed as input. This seems to me to have very marginal
usefulness in the first place.
However, the code has never been updated to use IRBuilder, which makes
its current value negative -- people who look at the output may be
steered to use the *wrong* C++ APIs to construct IR.
Furthermore, it's generated code that doesn't compile since at least
2013.
Differential Revision: http://reviews.llvm.org/D19942
git-svn-id: https://llvm.org/svn/llvm-project/llvm/[email protected] 91177308-0d34-0410-b5e6-96231b3b80d8
是否將'llc -version' list'cpp'列爲有效的後端目標? – Necrolis
llc -version不會在列表中顯示cpp。它需要任何註冊或包含cpp的東西,或者什麼? – MetallicPriest
@MetallicPriest我想他們只是不啓用它的在線演示(這不是真的是人們感興趣的,我猜)爲什麼你不在本地系統上安裝LLVM? – us2012