[llvm] r258030 - minor comment clean and add a method \NFC

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 17 16:26:33 PST 2016


Author: davidxl
Date: Sun Jan 17 18:26:33 2016
New Revision: 258030

URL: http://llvm.org/viewvc/llvm-project?rev=258030&view=rev
Log:
minor comment clean and add a method \NFC

Modified:
    llvm/trunk/include/llvm/ProfileData/InstrProf.h

Modified: llvm/trunk/include/llvm/ProfileData/InstrProf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProf.h?rev=258030&r1=258029&r2=258030&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/InstrProf.h (original)
+++ llvm/trunk/include/llvm/ProfileData/InstrProf.h Sun Jan 17 18:26:33 2016
@@ -186,10 +186,8 @@ int collectPGOFuncNameStrings(const std:
                               std::string &Result);
 class InstrProfSymtab;
 /// \c NameStrings is a string composed of one of more sub-strings encoded in
-/// the
-/// format described above. The substrings are seperated by 0 or more zero
-/// bytes.
-/// This method decodes the string and populates the \c Symtab.
+/// the format described above. The substrings are seperated by 0 or more zero
+/// bytes. This method decodes the string and populates the \c Symtab.
 int readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab);
 
 const std::error_category &instrprof_category();
@@ -261,16 +259,18 @@ public:
   InstrProfSymtab() : Data(), Address(0), HashNameMap(), AddrToMD5Map() {}
 
   /// Create InstrProfSymtab from an object file section which
-  /// contains function PGO names that are uncompressed.
-  /// This interface is used by CoverageMappingReader.
+  /// contains function PGO names. When section may contain raw 
+  /// 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);
   /// This interface is used by reader of CoverageMapping test
   /// format.
   inline std::error_code create(StringRef D, uint64_t BaseAddr);
   /// \c NameStrings is a string composed of one of more sub-strings
-  ///  encoded in the format described above. The substrings are
-  /// seperated by 0 or more zero bytes. This method decodes the
-  /// string and populates the \c Symtab.
+  ///  encoded in the format described in \c collectPGOFuncNameStrings.
+  /// This method is a wrapper to \c readPGOFuncNameStrings method.
   inline std::error_code create(StringRef NameStrings);
   /// Create InstrProfSymtab from a set of names iteratable from
   /// \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.
   /// If not found, return an empty string.
   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) {




More information about the llvm-commits mailing list