Value* value = getValue(); value = value->stripPointerCasts();
Value* value = getValue(); if (auto* ptr = dyn_castIn this example, we check if the value is a pointer to a function. If it is, we remove any pointer casts and then use the resulting function in further processing. Overall, the stripPointerCasts function is a useful way to work with values without worrying about pointer casts. It's part of the LLVM package library, which is a collection of libraries and tools for working with low-level code.(value->getType())) { auto* elemType = ptr->getElementType(); if (elemType->isFunctionTy()) { value = value->stripPointerCasts(); Function* func = dyn_cast (value); // Use the function... } }