From 7c39439956717d83f7a99e653a64714209d9b497 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 20 May 2016 22:59:05 +0000 Subject: [PATCH] Fix struct member names and simplify. NFC. llvm-svn: 270289 --- lib/DebugInfo/PDB/Raw/SymbolStream.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/DebugInfo/PDB/Raw/SymbolStream.cpp b/lib/DebugInfo/PDB/Raw/SymbolStream.cpp index adf5412e8ca..bd4280f3492 100644 --- a/lib/DebugInfo/PDB/Raw/SymbolStream.cpp +++ b/lib/DebugInfo/PDB/Raw/SymbolStream.cpp @@ -35,7 +35,7 @@ struct DataSym32 { ulittle32_t TypIndex; // Type index, or Metadata token if a managed symbol ulittle32_t off; ulittle16_t seg; - char name[1]; + char Name[1]; }; // For S_PROCREF symbol type. @@ -43,7 +43,7 @@ struct RefSym { ulittle32_t SumName; // SUC of the name (?) ulittle32_t SymOffset; // Offset of actual symbol in $$Symbols ulittle16_t Mod; // Module containing the actual symbol - char name[1]; + char Name[1]; }; } @@ -54,8 +54,6 @@ SymbolStream::~SymbolStream() {} Error SymbolStream::reload() { return Error::success(); } -static StringRef makeStringRef(char *p) { return {p, strlen(p)}; } - Expected SymbolStream::getSymbolName(uint32_t Off) const { StreamReader Reader(Stream); Reader.setOffset(Off); @@ -74,9 +72,9 @@ Expected SymbolStream::getSymbolName(uint32_t Off) const { switch (Hdr.Type) { case codeview::S_PUB32: - return makeStringRef(reinterpret_cast(Buf.data())->name); + return reinterpret_cast(Buf.data())->Name; case codeview::S_PROCREF: - return makeStringRef(reinterpret_cast(Buf.data())->name); + return reinterpret_cast(Buf.data())->Name; default: return make_error(raw_error_code::corrupt_file, "Unknown symbol type");