Check pointer for pointer type in LLVM

How to check operand pointer to pointer enter LLVM ? We can check the pointer to the operand or not, but how to check if it points to the pointer? I use Clang to generate intermediate code and use C++ for the source file.

+4
source share
1 answer

You can call Type::getContainedType(int) to access the destination type. Therefore, it should look like this:

 bool isPointerToPointer(const Value* V) { const Type* T = V->getType(); return T->isPointerTy() && T->getContainedType(0)->isPointerTy(); } 
+8
source

Source: https://habr.com/ru/post/1439610/


All Articles