How to check an operand is pointer to pointer type in LLVM? We can check is operand pointer or not, but how to check is it pointing to a pointer? I am using Clang to generate intermediate code and using C++ for source file.
You can invoke Type::getContainedType(int) to get access to the pointee type. So it should look like this:
bool isPointerToPointer(const Value* V) {
    const Type* T = V->getType();
    return T->isPointerTy() && T->getContainedType(0)->isPointerTy();
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With