r202595 - Move private classes into anonymous namespaces.

Benjamin Kramer benny.kra at googlemail.com
Sat Mar 1 09:21:23 PST 2014


Author: d0k
Date: Sat Mar  1 11:21:22 2014
New Revision: 202595

URL: http://llvm.org/viewvc/llvm-project?rev=202595&view=rev
Log:
Move private classes into anonymous namespaces.

Modified:
    cfe/trunk/lib/Basic/VirtualFileSystem.cpp
    cfe/trunk/lib/Sema/SemaChecking.cpp

Modified: cfe/trunk/lib/Basic/VirtualFileSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/VirtualFileSystem.cpp?rev=202595&r1=202594&r2=202595&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/VirtualFileSystem.cpp (original)
+++ cfe/trunk/lib/Basic/VirtualFileSystem.cpp Sat Mar  1 11:21:22 2014
@@ -80,6 +80,7 @@ error_code FileSystem::getBufferForFile(
 // RealFileSystem implementation
 //===-----------------------------------------------------------------------===/
 
+namespace {
 /// \brief Wrapper around a raw file descriptor.
 class RealFile : public File {
   int FD;
@@ -98,6 +99,7 @@ public:
   error_code close() LLVM_OVERRIDE;
   void setName(StringRef Name) LLVM_OVERRIDE;
 };
+} // end anonymous namespace
 RealFile::~RealFile() { close(); }
 
 ErrorOr<Status> RealFile::status() {
@@ -142,6 +144,7 @@ void RealFile::setName(StringRef Name) {
   S.setName(Name);
 }
 
+namespace {
 /// \brief The file system according to your operating system.
 class RealFileSystem : public FileSystem {
 public:
@@ -149,6 +152,7 @@ public:
   error_code openFileForRead(const Twine &Path,
                              OwningPtr<File> &Result) LLVM_OVERRIDE;
 };
+} // end anonymous namespace
 
 ErrorOr<Status> RealFileSystem::status(const Twine &Path) {
   sys::fs::file_status RealStatus;

Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=202595&r1=202594&r2=202595&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Sat Mar  1 11:21:22 2014
@@ -3777,7 +3777,7 @@ static unsigned changeAbsFunction(unsign
   llvm_unreachable("Unable to convert function");
 }
 
-unsigned getAbsoluteValueFunctionKind(const FunctionDecl *FDecl) {
+static unsigned getAbsoluteValueFunctionKind(const FunctionDecl *FDecl) {
   const IdentifierInfo *FnInfo = FDecl->getIdentifier();
   if (!FnInfo)
     return 0;





More information about the cfe-commits mailing list