[llvm] r341584 - [llvm-dwp] Use cl:: instead of using namespace cl
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 6 13:23:34 PDT 2018
Author: maskray
Date: Thu Sep 6 13:23:34 2018
New Revision: 341584
URL: http://llvm.org/viewvc/llvm-project?rev=341584&view=rev
Log:
[llvm-dwp] Use cl:: instead of using namespace cl
`using namespace cl` makes llvm::cl::Optional (in Support/CommandLine.h) visible which will cause ambiguity when unqualified `Optional` is looked up (can also refer to llvm::Optional).
cl:: is used much more than `using namespace cl`, so let's not use the latter.
Also append \n to the argument of cl::ParseCommandLineOptions
Modified:
llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
Modified: llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp?rev=341584&r1=341583&r2=341584&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp (original)
+++ llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp Thu Sep 6 13:23:34 2018
@@ -43,21 +43,21 @@
using namespace llvm;
using namespace llvm::object;
-using namespace cl;
-OptionCategory DwpCategory("Specific Options");
-static list<std::string> InputFiles(Positional, ZeroOrMore,
- desc("<input files>"), cat(DwpCategory));
-
-static list<std::string> ExecFilenames(
- "e", ZeroOrMore,
- desc("Specify the executable/library files to get the list of *.dwo from"),
- value_desc("filename"), cat(DwpCategory));
-
-static opt<std::string> OutputFilename(Required, "o",
- desc("Specify the output file."),
- value_desc("filename"),
- cat(DwpCategory));
+cl::OptionCategory DwpCategory("Specific Options");
+static cl::list<std::string> InputFiles(cl::Positional, cl::ZeroOrMore,
+ cl::desc("<input files>"),
+ cl::cat(DwpCategory));
+
+static cl::list<std::string> ExecFilenames(
+ "e", cl::ZeroOrMore,
+ cl::desc("Specify the executable/library files to get the list of *.dwo from"),
+ cl::value_desc("filename"), cl::cat(DwpCategory));
+
+static cl::opt<std::string> OutputFilename(cl::Required, "o",
+ cl::desc("Specify the output file."),
+ cl::value_desc("filename"),
+ cl::cat(DwpCategory));
static void writeStringsAndOffsets(MCStreamer &Out, DWPStringPool &Strings,
MCSection *StrOffsetSection,
@@ -644,7 +644,7 @@ static int error(const Twine &Error, con
int main(int argc, char **argv) {
InitLLVM X(argc, argv);
- ParseCommandLineOptions(argc, argv, "merge split dwarf (.dwo) files");
+ cl::ParseCommandLineOptions(argc, argv, "merge split dwarf (.dwo) files\n");
llvm::InitializeAllTargetInfos();
llvm::InitializeAllTargetMCs();
More information about the llvm-commits
mailing list