What would be the best way to store custom data with each LLVM instruction node? Say to pass information from one pass to another? It doesn't seem like the instruction class allows users to store arbitrary data?
问问题
133 次
1 回答
0
您可以使用元数据机制将任何数据与每条指令相关联;请参阅有关如何设置元数据的相关问题。
但是,如果您的生产者和消费者都是通行证,则标准方法是让生产者通行证存储此数据,并让消费者通行证使用其方法直接询问生产者通行证。有关如何设置 pass 之间的依赖关系,请参阅此相关文档。
于 2014-07-22T05:09:22.017 回答