原生目标数据
在 llvm 的 doxygen 参考手册中,您可以从模块对象或执行引擎创建目标数据实例。
如何获取当前/原生平台的目标数据?
In the doxygen reference manual for llvm you can create a target data instance from a Module object or execution engine.
How do I get the target data for the current/native platform?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯...通常要添加到 TargetData 的信息可以从平台 ABI 文档中提取。这是指定所有自然尺寸、对齐方式等的地方。有时,如果您有适合您平台的编译器,您可以尝试将所有条目与您的编译器相匹配。
我相信在后一种情况下,可以编写一些二进制文件来为您生成 TargetData 信息,但在 iirc 之前没有人这样做过。
Well... usually the information to be added to TargetData can be extracted from the platform ABI document. This is where all natural sizes, alignments, etc. are specified. Sometimes if you have a compiler for your platform you can try to match all entries with your compiler.
I believe in the latter case it is possible to write some binary which will generate the TargetData info for you but noone did this before iirc.