LLVM is moving to a model where all pointer types in IR are opaque (https://llvm.org/docs/OpaquePointers.html) this is currently enabled-by-default for LLVM 16 and will be required for LLVM 17.
This change moves cbe to support and use opaque pointers:
Where we have an instruction that has a helper to get the type of an operand (e.g., Value::getValueType) use that helper instead of getType()->getNonOpaquePointerElementType().
Always emit void* for pointers
Use a new type FunctionInfoVariant (which is a variant of Function and CallInst) instead of FunctionType for generating function declarations and prototypes, as this maintains information about struct return types, by-val param types, etc.
Disable using opaque pointers in the test.
When checking for an "address exposed value" also get its real type so that we can cast it correctly.
Remove TopoligicalSorter: function declarations will not use void* for function pointers, thus it doesn't matter the order that we emit them in.
isStandardMain can only check that the char ** parameter corresponds to a pointer parameter, rather than an actual char **.
printGEPExpression and writeMemoryAccess will cast the pointer operand to the appropriate type.
Cleanup printGEPExpression to remove "last index is vector" workaround.
LLVM is moving to a model where all pointer types in IR are opaque (https://llvm.org/docs/OpaquePointers.html) this is currently enabled-by-default for LLVM 16 and will be required for LLVM 17.
This change moves cbe to support and use opaque pointers:
Value::getValueType
) use that helper instead ofgetType()->getNonOpaquePointerElementType()
.void*
for pointersFunctionInfoVariant
(which is a variant ofFunction
andCallInst
) instead ofFunctionType
for generating function declarations and prototypes, as this maintains information about struct return types, by-val param types, etc.TopoligicalSorter
: function declarations will not usevoid*
for function pointers, thus it doesn't matter the order that we emit them in.isStandardMain
can only check that thechar **
parameter corresponds to a pointer parameter, rather than an actualchar **
.printGEPExpression
andwriteMemoryAccess
will cast the pointer operand to the appropriate type.printGEPExpression
to remove "last index is vector" workaround.Fixes #154