Re-land "Fix Bug 30978 by emitting cv file checksums."
This reverts r313431 and brings back r313374 with a fix to write checksums as binary data and not ASCII hex strings. llvm-svn: 313657
This commit is contained in:
@@ -225,7 +225,9 @@ public:
|
||||
StringRef FileName) override;
|
||||
MCSymbol *getDwarfLineTableSymbol(unsigned CUID) override;
|
||||
|
||||
bool EmitCVFileDirective(unsigned FileNo, StringRef Filename) override;
|
||||
bool EmitCVFileDirective(unsigned FileNo, StringRef Filename,
|
||||
ArrayRef<uint8_t> Checksum,
|
||||
unsigned ChecksumKind) override;
|
||||
bool EmitCVFuncIdDirective(unsigned FuncId) override;
|
||||
bool EmitCVInlineSiteIdDirective(unsigned FunctionId, unsigned IAFunc,
|
||||
unsigned IAFile, unsigned IALine,
|
||||
@@ -245,6 +247,7 @@ public:
|
||||
StringRef FixedSizePortion) override;
|
||||
void EmitCVStringTableDirective() override;
|
||||
void EmitCVFileChecksumsDirective() override;
|
||||
void EmitCVFileChecksumOffsetDirective(unsigned FileNo) override;
|
||||
|
||||
void EmitIdent(StringRef IdentString) override;
|
||||
void EmitCFISections(bool EH, bool Debug) override;
|
||||
@@ -1120,13 +1123,25 @@ MCSymbol *MCAsmStreamer::getDwarfLineTableSymbol(unsigned CUID) {
|
||||
return MCStreamer::getDwarfLineTableSymbol(0);
|
||||
}
|
||||
|
||||
bool MCAsmStreamer::EmitCVFileDirective(unsigned FileNo, StringRef Filename) {
|
||||
if (!getContext().getCVContext().addFile(FileNo, Filename))
|
||||
bool MCAsmStreamer::EmitCVFileDirective(unsigned FileNo, StringRef Filename,
|
||||
ArrayRef<uint8_t> Checksum,
|
||||
unsigned ChecksumKind) {
|
||||
if (!getContext().getCVContext().addFile(*this, FileNo, Filename, Checksum,
|
||||
ChecksumKind))
|
||||
return false;
|
||||
|
||||
OS << "\t.cv_file\t" << FileNo << ' ';
|
||||
|
||||
PrintQuotedString(Filename, OS);
|
||||
|
||||
if (!ChecksumKind) {
|
||||
EmitEOL();
|
||||
return true;
|
||||
}
|
||||
|
||||
OS << ' ';
|
||||
PrintQuotedString(toHex(Checksum), OS);
|
||||
OS << ' ' << ChecksumKind;
|
||||
|
||||
EmitEOL();
|
||||
return true;
|
||||
}
|
||||
@@ -1228,6 +1243,11 @@ void MCAsmStreamer::EmitCVFileChecksumsDirective() {
|
||||
EmitEOL();
|
||||
}
|
||||
|
||||
void MCAsmStreamer::EmitCVFileChecksumOffsetDirective(unsigned FileNo) {
|
||||
OS << "\t.cv_filechecksumoffset\t" << FileNo;
|
||||
EmitEOL();
|
||||
}
|
||||
|
||||
void MCAsmStreamer::EmitIdent(StringRef IdentString) {
|
||||
assert(MAI->hasIdentDirective() && ".ident directive not supported");
|
||||
OS << "\t.ident\t";
|
||||
|
||||
Reference in New Issue
Block a user