summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-04-29 22:56:24 +0000
committerRui Ueyama <ruiu@google.com>2017-04-29 22:56:24 +0000
commit543161a10c7597a3d436d53fda746a44a261dff9 (patch)
treed1c73e47adaa50aa203c58536bc488f036f2b688
parent887a141d4d6f5835c931ddff4e733514099deb16 (diff)
downloadbcm5719-llvm-543161a10c7597a3d436d53fda746a44a261dff9.tar.gz
bcm5719-llvm-543161a10c7597a3d436d53fda746a44a261dff9.zip
Report an error if --compress-debug-sections is given while zlib is not availble.
llvm-svn: 301757
-rw-r--r--lld/ELF/Driver.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index d6aa946d327..8b390a164ff 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -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.
OpenPOWER on IntegriCloud