aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-07-04 15:52:20 +0200
committerNikita Popov <nikita.ppv@gmail.com>2021-07-15 18:04:25 +0200
commit1fd23a065bf729836dd52ef1ad3c84c449735a56 (patch)
tree86a863d9337cec4510c163fe6580257fc4c257b7 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent04b75c05b033d5c7fd503de90b257be713c95e00 (diff)
downloadllvm-1fd23a065bf729836dd52ef1ad3c84c449735a56.zip
llvm-1fd23a065bf729836dd52ef1ad3c84c449735a56.tar.gz
llvm-1fd23a065bf729836dd52ef1ad3c84c449735a56.tar.bz2
[LangRef] Add elementtype attribute
This adds an elementtype(<ty>) attribute, which can be used to attach an element type to a pointer typed argument. It is similar to byval/byref in purpose, but unlike those does not carry any specific semantics by itself. However, certain intrinsics may require it and interpret it in specific ways. The in-tree use cases for this that I'm currently aware of are: call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype(%ty) %base, i32 %dim, i32 %index) call ptr @llvm.preserve.struct.access.index.p0.p0(ptr elementtype(%ty) %base, i32 %gep_index, i32 %di_index) call token @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @foo, i32 0, i32 0, i32 0, i32 0, ptr addrspace(1) %obj) Notably, the gc.statepoint case needs a function as element type, in which case the workaround of adding a separate %ty undef argument would not work, as arguments cannot be unsized. Differential Revision: https://reviews.llvm.org/D105407
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions