llvm/tools
Greg Clayton f5acbc29d8 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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286597 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 16:21:37 +00:00
..
bugpoint Split Bitcode/ReaderWriter.h into separate reader and writer headers 2016-11-11 05:34:58 +00:00
bugpoint-passes
dsymutil Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
gold Fix gold plugin after Error API changes 2016-11-11 06:04:30 +00:00
llc Revert "Use StringRef instead of raw pointer in TargetRegistry API (NFC)" 2016-10-01 07:08:23 +00:00
lli Split Bitcode/ReaderWriter.h into separate reader and writer headers 2016-11-11 05:34:58 +00:00
llvm-ar Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
llvm-as Split Bitcode/ReaderWriter.h into separate reader and writer headers 2016-11-11 05:34:58 +00:00
llvm-as-fuzzer
llvm-bcanalyzer Split Bitcode/ReaderWriter.h into separate reader and writer headers 2016-11-11 05:34:58 +00:00
llvm-c-test
llvm-config
llvm-cov [llvm-cov] Turn line numbers in html reports into clickable links 2016-11-02 19:44:13 +00:00
llvm-cxxdump Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
llvm-cxxfilt [llvm-cxxfilt] Use llvm::outs(). Simplify. 2016-09-27 18:50:30 +00:00
llvm-diff
llvm-dis Split Bitcode/ReaderWriter.h into separate reader and writer headers 2016-11-11 05:34:58 +00:00
llvm-dwarfdump dwarfdump: -summarize-types: print a short summary (unqualified type name, hash, length) of type units rather than dumping contents 2016-10-18 21:09:48 +00:00
llvm-dwp Clean up DWARFFormValue by reducing duplicated code and removing DWARFFormValue::getFixedFormSizes() 2016-11-11 16:21:37 +00:00
llvm-extract [tools] Unbreak the GCC build (workaround a GCC bug). 2016-11-09 21:30:33 +00:00
llvm-go
llvm-jitlistener
llvm-link Split Bitcode/ReaderWriter.h into separate reader and writer headers 2016-11-11 05:34:58 +00:00
llvm-lto Split Bitcode/ReaderWriter.h into separate reader and writer headers 2016-11-11 05:34:58 +00:00
llvm-lto2 [ThinLTO] Disable importing and other cross-module optis at -O0 2016-10-31 22:12:21 +00:00
llvm-mc [MC] Make llvm-mc fail cleanly on invalid output asm variant. 2016-10-31 18:36:31 +00:00
llvm-mc-fuzzer Turn cl::values() (for enum) from a vararg function to using C++ variadic template 2016-10-08 19:41:06 +00:00
llvm-mcmarkup
llvm-nm Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
llvm-objdump Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
llvm-opt-report [llvm-opt-report] Fix unroll-count reporting 2016-10-24 05:07:18 +00:00
llvm-pdbdump [CodeView] Hook up CodeViewRecordIO to type serialization path. 2016-11-08 22:24:53 +00:00
llvm-profdata [PGO] Fix a use-after-move. NFC. 2016-10-19 23:31:59 +00:00
llvm-readobj Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
llvm-rtdyld Turn cl::values() (for enum) from a vararg function to using C++ variadic template 2016-10-08 19:41:06 +00:00
llvm-shlib Fix llvm-shlib cmake build 2016-11-01 20:19:33 +00:00
llvm-size Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
llvm-split Split Bitcode/ReaderWriter.h into separate reader and writer headers 2016-11-11 05:34:58 +00:00
llvm-stress Use StringRef in CommandLine Options handling (NFC) 2016-10-01 03:43:20 +00:00
llvm-strings llvm-strings: Fix r286556 to add required libraries. 2016-11-11 14:17:37 +00:00
llvm-symbolizer Turn cl::values() (for enum) from a vararg function to using C++ variadic template 2016-10-08 19:41:06 +00:00
llvm-xray Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
lto Split Bitcode/ReaderWriter.h into separate reader and writer headers 2016-11-11 05:34:58 +00:00
msbuild
obj2yaml Remove the last use of report_fatal_error from ELF.h. 2016-11-03 19:07:15 +00:00
opt Revert "[ThinLTO] Prevent exporting of locals used/defined in module level asm" 2016-11-09 01:45:13 +00:00
sancov Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
sanstats
verify-uselistorder Split Bitcode/ReaderWriter.h into separate reader and writer headers 2016-11-11 05:34:58 +00:00
xcode-toolchain [CMake] Minor fix to regex in r279152 2016-08-18 21:36:36 +00:00
yaml2obj Misc improvements to StringTableBuilder. 2016-10-04 22:43:25 +00:00
CMakeLists.txt
LLVMBuild.txt