summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h
diff options
context:
space:
mode:
authorAlexey Lapshin <a.v.lapshin@mail.ru>2019-02-27 13:17:36 +0000
committerAlexey Lapshin <a.v.lapshin@mail.ru>2019-02-27 13:17:36 +0000
commit77fc1f6049a7414ec193c9ff8226eeb5662a5878 (patch)
treeb2bffed96e676b25942dbe39194e0f08a153f638 /llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h
parentef920358277603c69f4f548d2e5c40842972dd71 (diff)
downloadbcm5719-llvm-77fc1f6049a7414ec193c9ff8226eeb5662a5878.tar.gz
bcm5719-llvm-77fc1f6049a7414ec193c9ff8226eeb5662a5878.zip
[DebugInfo] add SectionedAddress to DebugInfo interfaces.
That patch is the fix for https://bugs.llvm.org/show_bug.cgi?id=40703 "wrong line number info for obj file compiled with -ffunction-sections" bug. The problem happened with only .o files. If object file contains several .text sections then line number information showed incorrectly. The reason for this is that DwarfLineTable could not detect section which corresponds to specified address(because address is the local to the section). And as the result it could not select proper sequence in the line table. The fix is to pass SectionIndex with the address. So that it would be possible to differentiate addresses from various sections. With this fix llvm-objdump shows correct line numbers for disassembled code. Differential review: https://reviews.llvm.org/D58194 llvm-svn: 354972
Diffstat (limited to 'llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h')
-rw-r--r--llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h
index d8031ed5f7d..27135c0debb 100644
--- a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h
+++ b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h
@@ -139,14 +139,15 @@ public:
bool usesRegisterOperand(const Instr &InstrMeta) const;
// Returns the list of indirect instructions.
- const std::set<uint64_t> &getIndirectInstructions() const;
+ const std::set<object::SectionedAddress> &getIndirectInstructions() const;
const MCRegisterInfo *getRegisterInfo() const;
const MCInstrInfo *getMCInstrInfo() const;
const MCInstrAnalysis *getMCInstrAnalysis() const;
// Returns the inlining information for the provided address.
- Expected<DIInliningInfo> symbolizeInlinedCode(uint64_t Address);
+ Expected<DIInliningInfo>
+ symbolizeInlinedCode(object::SectionedAddress Address);
// Returns whether the provided Graph represents a protected indirect control
// flow instruction in this file.
@@ -178,7 +179,7 @@ protected:
// Disassemble and parse the provided bytes into this object. Instruction
// address calculation is done relative to the provided SectionAddress.
void parseSectionContents(ArrayRef<uint8_t> SectionBytes,
- uint64_t SectionAddress);
+ object::SectionedAddress Address);
// Constructs and initialises members required for disassembly.
Error initialiseDisassemblyMembers();
@@ -225,7 +226,7 @@ private:
DenseMap<uint64_t, std::vector<uint64_t>> StaticBranchTargetings;
// A list of addresses of indirect control flow instructions.
- std::set<uint64_t> IndirectInstructions;
+ std::set<object::SectionedAddress> IndirectInstructions;
// The addresses of functions that will trap on CFI violations.
SmallSet<uint64_t, 4> TrapOnFailFunctionAddresses;
OpenPOWER on IntegriCloud