什么是LLVM元数据 [英] What is LLVM metadata

查看:328
本文介绍了什么是LLVM元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些可能是非常基本的问题.

These might be very basic questions..

1)什么是LLVM元数据?如何在程序中使用它?我已经阅读了所有文档,但是我不知道如何使用它.

1) What is LLVM metadata and how do I use it in my program? I've read all the documentation, but I don't understand how to use it.

2)如何在文件中添加个人元数据?

2) How to I add my personal metadata in a file?

提前谢谢!

推荐答案

最好的信息来源是2010年的博客文章,该文章将元数据引入了LLVM IR-

The best source of information would be the blog post from 2010 that introduced metadata into LLVM IR - Extensible Metadata in LLVM IR. The first paragraph mentions the motivation:

此元数据可用于影响特定语言 优化过程(例如,C中基于类型的别名分析),标记 定制代码生成器的信息,或传递信息 链接时间优化.

This metadata could be used to influence language-specific optimization passes (for example, Type Based Alias Analysis in C), tag information for a custom code generator, or pass through information to link time optimization.

但实际上,请阅读所有if的历史细节.

But reall, read all of if for the historical details.

LLVM中元数据的主要客户端"当前为调试信息.前端(例如Clang)使用它来标记它生成的LLVM IR,并带有将IR与它来自的源代码相关联的调试信息.稍后,代码发射器会将相同的元数据转换为平台特定的调试信息,例如DWARF.

The main "client" of metadata in LLVM is currently debug info. It's used by the front-end (e.g. Clang) to tag the LLVM IR it generates with debug information that correlates IR to the source code it came from. This same metadata is later translated to platform specific debug info such as DWARF by the code emitters.

这篇关于什么是LLVM元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆