diff options
author | Gabriel Poesia <gpoesia@fb.com> | 2016-03-28 17:45:22 -0700 |
---|---|---|
committer | Maksim Panchenko <maks@fb.com> | 2016-03-28 17:45:22 -0700 |
commit | ffa9641e16b3f53a686a6cff2c3f16239da8fc5c (patch) | |
tree | 9ab62fb02133055510f2b153f85633f9a41afb24 /bolt/CMakeLists.txt | |
parent | e8ef8a56194371f7a9c84d58b7e5ccf5adf363d0 (diff) | |
download | llvm-ffa9641e16b3f53a686a6cff2c3f16239da8fc5c.tar.gz |
Update DWARF lexical blocks address ranges.
Summary:
Updates DWARF lexical blocks address ranges in the output binary after optimizations.
This is similar to updating function address ranges except that the ranges representation needs
to be more general, since address ranges can begin or end in the middle of a basic block.
The following changes were made:
- Added a data structure for iterating over the basic blocks that intersect an address range: BasicBlockTable.h
- Added some more bookkeeping in BinaryBasicBlock. Basically, I needed to keep track of the block's size in the input binary as well as its address in the output binary. This information is mostly set by BinaryFunction after disassembly.
- Added a representation for address ranges relative to basic blocks (BasicBlockOffsetRanges.h). Will also serve for location lists.
- Added a representation for Lexical Blocks (LexicalBlock.h)
- Small refactorings in DebugArangesWriter:
-- Renamed to DebugRangesSectionsWriter since it also writes .debug_ranges
-- Refactored it not to depend on BinaryFunction but instead on anything that can be assined an aoffset in .debug_ranges (added an interface for that)
- Iterate over the DIE tree during initialization to find lexical blocks in .debug_info (BinaryContext.cpp)
- Added patches to .debug_abbrev and .debug_info in RewriteInstance to update lexical blocks attributes (in fact, this part is very similar to what was done to function address ranges and I just refactored/reused that code)
- Added small test case (lexical_blocks_address_ranges_debug.test)
(cherry picked from FBD3113181)
Diffstat (limited to 'bolt/CMakeLists.txt')
-rw-r--r-- | bolt/CMakeLists.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bolt/CMakeLists.txt b/bolt/CMakeLists.txt index 44611bc50916..c66cb442fbfc 100644 --- a/bolt/CMakeLists.txt +++ b/bolt/CMakeLists.txt @@ -13,13 +13,14 @@ set(LLVM_LINK_COMPONENTS add_llvm_tool(llvm-bolt llvm-bolt.cpp + BasicBlockOffsetRanges.cpp BinaryBasicBlock.cpp BinaryContext.cpp BinaryFunction.cpp BinaryPatcher.cpp DataReader.cpp - DebugArangesWriter.cpp DebugLineTableRowRef.cpp + DebugRangesSectionsWriter.cpp Exceptions.cpp RewriteInstance.cpp ) |