diff options
| author | Nilanjana Basu <nilanjana.basu87@gmail.com> | 2019-08-02 18:44:39 +0000 | 
|---|---|---|
| committer | Nilanjana Basu <nilanjana.basu87@gmail.com> | 2019-08-02 18:44:39 +0000 | 
| commit | 1c67521591a7b63bcba11fa0c45f8465cb6d2e82 (patch) | |
| tree | de7c93804559d020d9a7b8e75db38b75b585f420 /llvm/lib/CodeGen/AsmPrinter | |
| parent | 9f057853580ff3853a789daea2b3df7d7bd09851 (diff) | |
| download | bcm5719-llvm-1c67521591a7b63bcba11fa0c45f8465cb6d2e82.tar.gz bcm5719-llvm-1c67521591a7b63bcba11fa0c45f8465cb6d2e82.zip  | |
Changing representation of cv_def_range directives in Codeview debug info assembly format for better readability
llvm-svn: 367704
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 23 | 
1 files changed, 6 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index b3dabca0a8a..ea836469771 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -2633,17 +2633,6 @@ void CodeViewDebug::emitLocalVariableList(const FunctionInfo &FI,        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. @@ -2692,8 +2681,9 @@ void CodeViewDebug::emitLocalVariable(const FunctionInfo &FI,            (bool(Flags & LocalSymFlags::IsParameter)                 ? (EncFP == FI.EncodedParamFramePtrReg)                 : (EncFP == FI.EncodedLocalFramePtrReg))) { -        little32_t FPOffset = little32_t(Offset); -        copyBytesForDefRange(BytePrefix, S_DEFRANGE_FRAMEPOINTER_REL, FPOffset); +        DefRangeFramePointerRelSym::Header DRHdr; +        DRHdr.Offset = Offset; +        OS.EmitCVDefRangeDirective(DefRange.Ranges, DRHdr);        } else {          uint16_t RegRelFlags = 0;          if (DefRange.IsSubfield) { @@ -2705,7 +2695,7 @@ void CodeViewDebug::emitLocalVariable(const FunctionInfo &FI,          DRHdr.Register = Reg;          DRHdr.Flags = RegRelFlags;          DRHdr.BasePointerOffset = Offset; -        copyBytesForDefRange(BytePrefix, S_DEFRANGE_REGISTER_REL, DRHdr); +        OS.EmitCVDefRangeDirective(DefRange.Ranges, DRHdr);        }      } else {        assert(DefRange.DataOffset == 0 && "unexpected offset into register"); @@ -2714,15 +2704,14 @@ void CodeViewDebug::emitLocalVariable(const FunctionInfo &FI,          DRHdr.Register = DefRange.CVRegister;          DRHdr.MayHaveNoName = 0;          DRHdr.OffsetInParent = DefRange.StructOffset; -        copyBytesForDefRange(BytePrefix, S_DEFRANGE_SUBFIELD_REGISTER, DRHdr); +        OS.EmitCVDefRangeDirective(DefRange.Ranges, DRHdr);        } else {          DefRangeRegisterSym::Header DRHdr;          DRHdr.Register = DefRange.CVRegister;          DRHdr.MayHaveNoName = 0; -        copyBytesForDefRange(BytePrefix, S_DEFRANGE_REGISTER, DRHdr); +        OS.EmitCVDefRangeDirective(DefRange.Ranges, DRHdr);        }      } -    OS.EmitCVDefRangeDirective(DefRange.Ranges, BytePrefix);    }  }  | 

