[PATCH] D74202: [DebugInfo][test] Replace pre-canned binary test

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 9 17:57:33 PST 2020


MaskRay accepted this revision.
MaskRay added inline comments.


================
Comment at: llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp:124
+using ParamType =
+    std::tuple<Form, uint16_t, uint8_t, DwarfFormat, StringRef, uint32_t, bool>;
+
----------------
`StringRef -> ArrayRef<uint8_t>`


================
Comment at: llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp:137
+                 ", DwarfFormat = " + std::to_string(Dwarf));
+    std::vector<char> Buf(InitialData.data(),
+                          InitialData.data() + InitialData.size());
----------------
vector<uint8_t>


================
Comment at: llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp:144
+    Buf.resize(ExpectedSkipped + 1);
+    DWARFDataExtractor Data(StringRef(Buf.data(), Buf.size()),
+                            sys::IsLittleEndianHost, AddrSize);
----------------
The StringRef conversion can be removed.


================
Comment at: llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp:163
+const uint8_t LEBData[] = {0x80, 0x1};
+StringRef SampleLEB(reinterpret_cast<const char *>(LEBData), sizeof(LEBData));
+const uint32_t SampleLength = 0x80;
----------------
Use `ArrayRef<uint8_t>` instead of `StringRef`.

There is now a DWARFDataExtractor constructor which takes `ArrayRef<uint8_t>` instead of `StringRef`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74202/new/

https://reviews.llvm.org/D74202





More information about the llvm-commits mailing list