diff --git a/llvm/include/llvm/DebugInfo/BTF/BTFParser.h b/llvm/include/llvm/DebugInfo/BTF/BTFParser.h index f8b5b29738b3f..32644e6700e78 100644 --- a/llvm/include/llvm/DebugInfo/BTF/BTFParser.h +++ b/llvm/include/llvm/DebugInfo/BTF/BTFParser.h @@ -46,7 +46,7 @@ class BTFParser { // A copy of types table from the object file but using native byte // order. Should not be too big in practice, e.g. for ~250MiB vmlinux // image it is ~4MiB. - OwningArrayRef TypesBuffer; + std::vector TypesBuffer; // Maps ELF section number to instruction line number information. // Each BTFLinesVector is sorted by `InsnOffset` to allow fast lookups. diff --git a/llvm/lib/DebugInfo/BTF/BTFParser.cpp b/llvm/lib/DebugInfo/BTF/BTFParser.cpp index 4fc31a4456031..971a0d9f01769 100644 --- a/llvm/lib/DebugInfo/BTF/BTFParser.cpp +++ b/llvm/lib/DebugInfo/BTF/BTFParser.cpp @@ -206,7 +206,8 @@ Error BTFParser::parseTypesInfo(ParseContext &Ctx, uint64_t TypesInfoStart, StringRef RawData) { using support::endian::byte_swap; - TypesBuffer = OwningArrayRef(arrayRefFromStringRef(RawData)); + auto RawDataAsBytes = arrayRefFromStringRef(RawData); + TypesBuffer.assign(RawDataAsBytes.begin(), RawDataAsBytes.end()); // Switch endianness if necessary. endianness Endianness = Ctx.Obj.isLittleEndian() ? llvm::endianness::little : llvm::endianness::big; @@ -380,7 +381,7 @@ Error BTFParser::parse(const ObjectFile &Obj, const ParseOptions &Opts) { SectionLines.clear(); SectionRelocs.clear(); Types.clear(); - TypesBuffer = OwningArrayRef(); + TypesBuffer.clear(); ParseContext Ctx(Obj, Opts); std::optional BTF;