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

Function has_nullptr

tools/transform.cpp:768–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766}
767
768static bool has_nullptr(const Value *v) {
769 if (dynamic_cast<const NullPointerValue*>(v) ||
770 (dynamic_cast<const UndefValue*>(v) && hasPtr(v->getType())))
771 // undef pointer points to the nullblk
772 return true;
773
774 if (auto agg = dynamic_cast<const AggregateValue*>(v)) {
775 for (auto val : agg->getVals()) {
776 if (has_nullptr(val))
777 return true;
778 }
779 }
780
781 return false;
782}
783
784static unsigned num_ptrs(const Type &ty) {
785 unsigned n = ty.isPtrType();

Callers 1

Calls 1

hasPtrFunction · 0.85

Tested by

no test coverage detected