r344337 - Remove top-level using declaration from header files, as these aliases leak.

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 12 10:09:59 PDT 2018


Hi Sam,

Your change is causing build failures on the PS4 Windows bot. Can you take a look?

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20638
FAILED: tools/clang/lib/Driver/CMakeFiles/clangDriver.dir/Compilation.cpp.obj 
C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_LARGEFILE_SOURCE -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\clang\lib\Driver -IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\lib\Driver -IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\include -Itools\clang\include -Iinclude -IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /MD /O2 /Ob2   -UNDEBUG  /EHs-c- /GR- /showIncludes /Fotools\clang\lib\Driver\CMakeFiles\clangDriver.dir\Compilation.cpp.obj /Fdtools\clang\lib\Driver\CMakeFiles\clangDriver.dir\clangDriver.pdb /FS -c C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\lib\Driver\Compilation.cpp
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\lib\Driver\Compilation.cpp(130): error C2872: 'ArgStringList': ambiguous symbol
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\include\clang/Driver/Job.h(33): note: could be 'llvm::opt::ArgStringList clang::driver::ArgStringList'
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\include\llvm/Option/Option.h(31): note: or       'llvm::opt::ArgStringList'

Douglas Yung

-----Original Message-----
From: cfe-commits [mailto:cfe-commits-bounces at lists.llvm.org] On Behalf Of Sam McCall via cfe-commits
Sent: Friday, October 12, 2018 5:22 AM
To: cfe-commits at lists.llvm.org
Subject: r344337 - Remove top-level using declaration from header files, as these aliases leak.

Author: sammccall
Date: Fri Oct 12 05:21:29 2018
New Revision: 344337

URL: http://llvm.org/viewvc/llvm-project?rev=344337&view=rev
Log:
Remove top-level using declaration from header files, as these aliases leak.

Reviewers: ilya-biryukov

Subscribers: arphaman, cfe-commits

Differential Revision: https://reviews.llvm.org/D53135

Modified:
    cfe/trunk/include/clang/Driver/Job.h
    cfe/trunk/include/clang/Frontend/PCHContainerOperations.h
    cfe/trunk/include/clang/Serialization/GlobalModuleIndex.h
    cfe/trunk/lib/Frontend/FrontendAction.cpp
    cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h
    cfe/trunk/utils/TableGen/TableGenBackends.h

Modified: cfe/trunk/include/clang/Driver/Job.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Job.h?rev=344337&r1=344336&r2=344337&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Job.h (original)
+++ cfe/trunk/include/clang/Driver/Job.h Fri Oct 12 05:21:29 2018
@@ -30,7 +30,7 @@ class InputInfo;
 class Tool;
 
 // Re-export this as clang::driver::ArgStringList.
-using llvm::opt::ArgStringList;
+using ArgStringList = llvm::opt::ArgStringList;
 
 struct CrashReportInfo {
   StringRef Filename;

Modified: cfe/trunk/include/clang/Frontend/PCHContainerOperations.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/PCHContainerOperations.h?rev=344337&r1=344336&r2=344337&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/PCHContainerOperations.h (original)
+++ cfe/trunk/include/clang/Frontend/PCHContainerOperations.h Fri Oct 12 
+++ 05:21:29 2018
@@ -20,8 +20,6 @@ namespace llvm {
 class raw_pwrite_stream;
 }
 
-using llvm::StringRef;
-
 namespace clang {
 
 class ASTConsumer;
@@ -41,7 +39,7 @@ struct PCHBuffer {
 class PCHContainerWriter {
 public:
   virtual ~PCHContainerWriter() = 0;
-  virtual StringRef getFormat() const = 0;
+  virtual llvm::StringRef getFormat() const = 0;
 
   /// Return an ASTConsumer that can be chained with a
   /// PCHGenerator that produces a wrapper file format containing a @@ -61,15 +59,15 @@ class PCHContainerReader {
 public:
   virtual ~PCHContainerReader() = 0;
   /// Equivalent to the format passed to -fmodule-format=
-  virtual StringRef getFormat() const = 0;
+  virtual llvm::StringRef getFormat() const = 0;
 
   /// Returns the serialized AST inside the PCH container Buffer.
-  virtual StringRef ExtractPCH(llvm::MemoryBufferRef Buffer) const = 0;
+  virtual llvm::StringRef ExtractPCH(llvm::MemoryBufferRef Buffer) 
+ const = 0;
 };
 
 /// Implements write operations for a raw pass-through PCH container.
 class RawPCHContainerWriter : public PCHContainerWriter {
-  StringRef getFormat() const override { return "raw"; }
+  llvm::StringRef getFormat() const override { return "raw"; }
 
   /// Return an ASTConsumer that can be chained with a
   /// PCHGenerator that writes the module to a flat file.
@@ -83,10 +81,10 @@ class RawPCHContainerWriter : public PCH
 
 /// Implements read operations for a raw pass-through PCH container.
 class RawPCHContainerReader : public PCHContainerReader {
-  StringRef getFormat() const override { return "raw"; }
+  llvm::StringRef getFormat() const override { return "raw"; }
 
   /// Simply returns the buffer contained in Buffer.
-  StringRef ExtractPCH(llvm::MemoryBufferRef Buffer) const override;
+  llvm::StringRef ExtractPCH(llvm::MemoryBufferRef Buffer) const 
+ override;
 };
 
 /// A registry of PCHContainerWriter and -Reader objects for different formats.
@@ -103,10 +101,10 @@ public:
   void registerReader(std::unique_ptr<PCHContainerReader> Reader) {
     Readers[Reader->getFormat()] = std::move(Reader);
   }
-  const PCHContainerWriter *getWriterOrNull(StringRef Format) {
+  const PCHContainerWriter *getWriterOrNull(llvm::StringRef Format) {
     return Writers[Format].get();
   }
-  const PCHContainerReader *getReaderOrNull(StringRef Format) {
+  const PCHContainerReader *getReaderOrNull(llvm::StringRef Format) {
     return Readers[Format].get();
   }
   const PCHContainerReader &getRawReader() {

Modified: cfe/trunk/include/clang/Serialization/GlobalModuleIndex.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/GlobalModuleIndex.h?rev=344337&r1=344336&r2=344337&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/GlobalModuleIndex.h (original)
+++ cfe/trunk/include/clang/Serialization/GlobalModuleIndex.h Fri Oct 12 
+++ 05:21:29 2018
@@ -42,11 +42,6 @@ namespace serialization {
   class ModuleFile;
 }
 
-using llvm::SmallVector;
-using llvm::SmallVectorImpl;
-using llvm::StringRef;
-using serialization::ModuleFile;
-
 /// A global index for a set of module files, providing information about  /// the identifiers within those module files.
 ///
@@ -59,6 +54,8 @@ using serialization::ModuleFile;  /// imported, and can be queried to determine which modules the current  /// translation could or should load to fix a problem.
 class GlobalModuleIndex {
+  using ModuleFile = serialization::ModuleFile;
+
   /// Buffer containing the index file, which is lazily accessed so long
   /// as the global module index is live.
   std::unique_ptr<llvm::MemoryBuffer> Buffer; @@ -147,7 +144,7 @@ public:
   /// \returns A pair containing the global module index (if it exists) and
   /// the error code.
   static std::pair<GlobalModuleIndex *, ErrorCode>
-  readIndex(StringRef Path);
+  readIndex(llvm::StringRef Path);
 
   /// Returns an iterator for identifiers stored in the index table.
   ///
@@ -158,12 +155,12 @@ public:
   ///
   /// \param ModuleFiles Will be populated with the set of module files that
   /// have been indexed.
-  void getKnownModules(SmallVectorImpl<ModuleFile *> &ModuleFiles);
+  void getKnownModules(llvm::SmallVectorImpl<ModuleFile *> 
+ &ModuleFiles);
 
   /// Retrieve the set of module files on which the given module file
   /// directly depends.
   void getModuleDependencies(ModuleFile *File,
-                             SmallVectorImpl<ModuleFile *> &Dependencies);
+                             llvm::SmallVectorImpl<ModuleFile *> 
+ &Dependencies);
 
   /// A set of module files in which we found a result.
   typedef llvm::SmallPtrSet<ModuleFile *, 4> HitSet; @@ -177,7 +174,7 @@ public:
   /// information about this name.
   ///
   /// \returns true if the identifier is known to the index, false otherwise.
-  bool lookupIdentifier(StringRef Name, HitSet &Hits);
+  bool lookupIdentifier(llvm::StringRef Name, HitSet &Hits);
 
   /// Note that the given module file has been loaded.
   ///
@@ -200,7 +197,7 @@ public:
   /// which the global index will be written.
   static ErrorCode writeIndex(FileManager &FileMgr,
                               const PCHContainerReader &PCHContainerRdr,
-                              StringRef Path);
+                              llvm::StringRef Path);
 };
 }
 

Modified: cfe/trunk/lib/Frontend/FrontendAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendAction.cpp?rev=344337&r1=344336&r2=344337&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendAction.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendAction.cpp Fri Oct 12 05:21:29 2018
@@ -568,7 +568,7 @@ bool FrontendAction::BeginSourceFile(Com
       auto &MM = ASTReader->getModuleManager();
       auto &PrimaryModule = MM.getPrimaryModule();
 
-      for (ModuleFile &MF : MM)
+      for (serialization::ModuleFile &MF : MM)
         if (&MF != &PrimaryModule)
           CI.getFrontendOpts().ModuleFiles.push_back(MF.FileName);
 

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h?rev=344337&r1=344336&r2=344337&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCount
+++ Checker.h Fri Oct 12 05:21:29 2018
@@ -45,8 +45,6 @@
 #include <cstdarg>
 #include <utility>
 
-using llvm::StrInStrNoCase;
-
 namespace clang {
 namespace ento {
 namespace retaincountchecker {

Modified: cfe/trunk/utils/TableGen/TableGenBackends.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/TableGenBackends.h?rev=344337&r1=344336&r2=344337&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/TableGenBackends.h (original)
+++ cfe/trunk/utils/TableGen/TableGenBackends.h Fri Oct 12 05:21:29 2018
@@ -23,63 +23,60 @@ namespace llvm {
   class RecordKeeper;
 }
 
-using llvm::raw_ostream;
-using llvm::RecordKeeper;
-
 namespace clang {
 
-void EmitClangDeclContext(RecordKeeper &RK, raw_ostream &OS); -void EmitClangASTNodes(RecordKeeper &RK, raw_ostream &OS,
+void EmitClangDeclContext(llvm::RecordKeeper &RK, llvm::raw_ostream 
+&OS); void EmitClangASTNodes(llvm::RecordKeeper &RK, llvm::raw_ostream 
+&OS,
                        const std::string &N, const std::string &S);
 
-void EmitClangAttrParserStringSwitches(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrSubjectMatchRulesParserStringSwitches(RecordKeeper &Records,
-                                                        raw_ostream &OS);
-void EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrImpl(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrList(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrSubjectMatchRuleList(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrPCHRead(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrPCHWrite(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrHasAttrImpl(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrSpellingListIndex(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrASTVisitor(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrTemplateInstantiate(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrParsedAttrList(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrParsedAttrImpl(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrParsedAttrKinds(RecordKeeper &Records, raw_ostream &OS); -void EmitClangAttrDump(RecordKeeper &Records, raw_ostream &OS);
+void EmitClangAttrParserStringSwitches(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS); void EmitClangAttrSubjectMatchRulesParserStringSwitches(llvm::RecordKeeper &Records,
+                                                        
+llvm::raw_ostream &OS); void EmitClangAttrClass(llvm::RecordKeeper 
+&Records, llvm::raw_ostream &OS); void 
+EmitClangAttrImpl(llvm::RecordKeeper &Records, llvm::raw_ostream &OS); 
+void EmitClangAttrList(llvm::RecordKeeper &Records, llvm::raw_ostream 
+&OS); void EmitClangAttrSubjectMatchRuleList(llvm::RecordKeeper 
+&Records, llvm::raw_ostream &OS); void 
+EmitClangAttrPCHRead(llvm::RecordKeeper &Records, llvm::raw_ostream 
+&OS); void EmitClangAttrPCHWrite(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS); void 
+EmitClangAttrHasAttrImpl(llvm::RecordKeeper &Records, llvm::raw_ostream 
+&OS); void EmitClangAttrSpellingListIndex(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS); void EmitClangAttrASTVisitor(llvm::RecordKeeper 
+&Records, llvm::raw_ostream &OS); void 
+EmitClangAttrTemplateInstantiate(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS); void 
+EmitClangAttrParsedAttrList(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS); void 
+EmitClangAttrParsedAttrImpl(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS); void 
+EmitClangAttrParsedAttrKinds(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS); void EmitClangAttrDump(llvm::RecordKeeper 
+&Records, llvm::raw_ostream &OS);
 
-void EmitClangDiagsDefs(RecordKeeper &Records, raw_ostream &OS,
+void EmitClangDiagsDefs(llvm::RecordKeeper &Records, llvm::raw_ostream 
+&OS,
                         const std::string &Component); -void EmitClangDiagGroups(RecordKeeper &Records, raw_ostream &OS); -void EmitClangDiagsIndexName(RecordKeeper &Records, raw_ostream &OS);
+void EmitClangDiagGroups(llvm::RecordKeeper &Records, llvm::raw_ostream 
+&OS); void EmitClangDiagsIndexName(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS);
 
-void EmitClangSACheckers(RecordKeeper &Records, raw_ostream &OS);
+void EmitClangSACheckers(llvm::RecordKeeper &Records, llvm::raw_ostream 
+&OS);
 
-void EmitClangCommentHTMLTags(RecordKeeper &Records, raw_ostream &OS); -void EmitClangCommentHTMLTagsProperties(RecordKeeper &Records, raw_ostream &OS); -void EmitClangCommentHTMLNamedCharacterReferences(RecordKeeper &Records, raw_ostream &OS);
-
-void EmitClangCommentCommandInfo(RecordKeeper &Records, raw_ostream &OS); -void EmitClangCommentCommandList(RecordKeeper &Records, raw_ostream &OS);
-
-void EmitNeon(RecordKeeper &Records, raw_ostream &OS); -void EmitFP16(RecordKeeper &Records, raw_ostream &OS); -void EmitNeonSema(RecordKeeper &Records, raw_ostream &OS); -void EmitNeonTest(RecordKeeper &Records, raw_ostream &OS); -void EmitNeon2(RecordKeeper &Records, raw_ostream &OS); -void EmitNeonSema2(RecordKeeper &Records, raw_ostream &OS); -void EmitNeonTest2(RecordKeeper &Records, raw_ostream &OS);
-
-void EmitClangAttrDocs(RecordKeeper &Records, raw_ostream &OS); -void EmitClangDiagDocs(RecordKeeper &Records, raw_ostream &OS); -void EmitClangOptDocs(RecordKeeper &Records, raw_ostream &OS);
+void EmitClangCommentHTMLTags(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS); void 
+EmitClangCommentHTMLTagsProperties(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS); void 
+EmitClangCommentHTMLNamedCharacterReferences(llvm::RecordKeeper 
+&Records, llvm::raw_ostream &OS);
+
+void EmitClangCommentCommandInfo(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS); void 
+EmitClangCommentCommandList(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS);
+
+void EmitNeon(llvm::RecordKeeper &Records, llvm::raw_ostream &OS); void 
+EmitFP16(llvm::RecordKeeper &Records, llvm::raw_ostream &OS); void 
+EmitNeonSema(llvm::RecordKeeper &Records, llvm::raw_ostream &OS); void 
+EmitNeonTest(llvm::RecordKeeper &Records, llvm::raw_ostream &OS); void 
+EmitNeon2(llvm::RecordKeeper &Records, llvm::raw_ostream &OS); void 
+EmitNeonSema2(llvm::RecordKeeper &Records, llvm::raw_ostream &OS); void 
+EmitNeonTest2(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
+
+void EmitClangAttrDocs(llvm::RecordKeeper &Records, llvm::raw_ostream 
+&OS); void EmitClangDiagDocs(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS); void EmitClangOptDocs(llvm::RecordKeeper 
+&Records, llvm::raw_ostream &OS);
 
-void EmitClangDataCollectors(RecordKeeper &Records, raw_ostream &OS);
+void EmitClangDataCollectors(llvm::RecordKeeper &Records, 
+llvm::raw_ostream &OS);
 
-void EmitTestPragmaAttributeSupportedAttributes(RecordKeeper &Records,
-                                                raw_ostream &OS);
+void EmitTestPragmaAttributeSupportedAttributes(llvm::RecordKeeper &Records,
+                                                llvm::raw_ostream &OS);
 
 } // end namespace clang
 


_______________________________________________
cfe-commits mailing list
cfe-commits at lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


More information about the cfe-commits mailing list