1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/unittests
Greg Clayton 89a8c0a52c Clean up DWARFFormValue by reducing duplicated code and removing DWARFFormValue::getFixedFormSizes()
In preparation for a follow on patch that improves DWARF parsing speed, clean up DWARFFormValue so that we have can get the fixed byte size of a form value given a DWARFUnit or given the version, address byte size and dwarf32/64.

This patch cleans up code so that everyone is using one of the new DWARFFormValue functions:

static Optional<uint8_t> DWARFFormValue::getFixedByteSize(dwarf::Form Form, const DWARFUnit *U = nullptr);
static Optional<uint8_t> DWARFFormValue::getFixedByteSize(dwarf::Form Form, uint16_t Version, uint8_t AddrSize, bool Dwarf32);

This patch changes DWARFFormValue::skipValue() to rely on the output of DWARFFormValue::getFixedByteSize(...) instead of duplicating the code in each function. This will reduce the number of changes we need to make to DWARF to fewer places in DWARFFormValue when we add support for new form.

This patch also starts to support DWARF64 so that we can get correct byte sizes for forms that vary according the DWARF 32/64.

To reduce the code duplication a new FormSizeHelper pure virtual class was created that can be created as a FormSizeHelperDWARFUnit when you have a DWARFUnit, or FormSizeHelperManual where you manually specify the DWARF version, address byte size and DWARF32/DWARF64. There is now a single implementation of a function that gets the fixed byte size (instead of two where one took a DWARFUnit and one took the DWARF version, address byte size and DWARFFormat enum) and one function to skip the form values.

https://reviews.llvm.org/D26526

llvm-svn: 286597
2016-11-11 16:21:37 +00:00
..
ADT Add tests for r286139. 2016-11-07 20:40:16 +00:00
Analysis Revert r286437 r286438, they caused PR30976 2016-11-10 17:55:41 +00:00
AsmParser Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
Bitcode Split Bitcode/ReaderWriter.h into separate reader and writer headers 2016-11-11 05:34:58 +00:00
CodeGen GlobalISel: rename legalizer components to match others. 2016-10-14 22:18:18 +00:00
DebugInfo Clean up DWARFFormValue by reducing duplicated code and removing DWARFFormValue::getFixedFormSizes() 2016-11-11 16:21:37 +00:00
ExecutionEngine Fix Clang-tidy readability-redundant-string-cstr warnings 2016-11-02 16:43:50 +00:00
IR Add DWARF debug info support for C++11 inline namespaces. 2016-11-03 19:42:02 +00:00
LineEditor Remove autoconf support 2016-01-26 21:29:08 +00:00
Linker Remangle intrinsics names when types are renamed 2016-06-24 15:10:29 +00:00
MC [ADT] Move CachedHashString to its own header in ADT, and rename to CachedHashStringRef. 2016-10-17 22:24:36 +00:00
MI CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePasses 2016-08-24 01:52:46 +00:00
ObjectYAML Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00
Option Option parser: class for consuming a joined arg in addition to all remaining args 2016-04-15 00:23:30 +00:00
ProfileData [Coverage] Support loading multiple binaries into a CoverageMapping 2016-10-14 17:16:53 +00:00
Support Prevent at compile time converting from Error::success() to Expected<T> 2016-11-11 04:29:25 +00:00
Target Remove a FIXME that I forgot about. NFC. 2016-10-13 05:28:55 +00:00
Transforms [MemorySSA] Tighten up types to make our API prettier. NFC. 2016-11-01 21:17:46 +00:00
CMakeLists.txt [CMake] Disable rpath for UnitTests 2016-11-03 06:58:16 +00:00