在构建 LLVM 时,必须在配置期间启用 LLVM C++ 后端。它在configure
(autotools) 构建中默认启用,但在 Windows 上构建时不会在 CMake 构建中启用。您可以通过在使用 CMake 进行配置时设置适当的标志来启用它。请参阅此页面了解更多信息。
引用:
LLVM_TARGETS_TO_BUILD:STRING
以分号分隔的要构建的目标列表,或 all 用于构建所有目标。区分大小写。对于 Visual C++,默认为 X86。在其他情况下,默认为全部。示例:-DLLVM_TARGETS_TO_BUILD="X86;PowerPC"。
更新
由于version 3.9
CppBackend 不再是有效目标。他们已从代码中删除,因为生成的代码存在一些问题。
检查这个提交
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/trunk@268631 91177308-0d34-0410-b5e6-96231b3b80d8