MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / attr_to_bitvec

Function attr_to_bitvec

ir/pointer.cpp:53–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53static expr attr_to_bitvec(const ParamAttrs &attrs) {
54 if (!bits_for_ptrattrs)
55 return {};
56
57 uint64_t bits = 0;
58 auto idx = 0;
59 auto add = [&](bool b, const ParamAttrs::Attribute &a) {
60 bits |= b ? (attrs.has(a) << idx++) : 0;
61 };
62 add(has_nocapture, ParamAttrs::NoCapture);
63 add(has_noread, ParamAttrs::NoRead);
64 add(has_nowrite, ParamAttrs::NoWrite);
65 add(has_ptr_arg, ParamAttrs::IsArg);
66 return expr::mkUInt(bits, bits_for_ptrattrs);
67}
68
69namespace IR {
70

Callers 2

PointerMethod · 0.85
setAttrsMethod · 0.85

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected