[PATCH] D105138: [OpaquePtr][BitcodeWriter] Handle attributes with types
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 29 11:51:26 PDT 2021
aeubanks updated this revision to Diff 355314.
aeubanks added a comment.
use better check
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105138/new/
https://reviews.llvm.org/D105138
Files:
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
llvm/test/Assembler/opaque-ptr.ll
Index: llvm/test/Assembler/opaque-ptr.ll
===================================================================
--- llvm/test/Assembler/opaque-ptr.ll
+++ llvm/test/Assembler/opaque-ptr.ll
@@ -134,3 +134,8 @@
cleanup
ret void
}
+
+; CHECK: define void @byval(ptr byval({ i32, i32 }) %0)
+define void @byval(ptr byval({ i32, i32 }) %0) {
+ ret void
+}
Index: llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
===================================================================
--- llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -1046,6 +1046,10 @@
AttributeGroups.push_back(Pair);
Entry = AttributeGroups.size();
}
+ for (Attribute Attr : AS) {
+ if (Attr.isTypeAttribute())
+ EnumerateType(Attr.getValueAsType());
+ }
}
}
Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp
===================================================================
--- llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -3333,6 +3333,9 @@
if (!Func->hasParamAttribute(i, Kind))
continue;
+ if (Func->getParamAttribute(i, Kind).getValueAsType())
+ continue;
+
Func->removeParamAttr(i, Kind);
Type *PTy = cast<FunctionType>(FTy)->getParamType(i);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105138.355314.patch
Type: text/x-patch
Size: 1296 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210629/53f70ad2/attachment.bin>
More information about the llvm-commits
mailing list