summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCCodeView.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
commit044eb2f6afba375a914ac9d8024f8f5142bb912e (patch)
tree1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /include/llvm/MC/MCCodeView.h
parenteb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff)
Notes
Diffstat (limited to 'include/llvm/MC/MCCodeView.h')
-rw-r--r--include/llvm/MC/MCCodeView.h38
1 files changed, 31 insertions, 7 deletions
diff --git a/include/llvm/MC/MCCodeView.h b/include/llvm/MC/MCCodeView.h
index c3f1cecc97f48..e2249f49c86cb 100644
--- a/include/llvm/MC/MCCodeView.h
+++ b/include/llvm/MC/MCCodeView.h
@@ -161,8 +161,8 @@ public:
~CodeViewContext();
bool isValidFileNumber(unsigned FileNumber) const;
- bool addFile(unsigned FileNumber, StringRef Filename);
- ArrayRef<StringRef> getFilenames() { return Filenames; }
+ bool addFile(MCStreamer &OS, unsigned FileNumber, StringRef Filename,
+ ArrayRef<uint8_t> ChecksumBytes, uint8_t ChecksumKind);
/// Records the function id of a normal function. Returns false if the
/// function id has already been used, and true otherwise.
@@ -273,6 +273,13 @@ public:
/// Emits the file checksum substream.
void emitFileChecksums(MCObjectStreamer &OS);
+ /// Emits the offset into the checksum table of the given file number.
+ void emitFileChecksumOffset(MCObjectStreamer &OS, unsigned FileNo);
+
+ /// Add something to the string table. Returns the final string as well as
+ /// offset into the string table.
+ std::pair<StringRef, unsigned> addToStringTable(StringRef S);
+
private:
/// The current CodeView line information from the last .cv_loc directive.
MCCVLoc CurrentCVLoc = MCCVLoc(0, 0, 0, 0, false, true);
@@ -287,14 +294,27 @@ private:
MCDataFragment *getStringTableFragment();
- /// Add something to the string table.
- StringRef addToStringTable(StringRef S);
-
/// Get a string table offset.
unsigned getStringTableOffset(StringRef S);
- /// An array of absolute paths. Eventually this may include the file checksum.
- SmallVector<StringRef, 4> Filenames;
+ struct FileInfo {
+ unsigned StringTableOffset;
+
+ // Indicates if this FileInfo corresponds to an actual file, or hasn't been
+ // set yet.
+ bool Assigned = false;
+
+ uint8_t ChecksumKind;
+
+ ArrayRef<uint8_t> Checksum;
+
+ // Checksum offset stored as a symbol because it might be requested
+ // before it has been calculated, so a fixup may be needed.
+ MCSymbol *ChecksumTableOffset;
+ };
+
+ /// Array storing added file information.
+ SmallVector<FileInfo, 4> Files;
/// The offset of the first and last .cv_loc directive for a given function
/// id.
@@ -305,6 +325,10 @@ private:
/// All known functions and inlined call sites, indexed by function id.
std::vector<MCCVFunctionInfo> Functions;
+
+ /// Indicate whether we have already laid out the checksum table addresses or
+ /// not.
+ bool ChecksumOffsetsAssigned = false;
};
} // end namespace llvm