diff options
author | Xinliang David Li <davidxl@google.com> | 2016-01-26 23:13:00 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-01-26 23:13:00 +0000 |
commit | 731637567ea41ca6fc3552863db2c294ea654699 (patch) | |
tree | e76cd98bf8fe1c71885f38878ca09e4b44e19ec2 | |
parent | 1c93b4cd7b1974c742a5e763c6cd4b25207544c4 (diff) | |
download | bcm5719-llvm-731637567ea41ca6fc3552863db2c294ea654699.tar.gz bcm5719-llvm-731637567ea41ca6fc3552863db2c294ea654699.zip |
[PGO] allow pgo name collector to disable compression (for testing)/NFC
llvm-svn: 258876
-rw-r--r-- | llvm/include/llvm/ProfileData/InstrProf.h | 2 | ||||
-rw-r--r-- | llvm/lib/ProfileData/InstrProf.cpp | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/llvm/include/llvm/ProfileData/InstrProf.h b/llvm/include/llvm/ProfileData/InstrProf.h index 037c3fea8a2..d3305f78ada 100644 --- a/llvm/include/llvm/ProfileData/InstrProf.h +++ b/llvm/include/llvm/ProfileData/InstrProf.h @@ -185,7 +185,7 @@ int collectPGOFuncNameStrings(const std::vector<std::string> &NameStrs, /// Produce \c Result string with the same format described above. The input /// is vector of PGO function name variables that are referenced. int collectPGOFuncNameStrings(const std::vector<GlobalVariable *> &NameVars, - std::string &Result); + std::string &Result, bool doCompression = true); 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 diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index 00deec6f8e8..0ccc16252c2 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -216,12 +216,13 @@ StringRef getPGOFuncNameInitializer(GlobalVariable *NameVar) { } int collectPGOFuncNameStrings(const std::vector<GlobalVariable *> &NameVars, - std::string &Result) { + std::string &Result, bool doCompression) { std::vector<std::string> NameStrs; for (auto *NameVar : NameVars) { NameStrs.push_back(getPGOFuncNameInitializer(NameVar)); } - return collectPGOFuncNameStrings(NameStrs, zlib::isAvailable(), Result); + return collectPGOFuncNameStrings( + NameStrs, zlib::isAvailable() && doCompression, Result); } int readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab) { |