privatize fields in attrs classes
MODIFY
ir/attrs.h
ir/attrs.h
namespace IR {
class ParamAttrs final {
+ unsigned bits;
+
public:
enum Attribute { None = 0, NonNull = 1<<0, ByVal = 1<<1, NoCapture = 1<<2,
ReadOnly = 1<<3, ReadNone = 1<<4 };
- unsigned bits;
-
ParamAttrs(unsigned bits = None) : bits(bits) {}
bool has(Attribute a) const { return (bits & a) != 0; }
@@ -24,12 +24,12 @@ public:
class FnAttrs final {
+ unsigned bits;
+
public:
enum Attribute { None = 0, NoRead = 1 << 0, NoWrite = 1 << 1,
ArgMemOnly = 1 << 2, NNaN = 1 << 3, NoReturn = 1 << 4 };
- unsigned bits;
-
FnAttrs(unsigned bits = None) : bits(bits) {}
bool has(Attribute a) const { return (bits & a) != 0; }

privatize fields in attrs classes