Report an error if --compress-debug-sections is given while zlib is not availble.

llvm-svn: 301757
This commit is contained in:
Rui Ueyama 2017-04-29 22:56:24 +00:00
parent 887a141d4d
commit 543161a10c
1 changed files with 8 additions and 8 deletions

View File

@ -594,14 +594,14 @@ static std::vector<StringRef> getLines(MemoryBufferRef MB) {
}
static bool getCompressDebugSections(opt::InputArgList &Args) {
if (auto *Arg = Args.getLastArg(OPT_compress_debug_sections)) {
StringRef S = Arg->getValue();
if (S == "zlib")
return zlib::isAvailable();
if (S != "none")
error("unknown --compress-debug-sections value: " + S);
}
return false;
StringRef S = getString(Args, OPT_compress_debug_sections, "none");
if (S == "none")
return false;
if (S != "zlib")
error("unknown --compress-debug-sections value: " + S);
if (!zlib::isAvailable())
error("--compress-debug-sections: zlib is not available");
return true;
}
// Initializes Config members by the command line options.