[lld] r316180 - [COFF] Avoid forward declaring StringSet, fix build

Martin Storsjo via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 13:19:16 PDT 2017


Author: mstorsjo
Date: Thu Oct 19 13:19:16 2017
New Revision: 316180

URL: http://llvm.org/viewvc/llvm-project?rev=316180&view=rev
Log:
[COFF] Avoid forward declaring StringSet, fix build

This should fix the build after SVN r316178, which worked fine
on GCC 5.4, but failed on clang with errors like these:

MinGW.h:26:3: error: too few template arguments for class template 'StringSet'
  StringSet<> ExcludeSymbols;
  ^
lld/Common/LLVM.h:28:30: note: template is declared here
  template<typename T> class StringSet;

Don't forward declare and add the using directive in the main
lld/Common/LLVM.h header, but just qualify the class name
in MinGW.h instead.

Modified:
    lld/trunk/COFF/MinGW.h
    lld/trunk/include/lld/Common/LLVM.h

Modified: lld/trunk/COFF/MinGW.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/MinGW.h?rev=316180&r1=316179&r2=316180&view=diff
==============================================================================
--- lld/trunk/COFF/MinGW.h (original)
+++ lld/trunk/COFF/MinGW.h Thu Oct 19 13:19:16 2017
@@ -23,9 +23,9 @@ class AutoExporter {
 public:
   AutoExporter();
 
-  StringSet<> ExcludeSymbols;
-  StringSet<> ExcludeLibs;
-  StringSet<> ExcludeObjects;
+  llvm::StringSet<> ExcludeSymbols;
+  llvm::StringSet<> ExcludeLibs;
+  llvm::StringSet<> ExcludeObjects;
 
   bool shouldExport(Defined *Sym) const;
 };

Modified: lld/trunk/include/lld/Common/LLVM.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Common/LLVM.h?rev=316180&r1=316179&r2=316180&view=diff
==============================================================================
--- lld/trunk/include/lld/Common/LLVM.h (original)
+++ lld/trunk/include/lld/Common/LLVM.h Thu Oct 19 13:19:16 2017
@@ -25,7 +25,6 @@ namespace llvm {
   // ADT's.
   class Error;
   class StringRef;
-  template<typename T> class StringSet;
   class Twine;
   class MemoryBuffer;
   class MemoryBufferRef;
@@ -58,7 +57,6 @@ namespace lld {
   // ADT's.
   using llvm::Error;
   using llvm::StringRef;
-  using llvm::StringSet;
   using llvm::Twine;
   using llvm::MemoryBuffer;
   using llvm::MemoryBufferRef;




More information about the llvm-commits mailing list