llvm-project/llvm/lib
Pavel Labath 78ab659bb4 dwarfgen: Add support for generating the debug_str_offsets section, take 2
This recommits r337910 after fixing an "ambiguous call to addAttribute"
error with some compilers (gcc circa 4.9 and MSVC). It seems that these
compilers will consider a "false -> pointer" conversion during overload
resolution. This creates ambiguity because one I added an overload which
takes a MCExpr * as an argument.

I fix this by making the new overload take MCExpr&, which avoids the
conversion. It also documents the fact that we expect a valid MCExpr
object.

Original commit message follows:

The motivation for this is D49493, where we'd like to test details of
debug_str_offsets behavior which is difficult to trigger from a
traditional test.

This adds the plubming necessary for dwarfgen to generate this section.
The more interesting changes are:
- I've moved emitStringOffsetsTableHeader function from DwarfFile to
  DwarfStringPool, so I can generate the section header more easily from
  the unit test.
- added a new addAttribute overload taking an MCExpr*. This is used to
  generate the DW_AT_str_offsets_base, which links a compile unit to the
  offset table.

I've also added a basic test for reading and writing DW_form_strx forms.

Reviewers: dblaikie, JDevlieghere, probinson

Subscribers: llvm-commits, aprantl

Differential Revision: https://reviews.llvm.org/D49670

llvm-svn: 337933
2018-07-25 15:33:32 +00:00
..
Analysis [SCEV] Add zext(C + x + ...) -> D + zext(C-D + x + ...)<nuw><nsw> transform 2018-07-24 21:48:56 +00:00
AsmParser [AsmParser] Fix inconsistent declaration parameter name 2018-07-12 02:03:53 +00:00
BinaryFormat [dwarfdump] Add pretty printer for accelerator table based on Atom. 2018-07-13 17:21:51 +00:00
Bitcode [ThinLTO] Only emit referenced type id records in index files 2018-07-19 22:25:56 +00:00
CodeGen dwarfgen: Add support for generating the debug_str_offsets section, take 2 2018-07-25 15:33:32 +00:00
DebugInfo [DWARF] Use deque in place of SmallVector to fix use-after-free issue 2018-07-23 23:27:45 +00:00
Demangle [demangler] call terminate() if allocation failed 2018-07-23 22:23:04 +00:00
ExecutionEngine Move JIT listener C binding fallbackks to ExecutionEngineBindings.cpp. 2018-07-25 15:04:57 +00:00
FuzzMutate [llvm-opt-fuzzer] Add irce to the fuzzing options 2018-03-20 11:32:13 +00:00
Fuzzer
IR [Dominators] Assert if there is modification to DelBB while it is awaiting deletion 2018-07-25 06:18:33 +00:00
IRReader LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
LTO [LTO] Handle __imp_ (dllimport) symbols consistently with lld 2018-07-23 22:33:57 +00:00
LineEditor
Linker [LTO] Fix linking with an alias defined using another alias. 2018-07-13 21:58:55 +00:00
MC [MC] Add a separate flag for skipping comdat constant sections for MinGW. NFC. 2018-07-23 22:15:25 +00:00
Object [llvm-objdump] Add dynamic section printing to private-headers option 2018-07-25 11:09:20 +00:00
ObjectYAML MC: Implement support for new .addrsig and .addrsig_sym directives. 2018-07-17 22:17:18 +00:00
Option Re-revert "[Option] Fix PR37006 prefix choice in findNearest" 2018-05-19 16:21:01 +00:00
Passes [ThinLTO] Enable ThinLTO WholeProgramDevirt and LowerTypeTests in new PM 2018-07-19 14:51:32 +00:00
ProfileData [NFC] Change sample profile format enum name SPF_Raw_Binary to SPF_Binary. 2018-06-12 05:53:49 +00:00
Support ADT: Shrink SmallVector size 0 to 16B on 64-bit platforms 2018-07-24 11:32:13 +00:00
TableGen [TableGen] Add missing std::moves to fix build failure. 2018-07-11 08:57:56 +00:00
Target [MIPS GlobalISel] Lower pointer arguments 2018-07-25 12:35:01 +00:00
Testing [LLVMTestingSupport] Add explicit linkage to LLVMSupport 2018-04-08 06:49:17 +00:00
ToolDrivers Give llvm-lib rudimentary help output. 2018-07-14 02:29:44 +00:00
Transforms Recommit r333268: [IPSCCP] Use PredicateInfo to propagate facts from cmp instructions. 2018-07-25 11:13:40 +00:00
WindowsManifest Convert line endings of lib/WindowsManifest/CMakeLists.txt to unix. 2018-04-07 04:28:08 +00:00
XRay [XRay][compiler-rt] Add PID field to llvm-xray tool and add PID metadata record entry in FDR mode 2018-07-13 05:38:22 +00:00
CMakeLists.txt
LLVMBuild.txt