llvm-project/llvm/lib
Shiva Chen 2c864551df [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is

!DILabel(scope: !1, name: "foo", file: !2, line: 3)

We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is

llvm.dbg.label(metadata !1)

It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.

We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.

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

Patch by Hsiangkai Wang.

llvm-svn: 331841
2018-05-09 02:40:45 +00:00
..
Analysis [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
AsmParser [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
BinaryFormat Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
Bitcode [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
CodeGen [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
DebugInfo [DebugInfo] Accept `S` in augmentation strings in CIE. 2018-05-08 06:21:12 +00:00
Demangle [demangler] Add a partial demangling API for LLDB. 2018-04-12 20:41:38 +00:00
ExecutionEngine [RuntimeDyld][MachO] Properly handle thumb to thumb calls within a section. 2018-05-09 01:38:13 +00:00
FuzzMutate [llvm-opt-fuzzer] Add irce to the fuzzing options 2018-03-20 11:32:13 +00:00
Fuzzer [libFuzzer] Delete llvm/lib/Fuzzer 2017-10-16 20:48:19 +00:00
IR [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +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 Task=-1 passed to addSaveTemps 2018-05-05 14:37:20 +00:00
LineEditor
Linker [ThinLTO] Recommit of import global variables 2018-03-12 10:30:50 +00:00
MC MC: Remove dead code. NFCI. 2018-05-08 22:59:05 +00:00
Object Object: Find terminator correctly when reading long filenames in GNU archives (PR37244) 2018-05-08 08:22:58 +00:00
ObjectYAML Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Option IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
Passes Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
ProfileData [Coverage] Take filenames into account when loading function records. 2018-05-08 19:26:51 +00:00
Support [x86] Introduce the pconfig instruction 2018-05-08 06:47:36 +00:00
TableGen Revert r330742: Let TableGen write output only if it changed, instead of doing so in cmake. 2018-05-07 23:41:48 +00:00
Target [globalisel] Add a combiner helpers for extending loads and use them in a pre-legalize combiner for AArch64 2018-05-08 22:26:39 +00:00
Testing [LLVMTestingSupport] Add explicit linkage to LLVMSupport 2018-04-08 06:49:17 +00:00
ToolDrivers [COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode 2018-01-20 11:44:32 +00:00
Transforms [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
WindowsManifest Convert line endings of lib/WindowsManifest/CMakeLists.txt to unix. 2018-04-07 04:28:08 +00:00
XRay [XRay] clarify error messages when parsing broken traces 2018-01-30 13:41:34 +00:00
CMakeLists.txt
LLVMBuild.txt