Hi, I am trying to write a module pass that traverses through named structure types defined and modifies the type of certain fields in these named types. Is there any simple way of doing this? I am not quite sure how to get the LLVMContext's pImpl working from a pass since LLVMContextImpl is forward-declared. Thanks, Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120814/48575773/attachment.html>
On Tue, Aug 14, 2012 at 1:23 PM, Joe Yan <jyan2 at umd.edu> wrote:> Hi, > > I am trying to write a module pass that traverses through named structure > types defined and modifies the type of certain fields in these named types. > Is there any simple way of doing this? I am not quite sure how to get the > LLVMContext's pImpl working from a pass since LLVMContextImpl is > forward-declared.Mutating types is unsupported, and generally a bad idea. Make a new named type, then replace all the values which use that type with values which use the new type. -Eli
Is there a way of iterating through all the named types, or do I instead need to make new named types as I encounter them? On Tue, Aug 14, 2012 at 4:58 PM, Eli Friedman <eli.friedman at gmail.com>wrote:> On Tue, Aug 14, 2012 at 1:23 PM, Joe Yan <jyan2 at umd.edu> wrote: > > Hi, > > > > I am trying to write a module pass that traverses through named structure > > types defined and modifies the type of certain fields in these named > types. > > Is there any simple way of doing this? I am not quite sure how to get the > > LLVMContext's pImpl working from a pass since LLVMContextImpl is > > forward-declared. > > Mutating types is unsupported, and generally a bad idea. Make a new > named type, then replace all the values which use that type with > values which use the new type. > > -Eli >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120815/8b45f191/attachment.html>