【问题标题】:Obtaining specialized method bodies from ClassTemplateSpecializationDecl?从 ClassTemplateSpecializationDecl 中获取专门的方法体?
【发布时间】:2021-02-20 19:22:02
【问题描述】:

如果是实例化模板,则在转储方法时,我会看到方法主体:

CXXConstructorDecl 0x72ecf50 <./image/operators.h:52:3> col:3 used Sawtooth 'void (unsigned char, unsigned char, unsigned char, unsigned int)'
|-ParmVarDecl 0x72ecc90 <col:12, col:14> col:14 start 'unsigned char':'unsigned char'
|-ParmVarDecl 0x72ecd00 <col:21, col:23> col:23 end 'unsigned char':'unsigned char'
|-ParmVarDecl 0x72ecd70 <col:28, col:30> col:30 step 'unsigned char':'unsigned char'
`-ParmVarDecl 0x72ecdd0 <col:36, col:45> col:45 interval 'unsigned int'

有没有办法获得专门的身体?

【问题讨论】:

    标签: clang llvm clang++


    【解决方案1】:

    我解决了这个问题;我的ASTConsumerHandleTopLevelDecl 中做它的事情,这显然是一件坏事。您需要从HandleTranslationUnit 进行处理。我没有深入研究源代码,但我认为前者必须在早期调用,后者在前端处理完成时调用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-31
      • 1970-01-01
      • 2013-04-09
      • 1970-01-01
      • 2017-07-02
      • 2016-01-02
      • 1970-01-01
      相关资源
      最近更新 更多