1.4K Star 7.6K Fork 1.4K

GVP方舟编译器 / OpenArkCompiler

 / 详情

Seperate attributes by purpose

已完成
成员
创建于  
2021-08-23 10:27

Currently we maintain all attributes in the same list (function, field, attr,GenericAttrKind).
We are running out of the bits so should we consider seperate them by purpose?
To be more specific,why do we need GenericAttrKind?

enum AttrKind : unsigned {
#define TYPE_ATTR
#define ATTR(STR) ATTR_##STR,
#include "all_attributes.def"
#undef ATTR
#undef TYPE_ATTR
};


enum FieldAttrKind {
#define FIELD_ATTR
#define ATTR(STR) FLDATTR_##STR,
#include "all_attributes.def"
#undef ATTR
#undef FIELD_ATTR
};

enum FuncAttrKind : unsigned {
#define FUNC_ATTR
#define ATTR(STR) FUNCATTR_##STR,
#include "all_attributes.def"
#undef ATTR
#undef FUNC_ATTR
};


// only for internal use, not emitted
enum GenericAttrKind {
#define FUNC_ATTR
#define TYPE_ATTR
#define FIELD_ATTR
#define ATTR(STR) GENATTR_##STR,
#include "all_attributes.def"
#undef ATTR
#undef FUNC_ATTR
#undef TYPE_ATTR
#undef FIELD_ATTR
};


评论 (4)

yi_jiang 创建了任务
yi_jiang 负责人设置为fredchow
yi_jiang 修改了描述
展开全部操作日志

I did not know anything about GenericAttrKind and why or who introduced it. But on a grep, I think it is OK to remove it. It is only used by class GenericAttrs, and this class defines some member functions, but nobody uses GenericAttrs at all.

GenericAttrKind is used by frontend, please check dex2mpl. during parsing, we record all attributes to be generic ones first then check whether it is for type, function or fields and convert to specific kinds

In class GenericAttrs:

private:
  uint64 attrFlag = 0;

Just make this field larger than 64 bits, since this is the only field that needs more than 64 attributes.

Since this issue can be solved by dex2mpl, it is no longer a general issue.

fredchow 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(3)
5275110 hu   wen 1581627339
C++
1
https://gitee.com/openarkcompiler/OpenArkCompiler.git
git@gitee.com:openarkcompiler/OpenArkCompiler.git
openarkcompiler
OpenArkCompiler
OpenArkCompiler

搜索帮助