[lld] r312962 - Make the scope of an anonymous namespace as narrow as possible.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 15:04:13 PDT 2017


Author: ruiu
Date: Mon Sep 11 15:04:13 2017
New Revision: 312962

URL: http://llvm.org/viewvc/llvm-project?rev=312962&view=rev
Log:
Make the scope of an anonymous namespace as narrow as possible.

Modified:
    lld/trunk/MinGW/Driver.cpp

Modified: lld/trunk/MinGW/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/MinGW/Driver.cpp?rev=312962&r1=312961&r2=312962&view=diff
==============================================================================
--- lld/trunk/MinGW/Driver.cpp (original)
+++ lld/trunk/MinGW/Driver.cpp Mon Sep 11 15:04:13 2017
@@ -30,8 +30,6 @@
 using namespace lld;
 using namespace llvm;
 
-namespace {
-
 // Create OptTable
 enum {
   OPT_INVALID = 0,
@@ -41,7 +39,7 @@ enum {
 };
 
 // Create prefix string literals used in Options.td
-#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE;
+#define PREFIX(NAME, VALUE) static const char *const NAME[] = VALUE;
 #include "Options.inc"
 #undef PREFIX
 
@@ -54,12 +52,12 @@ static const opt::OptTable::Info InfoTab
 #undef OPTION
 };
 
+namespace {
 class COFFLdOptTable : public opt::OptTable {
 public:
   COFFLdOptTable() : OptTable(InfoTable, false) {}
   opt::InputArgList parse(ArrayRef<const char *> Argv);
 };
-
 } // namespace
 
 LLVM_ATTRIBUTE_NORETURN static void error(const Twine &Msg) {




More information about the llvm-commits mailing list