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

Method mkInput

ir/memory.cpp:1729–1754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1727}
1728
1729expr Memory::mkInput(const char *name, const ParamAttrs &attrs0) {
1730 unsigned max_bid = has_null_block + num_globals_src + next_ptr_input++;
1731 assert(max_bid < num_nonlocals_src);
1732
1733 // FIXME: doesn't consider physical ptrs
1734 // consider how to do POR?
1735
1736 auto attrs = attrs0;
1737 attrs.set(ParamAttrs::IsArg);
1738 Pointer p(*this, name, attrs);
1739 auto bid = p.getShortBid();
1740
1741 state->addAxiom(bid.ule(max_bid));
1742 state->addAxiom(!Pointer(*this, max_bid, false).isStackAllocated(false));
1743
1744 AliasSet alias(*this);
1745 alias.setMayAliasUpTo(false, max_bid);
1746
1747 for (auto [byval_bid, is_const] : byval_blks) {
1748 state->addAxiom(bid != byval_bid);
1749 alias.setNoAlias(false, byval_bid);
1750 }
1751 ptr_alias.emplace(p.getBid(), std::move(alias));
1752
1753 return std::move(p).release();
1754}
1755
1756pair<expr, expr> Memory::mkUndefInput(const ParamAttrs &attrs0) {
1757 unsigned bits = bits_for_offset + bits_for_bid - Pointer::hasLocalBit();

Callers

nothing calls this directly

Calls 10

PointerClass · 0.85
getShortBidMethod · 0.80
addAxiomMethod · 0.80
uleMethod · 0.80
isStackAllocatedMethod · 0.80
setMayAliasUpToMethod · 0.80
setNoAliasMethod · 0.80
getBidMethod · 0.80
releaseMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected