summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.cpp')
-rw-r--r--lib/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.cpp b/lib/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.cpp
index 483f7cb5c5ad3..cb6a8478797f9 100644
--- a/lib/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.cpp
+++ b/lib/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.cpp
@@ -10,20 +10,22 @@
#include "llvm/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.h"
#include "llvm/DebugInfo/CodeView/CodeViewError.h"
+#include "llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h"
#include "llvm/DebugInfo/CodeView/ModuleDebugFragmentRecord.h"
+#include "llvm/DebugInfo/CodeView/StringTable.h"
using namespace llvm;
using namespace llvm::codeview;
Error VarStreamArrayExtractor<InlineeSourceLine>::extract(
BinaryStreamRef Stream, uint32_t &Len, InlineeSourceLine &Item,
- ContextType *Fragment) {
+ bool HasExtraFiles) {
BinaryStreamReader Reader(Stream);
if (auto EC = Reader.readObject(Item.Header))
return EC;
- if (Fragment->hasExtraFiles()) {
+ if (HasExtraFiles) {
uint32_t ExtraFileCount;
if (auto EC = Reader.readInteger(ExtraFileCount))
return EC;
@@ -42,7 +44,8 @@ Error ModuleDebugInlineeLineFragmentRef::initialize(BinaryStreamReader Reader) {
if (auto EC = Reader.readEnum(Signature))
return EC;
- if (auto EC = Reader.readArray(Lines, Reader.bytesRemaining(), this))
+ if (auto EC =
+ Reader.readArray(Lines, Reader.bytesRemaining(), hasExtraFiles()))
return EC;
assert(Reader.bytesRemaining() == 0);
@@ -54,9 +57,9 @@ bool ModuleDebugInlineeLineFragmentRef::hasExtraFiles() const {
}
ModuleDebugInlineeLineFragment::ModuleDebugInlineeLineFragment(
- bool HasExtraFiles)
+ ModuleDebugFileChecksumFragment &Checksums, bool HasExtraFiles)
: ModuleDebugFragment(ModuleDebugFragmentKind::InlineeLines),
- HasExtraFiles(HasExtraFiles) {}
+ Checksums(Checksums), HasExtraFiles(HasExtraFiles) {}
uint32_t ModuleDebugInlineeLineFragment::calculateSerializedLength() {
// 4 bytes for the signature
@@ -99,18 +102,22 @@ Error ModuleDebugInlineeLineFragment::commit(BinaryStreamWriter &Writer) {
return Error::success();
}
-void ModuleDebugInlineeLineFragment::addExtraFile(uint32_t FileOffset) {
+void ModuleDebugInlineeLineFragment::addExtraFile(StringRef FileName) {
+ uint32_t Offset = Checksums.mapChecksumOffset(FileName);
+
auto &Entry = Entries.back();
- Entry.ExtraFiles.push_back(ulittle32_t(FileOffset));
+ Entry.ExtraFiles.push_back(ulittle32_t(Offset));
++ExtraFileCount;
}
void ModuleDebugInlineeLineFragment::addInlineSite(TypeIndex FuncId,
- uint32_t FileOffset,
+ StringRef FileName,
uint32_t SourceLine) {
+ uint32_t Offset = Checksums.mapChecksumOffset(FileName);
+
Entries.emplace_back();
auto &Entry = Entries.back();
- Entry.Header.FileID = FileOffset;
+ Entry.Header.FileID = Offset;
Entry.Header.SourceLineNum = SourceLine;
Entry.Header.Inlinee = FuncId;
}