[PATCH] D14687: Macro support in LLVM IR

Amjad Aboud via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 03:52:48 PST 2015


aaboud added a comment.

In http://reviews.llvm.org/D14687#289729, @dexonsmith wrote:

> This seems to be missing any changes to LangRef.


If I understood you correctly, you are referring to IR documentation that I forgot to update according to these changes, right?

> Do we really need to add a new field to DICompileUnit?  Why would the compile unit need to reference all the macros?


If not in the DICompileUnit then where do you suggest the macro tree be referred from? its own named metadata?
According to dwarf, macro in ".debug_macinfo" section is referenced from compile-unit DIE (DW_TAG_compile_unit) using the DW_AT_macro_info attribute.

> I don't understand why you need `MacroNode` separate from `DIMacro`.  `DIMacro` seems to be the only subclass, so why split it?  Also, is `MacroNode` meant for something other than debug info?  If it's for debug info, it should have a `DI`-prefix.  It should also inherit from `DINode`.


At first I wanted to use DINode as the subclass for both DIMacro and DIMacroFile, however, DINode assumes a DW_TAG_* enumerator while the macro is using different enumerator  DW_MACINFO_*. For the same reason, the MacroNode cannot inherit from DINode.
Also, DIMacro cannot be the base class as it is different than DIMacroFile, and both needs a base class.
Regarding the name of MacroNode, I am fine with any name you pick, does DIMacroNode sound better?


Repository:
  rL LLVM

http://reviews.llvm.org/D14687





More information about the llvm-commits mailing list