forked from OSchip/llvm-project
[llvm-c] Document that LLVMGetElementType on pointers is deprecated (NFC)
We can't actually deprecate the function, because it is also used for arrays and vectors, so we can only document this.
This commit is contained in:
parent
a7802a806d
commit
dcc4b94d94
|
@ -1391,9 +1391,9 @@ LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy);
|
|||
*/
|
||||
|
||||
/**
|
||||
* Obtain the type of elements within a sequential type.
|
||||
* Obtain the element type of an array or vector type.
|
||||
*
|
||||
* This works on array, vector, and pointer types.
|
||||
* This currently also works for pointer types, but this usage is deprecated.
|
||||
*
|
||||
* @see llvm::SequentialType::getElementType()
|
||||
*/
|
||||
|
|
|
@ -798,7 +798,7 @@ LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType,
|
|||
LLVMTypeRef LLVMGetElementType(LLVMTypeRef WrappedTy) {
|
||||
auto *Ty = unwrap<Type>(WrappedTy);
|
||||
if (auto *PTy = dyn_cast<PointerType>(Ty))
|
||||
return wrap(PTy->getPointerElementType());
|
||||
return wrap(PTy->getNonOpaquePointerElementType());
|
||||
if (auto *ATy = dyn_cast<ArrayType>(Ty))
|
||||
return wrap(ATy->getElementType());
|
||||
return wrap(cast<VectorType>(Ty)->getElementType());
|
||||
|
|
Loading…
Reference in New Issue