[llvm] r367861 - Revert "Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability"
Nilanjana Basu via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 5 06:55:22 PDT 2019
Author: nilanjana_basu
Date: Mon Aug 5 06:55:21 2019
New Revision: 367861
URL: http://llvm.org/viewvc/llvm-project?rev=367861&view=rev
Log:
Revert "Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability"
This reverts commit a885afa9fa8cab3b34f1ddf3d21535f88b662881.
Modified:
llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h
llvm/trunk/include/llvm/MC/MCStreamer.h
llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp
llvm/trunk/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp
llvm/trunk/lib/MC/MCAsmStreamer.cpp
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/lib/MC/MCStreamer.cpp
llvm/trunk/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
llvm/trunk/test/DebugInfo/COFF/fp-stack.ll
llvm/trunk/test/DebugInfo/COFF/local-variable-gap.ll
llvm/trunk/test/DebugInfo/COFF/local-variables.ll
llvm/trunk/test/DebugInfo/COFF/nrvo.ll
llvm/trunk/test/DebugInfo/COFF/pieces.ll
llvm/trunk/test/DebugInfo/COFF/register-variables.ll
llvm/trunk/test/MC/COFF/cv-def-range-align.s
llvm/trunk/test/MC/COFF/cv-def-range-gap.s
llvm/trunk/test/MC/COFF/cv-def-range.s
llvm/trunk/tools/llvm-pdbutil/MinimalSymbolDumper.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h Mon Aug 5 06:55:21 2019
@@ -520,10 +520,6 @@ class DefRangeFramePointerRelSym : publi
static constexpr uint32_t RelocationOffset = 8;
public:
- struct Header {
- little32_t Offset;
- };
-
explicit DefRangeFramePointerRelSym(SymbolRecordKind Kind)
: SymbolRecord(Kind) {}
DefRangeFramePointerRelSym(uint32_t RecordOffset)
@@ -534,7 +530,7 @@ public:
return RecordOffset + RelocationOffset;
}
- Header Hdr;
+ int32_t Offset;
LocalVariableAddrRange Range;
std::vector<LocalVariableAddrGap> Gaps;
Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCStreamer.h Mon Aug 5 06:55:21 2019
@@ -18,7 +18,6 @@
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
#include "llvm/MC/MCDirectives.h"
#include "llvm/MC/MCLinkerOptimizationHint.h"
#include "llvm/MC/MCSymbol.h"
@@ -861,22 +860,6 @@ public:
ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
StringRef FixedSizePortion);
- virtual void EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeRegisterRelSym::Header DRHdr);
-
- virtual void EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeSubfieldRegisterSym::Header DRHdr);
-
- virtual void EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeRegisterSym::Header DRHdr);
-
- virtual void EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeFramePointerRelSym::Header DRHdr);
-
/// This implements the CodeView '.cv_stringtable' assembler directive.
virtual void EmitCVStringTableDirective() {}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp Mon Aug 5 06:55:21 2019
@@ -2633,6 +2633,17 @@ void CodeViewDebug::emitLocalVariableLis
emitLocalVariable(FI, L);
}
+/// Only call this on endian-specific types like ulittle16_t and little32_t, or
+/// structs composed of them.
+template <typename T>
+static void copyBytesForDefRange(SmallString<20> &BytePrefix,
+ SymbolKind SymKind, const T &DefRangeHeader) {
+ BytePrefix.resize(2 + sizeof(T));
+ ulittle16_t SymKindLE = ulittle16_t(SymKind);
+ memcpy(&BytePrefix[0], &SymKindLE, 2);
+ memcpy(&BytePrefix[2], &DefRangeHeader, sizeof(T));
+}
+
void CodeViewDebug::emitLocalVariable(const FunctionInfo &FI,
const LocalVariable &Var) {
// LocalSym record, see SymbolRecord.h for more info.
@@ -2681,9 +2692,8 @@ void CodeViewDebug::emitLocalVariable(co
(bool(Flags & LocalSymFlags::IsParameter)
? (EncFP == FI.EncodedParamFramePtrReg)
: (EncFP == FI.EncodedLocalFramePtrReg))) {
- DefRangeFramePointerRelSym::Header DRHdr;
- DRHdr.Offset = Offset;
- OS.EmitCVDefRangeDirective(DefRange.Ranges, DRHdr);
+ little32_t FPOffset = little32_t(Offset);
+ copyBytesForDefRange(BytePrefix, S_DEFRANGE_FRAMEPOINTER_REL, FPOffset);
} else {
uint16_t RegRelFlags = 0;
if (DefRange.IsSubfield) {
@@ -2695,7 +2705,7 @@ void CodeViewDebug::emitLocalVariable(co
DRHdr.Register = Reg;
DRHdr.Flags = RegRelFlags;
DRHdr.BasePointerOffset = Offset;
- OS.EmitCVDefRangeDirective(DefRange.Ranges, DRHdr);
+ copyBytesForDefRange(BytePrefix, S_DEFRANGE_REGISTER_REL, DRHdr);
}
} else {
assert(DefRange.DataOffset == 0 && "unexpected offset into register");
@@ -2704,14 +2714,15 @@ void CodeViewDebug::emitLocalVariable(co
DRHdr.Register = DefRange.CVRegister;
DRHdr.MayHaveNoName = 0;
DRHdr.OffsetInParent = DefRange.StructOffset;
- OS.EmitCVDefRangeDirective(DefRange.Ranges, DRHdr);
+ copyBytesForDefRange(BytePrefix, S_DEFRANGE_SUBFIELD_REGISTER, DRHdr);
} else {
DefRangeRegisterSym::Header DRHdr;
DRHdr.Register = DefRange.CVRegister;
DRHdr.MayHaveNoName = 0;
- OS.EmitCVDefRangeDirective(DefRange.Ranges, DRHdr);
+ copyBytesForDefRange(BytePrefix, S_DEFRANGE_REGISTER, DRHdr);
}
}
+ OS.EmitCVDefRangeDirective(DefRange.Ranges, BytePrefix);
}
}
Modified: llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp Mon Aug 5 06:55:21 2019
@@ -315,7 +315,7 @@ Error CVSymbolDumperImpl::visitKnownReco
Error CVSymbolDumperImpl::visitKnownRecord(
CVSymbol &CVR, DefRangeFramePointerRelSym &DefRangeFramePointerRel) {
- W.printNumber("Offset", DefRangeFramePointerRel.Hdr.Offset);
+ W.printNumber("Offset", DefRangeFramePointerRel.Offset);
printLocalVariableAddrRange(DefRangeFramePointerRel.Range,
DefRangeFramePointerRel.getRelocationOffset());
printLocalVariableAddrGap(DefRangeFramePointerRel.Gaps);
Modified: llvm/trunk/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp Mon Aug 5 06:55:21 2019
@@ -229,7 +229,7 @@ Error SymbolRecordMapping::visitKnownRec
Error SymbolRecordMapping::visitKnownRecord(
CVSymbol &CVR, DefRangeFramePointerRelSym &DefRangeFramePointerRel) {
- error(IO.mapObject(DefRangeFramePointerRel.Hdr.Offset));
+ error(IO.mapInteger(DefRangeFramePointerRel.Offset));
error(mapLocalVariableAddrRange(IO, DefRangeFramePointerRel.Range));
error(IO.mapVectorTail(DefRangeFramePointerRel.Gaps, MapGap()));
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Mon Aug 5 06:55:21 2019
@@ -254,26 +254,9 @@ public:
unsigned SourceLineNum,
const MCSymbol *FnStartSym,
const MCSymbol *FnEndSym) override;
-
- void PrintCVDefRangePrefix(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges);
-
- void EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeRegisterRelSym::Header DRHdr) override;
-
void EmitCVDefRangeDirective(
ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeSubfieldRegisterSym::Header DRHdr) override;
-
- void EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeRegisterSym::Header DRHdr) override;
-
- void EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeFramePointerRelSym::Header DRHdr) override;
-
+ StringRef FixedSizePortion) override;
void EmitCVStringTableDirective() override;
void EmitCVFileChecksumsDirective() override;
void EmitCVFileChecksumOffsetDirective(unsigned FileNo) override;
@@ -1393,8 +1376,9 @@ void MCAsmStreamer::EmitCVInlineLinetabl
PrimaryFunctionId, SourceFileId, SourceLineNum, FnStartSym, FnEndSym);
}
-void MCAsmStreamer::PrintCVDefRangePrefix(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges) {
+void MCAsmStreamer::EmitCVDefRangeDirective(
+ ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
+ StringRef FixedSizePortion) {
OS << "\t.cv_def_range\t";
for (std::pair<const MCSymbol *, const MCSymbol *> Range : Ranges) {
OS << ' ';
@@ -1402,43 +1386,10 @@ void MCAsmStreamer::PrintCVDefRangePrefi
OS << ' ';
Range.second->print(OS, MAI);
}
-}
-
-void MCAsmStreamer::EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeRegisterRelSym::Header DRHdr) {
- PrintCVDefRangePrefix(Ranges);
- OS << ", reg_rel, ";
- OS << DRHdr.Register << ", " << DRHdr.Flags << ", "
- << DRHdr.BasePointerOffset;
- EmitEOL();
-}
-
-void MCAsmStreamer::EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeSubfieldRegisterSym::Header DRHdr) {
- PrintCVDefRangePrefix(Ranges);
- OS << ", subfield_reg, ";
- OS << DRHdr.Register << ", " << DRHdr.OffsetInParent;
- EmitEOL();
-}
-
-void MCAsmStreamer::EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeRegisterSym::Header DRHdr) {
- PrintCVDefRangePrefix(Ranges);
- OS << ", reg, ";
- OS << DRHdr.Register;
- EmitEOL();
-}
-
-void MCAsmStreamer::EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeFramePointerRelSym::Header DRHdr) {
- PrintCVDefRangePrefix(Ranges);
- OS << ", frame_ptr_rel, ";
- OS << DRHdr.Offset;
+ OS << ", ";
+ PrintQuotedString(FixedSizePortion, OS);
EmitEOL();
+ this->MCStreamer::EmitCVDefRangeDirective(Ranges, FixedSizePortion);
}
void MCAsmStreamer::EmitCVStringTableDirective() {
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Mon Aug 5 06:55:21 2019
@@ -524,19 +524,6 @@ private:
/// directives parsed by this class.
StringMap<DirectiveKind> DirectiveKindMap;
- // Codeview def_range type parsing.
- enum CVDefRangeType {
- CVDR_DEFRANGE = 0, // Placeholder
- CVDR_DEFRANGE_REGISTER,
- CVDR_DEFRANGE_FRAMEPOINTER_REL,
- CVDR_DEFRANGE_SUBFIELD_REGISTER,
- CVDR_DEFRANGE_REGISTER_REL
- };
-
- /// Maps Codeview def_range types --> CVDefRangeType enum, for
- /// Codeview def_range types parsed by this class.
- StringMap<CVDefRangeType> CVDefRangeTypeMap;
-
// ".ascii", ".asciz", ".string"
bool parseDirectiveAscii(StringRef IDVal, bool ZeroTerminated);
bool parseDirectiveReloc(SMLoc DirectiveLoc); // ".reloc"
@@ -684,7 +671,6 @@ private:
bool parseDirectiveAddrsigSym();
void initializeDirectiveKindMap();
- void initializeCVDefRangeTypeMap();
};
} // end anonymous namespace
@@ -734,7 +720,6 @@ AsmParser::AsmParser(SourceMgr &SM, MCCo
PlatformParser->Initialize(*this);
initializeDirectiveKindMap();
- initializeCVDefRangeTypeMap();
NumOfMacroInstantiations = 0;
}
@@ -1752,7 +1737,6 @@ bool AsmParser::parseStatement(ParseStat
StringMap<DirectiveKind>::const_iterator DirKindIt =
DirectiveKindMap.find(IDVal);
DirectiveKind DirKind = (DirKindIt == DirectiveKindMap.end())
-
? DK_NO_DIRECTIVE
: DirKindIt->getValue();
switch (DirKind) {
@@ -3841,13 +3825,6 @@ bool AsmParser::parseDirectiveCVInlineLi
return false;
}
-void AsmParser::initializeCVDefRangeTypeMap() {
- CVDefRangeTypeMap["reg"] = CVDR_DEFRANGE_REGISTER;
- CVDefRangeTypeMap["frame_ptr_rel"] = CVDR_DEFRANGE_FRAMEPOINTER_REL;
- CVDefRangeTypeMap["subfield_reg"] = CVDR_DEFRANGE_SUBFIELD_REGISTER;
- CVDefRangeTypeMap["reg_rel"] = CVDR_DEFRANGE_REGISTER_REL;
-}
-
/// parseDirectiveCVDefRange
/// ::= .cv_def_range RangeStart RangeEnd (GapStart GapEnd)*, bytes*
bool AsmParser::parseDirectiveCVDefRange() {
@@ -3869,90 +3846,13 @@ bool AsmParser::parseDirectiveCVDefRange
Ranges.push_back({GapStartSym, GapEndSym});
}
- StringRef CVDefRangeTypeStr;
- if (parseToken(
- AsmToken::Comma,
- "expected comma before def_range type in .cv_def_range directive") ||
- parseIdentifier(CVDefRangeTypeStr))
- return Error(Loc, "expected def_range type in directive");
-
- StringMap<CVDefRangeType>::const_iterator CVTypeIt =
- CVDefRangeTypeMap.find(CVDefRangeTypeStr);
- CVDefRangeType CVDRType = (CVTypeIt == CVDefRangeTypeMap.end())
- ? CVDR_DEFRANGE
- : CVTypeIt->getValue();
- switch (CVDRType) {
- case CVDR_DEFRANGE_REGISTER: {
- int64_t DRRegister;
- if (parseToken(AsmToken::Comma, "expected comma before register number in "
- ".cv_def_range directive") ||
- parseAbsoluteExpression(DRRegister))
- return Error(Loc, "expected register number");
-
- codeview::DefRangeRegisterSym::Header DRHdr;
- DRHdr.Register = DRRegister;
- getStreamer().EmitCVDefRangeDirective(Ranges, DRHdr);
- break;
- }
- case CVDR_DEFRANGE_FRAMEPOINTER_REL: {
- int64_t DROffset;
- if (parseToken(AsmToken::Comma,
- "expected comma before offset in .cv_def_range directive") ||
- parseAbsoluteExpression(DROffset))
- return Error(Loc, "expected offset value");
-
- codeview::DefRangeFramePointerRelSym::Header DRHdr;
- DRHdr.Offset = DROffset;
- getStreamer().EmitCVDefRangeDirective(Ranges, DRHdr);
- break;
- }
- case CVDR_DEFRANGE_SUBFIELD_REGISTER: {
- int64_t DRRegister;
- int64_t DROffsetInParent;
- if (parseToken(AsmToken::Comma, "expected comma before register number in "
- ".cv_def_range directive") ||
- parseAbsoluteExpression(DRRegister))
- return Error(Loc, "expected register number");
- if (parseToken(AsmToken::Comma,
- "expected comma before offset in .cv_def_range directive") ||
- parseAbsoluteExpression(DROffsetInParent))
- return Error(Loc, "expected offset value");
-
- codeview::DefRangeSubfieldRegisterSym::Header DRHdr;
- DRHdr.Register = DRRegister;
- DRHdr.OffsetInParent = DROffsetInParent;
- getStreamer().EmitCVDefRangeDirective(Ranges, DRHdr);
- break;
- }
- case CVDR_DEFRANGE_REGISTER_REL: {
- int64_t DRRegister;
- int64_t DRFlags;
- int64_t DRBasePointerOffset;
- if (parseToken(AsmToken::Comma, "expected comma before register number in "
- ".cv_def_range directive") ||
- parseAbsoluteExpression(DRRegister))
- return Error(Loc, "expected register value");
- if (parseToken(
- AsmToken::Comma,
- "expected comma before flag value in .cv_def_range directive") ||
- parseAbsoluteExpression(DRFlags))
- return Error(Loc, "expected flag value");
- if (parseToken(AsmToken::Comma, "expected comma before base pointer offset "
- "in .cv_def_range directive") ||
- parseAbsoluteExpression(DRBasePointerOffset))
- return Error(Loc, "expected base pointer offset value");
-
- codeview::DefRangeRegisterRelSym::Header DRHdr;
- DRHdr.Register = DRRegister;
- DRHdr.Flags = DRFlags;
- DRHdr.BasePointerOffset = DRBasePointerOffset;
- getStreamer().EmitCVDefRangeDirective(Ranges, DRHdr);
- break;
- }
- default:
- return Error(Loc, "unexpected def_range type in .cv_def_range directive");
- }
- return true;
+ std::string FixedSizePortion;
+ if (parseToken(AsmToken::Comma, "unexpected token in directive") ||
+ parseEscapedString(FixedSizePortion))
+ return true;
+
+ getStreamer().EmitCVDefRangeDirective(Ranges, FixedSizePortion);
+ return false;
}
/// parseDirectiveCVString
Modified: llvm/trunk/lib/MC/MCStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCStreamer.cpp?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCStreamer.cpp Mon Aug 5 06:55:21 2019
@@ -327,56 +327,10 @@ void MCStreamer::EmitCVInlineLinetableDi
const MCSymbol *FnStartSym,
const MCSymbol *FnEndSym) {}
-/// Only call this on endian-specific types like ulittle16_t and little32_t, or
-/// structs composed of them.
-template <typename T>
-static void copyBytesForDefRange(SmallString<20> &BytePrefix,
- codeview::SymbolKind SymKind,
- const T &DefRangeHeader) {
- BytePrefix.resize(2 + sizeof(T));
- codeview::ulittle16_t SymKindLE = codeview::ulittle16_t(SymKind);
- memcpy(&BytePrefix[0], &SymKindLE, 2);
- memcpy(&BytePrefix[2], &DefRangeHeader, sizeof(T));
-}
-
void MCStreamer::EmitCVDefRangeDirective(
ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
StringRef FixedSizePortion) {}
-void MCStreamer::EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeRegisterRelSym::Header DRHdr) {
- SmallString<20> BytePrefix;
- copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_REGISTER_REL, DRHdr);
- EmitCVDefRangeDirective(Ranges, BytePrefix);
-}
-
-void MCStreamer::EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeSubfieldRegisterSym::Header DRHdr) {
- SmallString<20> BytePrefix;
- copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_SUBFIELD_REGISTER,
- DRHdr);
- EmitCVDefRangeDirective(Ranges, BytePrefix);
-}
-
-void MCStreamer::EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeRegisterSym::Header DRHdr) {
- SmallString<20> BytePrefix;
- copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_REGISTER, DRHdr);
- EmitCVDefRangeDirective(Ranges, BytePrefix);
-}
-
-void MCStreamer::EmitCVDefRangeDirective(
- ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
- codeview::DefRangeFramePointerRelSym::Header DRHdr) {
- SmallString<20> BytePrefix;
- copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_FRAMEPOINTER_REL,
- DRHdr);
- EmitCVDefRangeDirective(Ranges, BytePrefix);
-}
-
void MCStreamer::EmitEHSymAttributes(const MCSymbol *Symbol,
MCSymbol *EHSymbol) {
}
Modified: llvm/trunk/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/CodeViewYAMLSymbols.cpp?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/CodeViewYAMLSymbols.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/CodeViewYAMLSymbols.cpp Mon Aug 5 06:55:21 2019
@@ -391,7 +391,7 @@ template <> void SymbolRecordImpl<DefRan
}
template <> void SymbolRecordImpl<DefRangeFramePointerRelSym>::map(IO &IO) {
- IO.mapRequired("Offset", Symbol.Hdr.Offset);
+ IO.mapRequired("Offset", Symbol.Offset);
IO.mapRequired("Range", Symbol.Range);
IO.mapRequired("Gaps", Symbol.Gaps);
}
Modified: llvm/trunk/test/DebugInfo/COFF/fp-stack.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/fp-stack.ll?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/fp-stack.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/fp-stack.ll Mon Aug 5 06:55:21 2019
@@ -10,7 +10,7 @@ entry:
ret double %sub
}
-; ASM: .cv_def_range Ltmp1 Lfunc_end0, reg, 128
+; ASM: .cv_def_range Ltmp1 Lfunc_end0, "A\021\200\000\000\000"
; OBJ: DefRangeRegisterSym {
; OBJ: Register: ST0 (0x80)
; OBJ: MayHaveNoName: 0
Modified: llvm/trunk/test/DebugInfo/COFF/local-variable-gap.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/local-variable-gap.ll?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/local-variable-gap.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/local-variable-gap.ll Mon Aug 5 06:55:21 2019
@@ -62,7 +62,7 @@
; ASM: .long 116 # TypeIndex
; ASM: .short 0 # Flags
; ASM: .asciz "p"
-; ASM: .cv_def_range [[p_b1]] [[p_e1]] [[p_b2]] .Lfunc_end0, reg, 23
+; ASM: .cv_def_range [[p_b1]] [[p_e1]] [[p_b2]] .Lfunc_end0, "A\021\027\000\000\000"
; ASM: .short 2 # Record length
; ASM: .short 4431 # Record kind: S_PROC_ID_END
Modified: llvm/trunk/test/DebugInfo/COFF/local-variables.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/local-variables.ll?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/local-variables.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/local-variables.ll Mon Aug 5 06:55:21 2019
@@ -71,30 +71,30 @@
; ASM: .long 116 # TypeIndex
; ASM: .short 1 # Flags
; ASM: .asciz "param"
-; ASM: .cv_def_range [[prologue_end]] [[param_end]], frame_ptr_rel, 52
+; ASM: .cv_def_range [[prologue_end]] [[param_end]], "B\0214\000\000\000"
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .long 116 # TypeIndex
; ASM: .short 0 # Flags
; ASM: .asciz "a"
-; ASM: .cv_def_range [[if_start]] [[else_start]], frame_ptr_rel, 40
+; ASM: .cv_def_range [[if_start]] [[else_start]], "B\021(\000\000\000"
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .long 116 # TypeIndex
; ASM: .short 0 # Flags
; ASM: .asciz "b"
-; ASM: .cv_def_range [[else_start]] [[else_end]], frame_ptr_rel, 36
+; ASM: .cv_def_range [[else_start]] [[else_end]], "B\021$\000\000\000"
; ASM: .short 4429 # Record kind: S_INLINESITE
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .long 116 # TypeIndex
; ASM: .short 0 # Flags
; ASM: .asciz "v"
-; ASM: .cv_def_range [[inline_site1]] [[else_start]], frame_ptr_rel, 44
+; ASM: .cv_def_range [[inline_site1]] [[else_start]], "B\021,\000\000\000"
; ASM: .short 4430 # Record kind: S_INLINESITE_END
; ASM: .short 4429 # Record kind: S_INLINESITE
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .long 116 # TypeIndex
; ASM: .short 0 # Flags
; ASM: .asciz "v"
-; ASM: .cv_def_range [[inline_site2]] [[else_end]], frame_ptr_rel, 48
+; ASM: .cv_def_range [[inline_site2]] [[else_end]], "B\0210\000\000\000"
; ASM: .short 4430 # Record kind: S_INLINESITE_END
; OBJ: Subsection [
Modified: llvm/trunk/test/DebugInfo/COFF/nrvo.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/nrvo.ll?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/nrvo.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/nrvo.ll Mon Aug 5 06:55:21 2019
@@ -28,7 +28,7 @@
; ASM-NEXT: .asciz "foo"
; ASM-NEXT: .p2align 2
; ASM-NEXT: .Ltmp
-; ASM: .cv_def_range .Ltmp{{.*}} .Ltmp{{.*}}, frame_ptr_rel, 40
+; ASM: .cv_def_range .Ltmp{{.*}} .Ltmp{{.*}}, "B\021(\000\000\000"
; OBJ: Subsection [
; OBJ: SubSectionType: Symbols (0xF1)
Modified: llvm/trunk/test/DebugInfo/COFF/pieces.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/pieces.ll?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/pieces.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/pieces.ll Mon Aug 5 06:55:21 2019
@@ -113,10 +113,10 @@
; ASM: .asciz "loop_csr" # Function name
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "o"
-; ASM: .cv_def_range [[oy_ox_start]] [[ox_start]], subfield_reg, 24, 0
-; ASM: .cv_def_range [[oy_ox_start]] [[oy_start]], subfield_reg, 23, 4
-; ASM: .cv_def_range [[ox_start]] [[loopskip_start]], subfield_reg, 24, 0
-; ASM: .cv_def_range [[oy_start]] [[loopskip_start]], subfield_reg, 23, 4
+; ASM: .cv_def_range [[oy_ox_start]] [[ox_start]], "C\021\030\000\000\000\000\000\000\000"
+; ASM: .cv_def_range [[oy_ox_start]] [[oy_start]], "C\021\027\000\000\000\004\000\000\000"
+; ASM: .cv_def_range [[ox_start]] [[loopskip_start]], "C\021\030\000\000\000\000\000\000\000"
+; ASM: .cv_def_range [[oy_start]] [[loopskip_start]], "C\021\027\000\000\000\004\000\000\000"
; OBJ-LABEL: GlobalProcIdSym {
@@ -147,7 +147,7 @@
; ASM: .asciz "pad_right" # Function name
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "o"
-; ASM: .cv_def_range [[pad_right_tmp]] [[pad_right_tmp]], subfield_reg, 17, 4
+; ASM: .cv_def_range [[pad_right_tmp]] [[pad_right_tmp]], "C\021\021\000\000\000\004\000\000\000"
; OBJ-LABEL: GlobalProcIdSym {
; OBJ: Kind: S_GPROC32_ID (0x1147)
@@ -170,7 +170,7 @@
; ASM: .asciz "pad_left" # Function name
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "o"
-; ASM: .cv_def_range [[pad_left_tmp]] [[pad_left_tmp]], subfield_reg, 17, 0
+; ASM: .cv_def_range [[pad_left_tmp]] [[pad_left_tmp]], "C\021\021\000\000\000\000\000\000\000"
; OBJ-LABEL: GlobalProcIdSym {
; OBJ: Kind: S_GPROC32_ID (0x1147)
@@ -193,10 +193,10 @@
; ASM: .asciz "nested" # Function name
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "o"
-; ASM: .cv_def_range .Lfunc_begin3 .Lfunc_end3, reg_rel, 330, 0, 0
+; ASM: .cv_def_range .Lfunc_begin3 .Lfunc_end3, "E\021J\001\000\000\000\000\000\000"
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "p"
-; ASM: .cv_def_range [[p_start]] .Lfunc_end3, subfield_reg, 17, 4
+; ASM: .cv_def_range [[p_start]] .Lfunc_end3, "C\021\021\000\000\000\004\000\000\000"
; OBJ-LABEL: GlobalProcIdSym {
; OBJ: Kind: S_GPROC32_ID (0x1147)
@@ -232,7 +232,7 @@
; ASM: .asciz "bitpiece_spill" # Function name
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "o"
-; ASM: .cv_def_range [[spill_o_x_start]] .Lfunc_end4, reg_rel, 335, 65, 36
+; ASM: .cv_def_range [[spill_o_x_start]] .Lfunc_end4, "E\021O\001A\000$\000\000\000"
; OBJ-LABEL: GlobalProcIdSym {
; OBJ: Kind: S_GPROC32_ID (0x1147)
Modified: llvm/trunk/test/DebugInfo/COFF/register-variables.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/register-variables.ll?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/register-variables.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/register-variables.ll Mon Aug 5 06:55:21 2019
@@ -58,25 +58,25 @@
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "p"
-; ASM: .cv_def_range .Lfunc_begin0 [[p_ecx_esi]], reg, 18
-; ASM: .cv_def_range [[p_ecx_esi]] [[func_end]], reg, 23
+; ASM: .cv_def_range .Lfunc_begin0 [[p_ecx_esi]], "A\021\022\000\000\000"
+; ASM: .cv_def_range [[p_ecx_esi]] [[func_end]], "A\021\027\000\000\000"
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "c"
-; ASM: .cv_def_range [[after_getint]] [[after_je]], reg, 17
+; ASM: .cv_def_range [[after_getint]] [[after_je]], "A\021\021\000\000\000"
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "a"
-; ASM: .cv_def_range [[after_getint]] [[after_inc_eax]], reg, 17
+; ASM: .cv_def_range [[after_getint]] [[after_inc_eax]], "A\021\021\000\000\000"
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "b"
-; ASM: .cv_def_range [[after_inc_eax]] [[after_if]], reg, 17
+; ASM: .cv_def_range [[after_inc_eax]] [[after_if]], "A\021\021\000\000\000"
; ASM: .short 4429 # Record kind: S_INLINESITE
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "a"
-; ASM: .cv_def_range [[after_getint]] [[after_inc_eax]], reg, 17
+; ASM: .cv_def_range [[after_getint]] [[after_inc_eax]], "A\021\021\000\000\000"
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "b"
-; ASM: .cv_def_range [[after_inc_eax]] [[after_if]], reg, 17
+; ASM: .cv_def_range [[after_inc_eax]] [[after_if]], "A\021\021\000\000\000"
; ASM: .short 4430 # Record kind: S_INLINESITE_END
; OBJ: Subsection [
Modified: llvm/trunk/test/MC/COFF/cv-def-range-align.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/cv-def-range-align.s?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/test/MC/COFF/cv-def-range-align.s (original)
+++ llvm/trunk/test/MC/COFF/cv-def-range-align.s Mon Aug 5 06:55:21 2019
@@ -97,7 +97,7 @@ max:
# BUG
.p2align 2
.Ltmp13:
- .cv_def_range .Ltmp0 .Ltmp1, frame_ptr_rel, 8
+ .cv_def_range .Ltmp0 .Ltmp1, "B\021\000\000\000\000"
.short .Ltmp15-.Ltmp14 # Record length
.Ltmp14:
.short 4414 # Record kind: S_LOCAL
@@ -107,7 +107,7 @@ max:
# BUG
.p2align 2
.Ltmp15:
- .cv_def_range .Ltmp0 .Ltmp1, frame_ptr_rel, 8
+ .cv_def_range .Ltmp0 .Ltmp1, "B\021\004\000\000\000"
.short 2 # Record length
.short 4431 # Record kind: S_PROC_ID_END
.Ltmp7:
Modified: llvm/trunk/test/MC/COFF/cv-def-range-gap.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/cv-def-range-gap.s?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/test/MC/COFF/cv-def-range-gap.s (original)
+++ llvm/trunk/test/MC/COFF/cv-def-range-gap.s Mon Aug 5 06:55:21 2019
@@ -120,8 +120,8 @@ f:
.short 0 # Flags
.asciz "p"
.Ltmp19:
- .cv_def_range .Lbegin0 .Lend0 .Lbegin1 .Lend1 .Lbegin2 .Lend2 .Lbegin3 .Lend3, reg, 23
- .cv_def_range .Lbegin4 .Lend4 .Lbegin5 .Lend5, reg, 23
+ .cv_def_range .Lbegin0 .Lend0 .Lbegin1 .Lend1 .Lbegin2 .Lend2 .Lbegin3 .Lend3, "A\021\027\000\000\000"
+ .cv_def_range .Lbegin4 .Lend4 .Lbegin5 .Lend5, "A\021\027\000\000\000"
.short 2 # Record length
.short 4431 # Record kind: S_PROC_ID_END
.Ltmp15:
Modified: llvm/trunk/test/MC/COFF/cv-def-range.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/cv-def-range.s?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/test/MC/COFF/cv-def-range.s (original)
+++ llvm/trunk/test/MC/COFF/cv-def-range.s Mon Aug 5 06:55:21 2019
@@ -75,7 +75,7 @@ Ltmp2:
Ltmp3:
.short 2 # Record length
.short 4431 # Record kind: S_PROC_ID_END
- .cv_def_range Lvar_begin0 Lvar_end0, frame_ptr_rel, -4
+ .cv_def_range Lvar_begin0 Lvar_end0, "\102\021\374\377\377\377"
# CHECK: DefRangeFramePointerRelSym {
# CHECK: Offset: -4
Modified: llvm/trunk/tools/llvm-pdbutil/MinimalSymbolDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbutil/MinimalSymbolDumper.cpp?rev=367861&r1=367860&r2=367861&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbutil/MinimalSymbolDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbutil/MinimalSymbolDumper.cpp Mon Aug 5 06:55:21 2019
@@ -569,9 +569,8 @@ Error MinimalSymbolDumper::visitKnownRec
Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
DefRangeFramePointerRelSym &Def) {
AutoIndent Indent(P, 7);
- P.formatLine("offset = {0}, range = {1}", Def.Hdr.Offset,
- formatRange(Def.Range));
- P.formatLine("gaps = {2}", Def.Hdr.Offset,
+ P.formatLine("offset = {0}, range = {1}", Def.Offset, formatRange(Def.Range));
+ P.formatLine("gaps = {2}", Def.Offset,
formatGaps(P.getIndentLevel() + 9, Def.Gaps));
return Error::success();
}
More information about the llvm-commits
mailing list