Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何检查操作数是否pointer to pointer输入LLVM?我们可以检查是否是操作数指针,但如何检查它是否指向指针?我Clang用于生成中间代码并C++用于源文件。
pointer to pointer
LLVM
Clang
C++
您可以调用Type::getContainedType(int)以访问指针类型。所以它应该是这样的:
Type::getContainedType(int)
bool isPointerToPointer(const Value* V) { const Type* T = V->getType(); return T->isPointerTy() && T->getContainedType(0)->isPointerTy(); }