How can I code generate unused declarations with Clang?

你。 提交于 2019-12-21 20:37:00

问题


I'm looking to code generate an llvm::Module from some C++ code.

Specifically, I will be mixing code generated by Clang and code from another source. Unfortunately, Clang's CodeGenModule class appears to insist on only generating a declaration into the Module if there is a definition which uses it.

How can I convince the CodeGenModule to generate these declarations anyway?


回答1:


Apparently, -femit-all-decls does not actually emit all the decls, so I had to modify Clang's source code to actually emit all the decls.



来源:https://stackoverflow.com/questions/14032496/how-can-i-code-generate-unused-declarations-with-clang

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!