minor comment clean and add a method \NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258030 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Xinliang David Li 2016-01-18 00:26:33 +00:00
parent 6edebba796
commit 5ee0210144

View File

@ -186,10 +186,8 @@ int collectPGOFuncNameStrings(const std::vector<GlobalVariable *> &NameVars,
std::string &Result); std::string &Result);
class InstrProfSymtab; class InstrProfSymtab;
/// \c NameStrings is a string composed of one of more sub-strings encoded in /// \c NameStrings is a string composed of one of more sub-strings encoded in
/// the /// the format described above. The substrings are seperated by 0 or more zero
/// format described above. The substrings are seperated by 0 or more zero /// bytes. This method decodes the string and populates the \c Symtab.
/// bytes.
/// This method decodes the string and populates the \c Symtab.
int readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab); int readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab);
const std::error_category &instrprof_category(); const std::error_category &instrprof_category();
@ -261,16 +259,18 @@ public:
InstrProfSymtab() : Data(), Address(0), HashNameMap(), AddrToMD5Map() {} InstrProfSymtab() : Data(), Address(0), HashNameMap(), AddrToMD5Map() {}
/// Create InstrProfSymtab from an object file section which /// Create InstrProfSymtab from an object file section which
/// contains function PGO names that are uncompressed. /// contains function PGO names. When section may contain raw
/// This interface is used by CoverageMappingReader. /// string data or string data in compressed form. This method
/// only initialize the symtab with reference to the data and
/// the section base address. The decompression will be delayed
/// until before it is used. See also \c create(StringRef) method.
std::error_code create(object::SectionRef &Section); std::error_code create(object::SectionRef &Section);
/// This interface is used by reader of CoverageMapping test /// This interface is used by reader of CoverageMapping test
/// format. /// format.
inline std::error_code create(StringRef D, uint64_t BaseAddr); inline std::error_code create(StringRef D, uint64_t BaseAddr);
/// \c NameStrings is a string composed of one of more sub-strings /// \c NameStrings is a string composed of one of more sub-strings
/// encoded in the format described above. The substrings are /// encoded in the format described in \c collectPGOFuncNameStrings.
/// seperated by 0 or more zero bytes. This method decodes the /// This method is a wrapper to \c readPGOFuncNameStrings method.
/// string and populates the \c Symtab.
inline std::error_code create(StringRef NameStrings); inline std::error_code create(StringRef NameStrings);
/// Create InstrProfSymtab from a set of names iteratable from /// Create InstrProfSymtab from a set of names iteratable from
/// \p IterRange. This interface is used by IndexedProfReader. /// \p IterRange. This interface is used by IndexedProfReader.
@ -299,6 +299,8 @@ public:
/// Return function's PGO name from the name's md5 hash value. /// Return function's PGO name from the name's md5 hash value.
/// If not found, return an empty string. /// If not found, return an empty string.
inline StringRef getFuncName(uint64_t FuncMD5Hash); inline StringRef getFuncName(uint64_t FuncMD5Hash);
/// Return the name section data.
inline StringRef getNameData() const { return Data; }
}; };
std::error_code InstrProfSymtab::create(StringRef D, uint64_t BaseAddr) { std::error_code InstrProfSymtab::create(StringRef D, uint64_t BaseAddr) {