summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/ProfileData/InstrProf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/lib/ProfileData/InstrProf.cpp')
-rw-r--r--gnu/llvm/lib/ProfileData/InstrProf.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/gnu/llvm/lib/ProfileData/InstrProf.cpp b/gnu/llvm/lib/ProfileData/InstrProf.cpp
index 48c1643cb13..8ab5df59f53 100644
--- a/gnu/llvm/lib/ProfileData/InstrProf.cpp
+++ b/gnu/llvm/lib/ProfileData/InstrProf.cpp
@@ -56,7 +56,7 @@
using namespace llvm;
static cl::opt<bool> StaticFuncFullModulePrefix(
- "static-func-full-module-prefix", cl::init(true),
+ "static-func-full-module-prefix", cl::init(true), cl::Hidden,
cl::desc("Use full module build paths in the profile counter names for "
"static functions."));
@@ -69,7 +69,7 @@ static cl::opt<bool> StaticFuncFullModulePrefix(
// the source directory name not being stripped. A non-zero option value here
// can potentially prevent some inter-module indirect-call-promotions.
static cl::opt<unsigned> StaticFuncStripDirNamePrefix(
- "static-func-strip-dirname-prefix", cl::init(0),
+ "static-func-strip-dirname-prefix", cl::init(0), cl::Hidden,
cl::desc("Strip specified level of directory name from source path in "
"the profile counter name for static functions."));
@@ -111,6 +111,8 @@ static std::string getInstrProfErrString(instrprof_error Err) {
return "Failed to uncompress data (zlib)";
case instrprof_error::empty_raw_profile:
return "Empty raw profile file";
+ case instrprof_error::zlib_unavailable:
+ return "Profile uses zlib compression but the profile reader was built without zlib support";
}
llvm_unreachable("A value of instrprof_error has no message.");
}
@@ -430,6 +432,9 @@ Error readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab) {
SmallString<128> UncompressedNameStrings;
StringRef NameStrings;
if (isCompressed) {
+ if (!llvm::zlib::isAvailable())
+ return make_error<InstrProfError>(instrprof_error::zlib_unavailable);
+
StringRef CompressedNameStrings(reinterpret_cast<const char *>(P),
CompressedSize);
if (Error E =