summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/DebugInfo/BTF/BTFParser.h2
-rw-r--r--llvm/lib/DebugInfo/BTF/BTFParser.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/llvm/include/llvm/DebugInfo/BTF/BTFParser.h b/llvm/include/llvm/DebugInfo/BTF/BTFParser.h
index f8b5b29738b3..32644e6700e7 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<uint8_t> TypesBuffer;
+ std::vector<uint8_t> 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 4fc31a445603..971a0d9f0176 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<uint8_t>(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<uint8_t>();
+ TypesBuffer.clear();
ParseContext Ctx(Obj, Opts);
std::optional<SectionRef> BTF;