llvm::Value::hasOneUser

Return true if there is exactly one user of this value.

Synopsis

Declared in <llvm/IR/Value.h>

bool
hasOneUser() const;

Description

Note that this is not the same as "has one use". If a value has one use, then there certainly is a single user. But if value has several uses, it is possible that all uses are in a single user, or not.

This check is potentially costly, since it requires traversing, in the worst case, the whole use list of a value.

Return Value

True if there is exactly one user.