diff options
author | Nikita Popov <npopov@redhat.com> | 2022-06-23 11:44:20 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-06-23 14:50:54 +0200 |
commit | da34966a5a5fea47e3381707f26b3c24a6973569 (patch) | |
tree | 47da9df5196d1183b7172b92b70a1ce39875e93d /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 0eb17a9d8672c3503c76a808b0773235b042f5a9 (diff) | |
download | llvm-da34966a5a5fea47e3381707f26b3c24a6973569.zip llvm-da34966a5a5fea47e3381707f26b3c24a6973569.tar.gz llvm-da34966a5a5fea47e3381707f26b3c24a6973569.tar.bz2 |
[llvm-c] Add LLVMGetAggregateElement() function
This adds LLVMGetAggregateElement() as a wrapper for
Constant::getAggregateElement(), which allows fetching a
struct/array/vector element without handling different possible
underlying representations.
As the changed echo test shows, previously you for example had to
treat ConstantArray (use LLVMGetOperand) and ConstantDataArray
(use LLVMGetElementAsConstant) separately, not to mention all the
other possible representations (like PoisonValue).
I've deprecated LLVMGetElementAsConstant() in favor of the new
function, which is strictly more powerful (but I could be convinced
to drop the deprecation).
This is partly motivated by https://reviews.llvm.org/D125795,
which drops LLVMConstExtractValue() because the underlying constant
expression no longer exists. This function could previously be used
as a poor man's getAggregateElement().
Differential Revision: https://reviews.llvm.org/D128417
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions