From cb3580e7ad247dfdcf2ad279895f52bb73c4cee4 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Tue, 29 Jun 2021 11:38:18 -0700 Subject: [OpaquePtr][BitcodeWriter] Handle attributes with types For example, byval. Skip the type attribute auto-upgrade if we already have the type. I've actually seen this error of the ValueEnumerator missing a type attribute's type in a non-opaque pointer context. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D105138 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 8f8bd73..854243e 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -3333,6 +3333,9 @@ Error BitcodeReader::parseFunctionRecord(ArrayRef Record) { if (!Func->hasParamAttribute(i, Kind)) continue; + if (Func->getParamAttribute(i, Kind).getValueAsType()) + continue; + Func->removeParamAttr(i, Kind); Type *PTy = cast(FTy)->getParamType(i); -- cgit v1.1