[llvm] r209952 - Use error_code() instead of error_code::succes()

Rafael Espindola rafael.espindola at gmail.com
Fri May 30 18:37:46 PDT 2014


Author: rafael
Date: Fri May 30 20:37:45 2014
New Revision: 209952

URL: http://llvm.org/viewvc/llvm-project?rev=209952&view=rev
Log:
Use error_code() instead of error_code::succes()

There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.

Modified:
    llvm/trunk/include/llvm/Object/ELF.h
    llvm/trunk/include/llvm/Support/ErrorOr.h
    llvm/trunk/include/llvm/Support/FileSystem.h
    llvm/trunk/include/llvm/Support/system_error.h
    llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
    llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp
    llvm/trunk/lib/IR/Module.cpp
    llvm/trunk/lib/Object/Archive.cpp
    llvm/trunk/lib/Support/DataStream.cpp
    llvm/trunk/lib/Support/FileOutputBuffer.cpp
    llvm/trunk/lib/Support/MemoryBuffer.cpp
    llvm/trunk/lib/Support/Path.cpp
    llvm/trunk/lib/Support/Unix/Memory.inc
    llvm/trunk/lib/Support/Unix/Path.inc
    llvm/trunk/lib/Support/Unix/Process.inc
    llvm/trunk/lib/Support/Windows/Memory.inc
    llvm/trunk/lib/Support/Windows/Path.inc
    llvm/trunk/lib/Support/Windows/Process.inc
    llvm/trunk/unittests/Support/MemoryTest.cpp

Modified: llvm/trunk/include/llvm/Object/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELF.h?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Fri May 30 20:37:45 2014
@@ -744,7 +744,7 @@ ELFFile<ELFT>::ELFFile(MemoryBuffer *Obj
     }
   }
 
-  ec = error_code::success();
+  ec = error_code();
 }
 
 // Get the symbol table index in the symtab section given a symbol

Modified: llvm/trunk/include/llvm/Support/ErrorOr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ErrorOr.h?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/ErrorOr.h (original)
+++ llvm/trunk/include/llvm/Support/ErrorOr.h Fri May 30 20:37:45 2014
@@ -163,7 +163,7 @@ public:
   const_reference get() const { return const_cast<ErrorOr<T> >(this)->get(); }
 
   error_code getError() const {
-    return HasError ? *getErrorStorage() : error_code::success();
+    return HasError ? *getErrorStorage() : error_code();
   }
 
   pointer operator ->() {

Modified: llvm/trunk/include/llvm/Support/FileSystem.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileSystem.h?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FileSystem.h (original)
+++ llvm/trunk/include/llvm/Support/FileSystem.h Fri May 30 20:37:45 2014
@@ -505,7 +505,7 @@ inline error_code file_size(const Twine
   if (EC)
     return EC;
   Result = Status.getSize();
-  return error_code::success();
+  return error_code();
 }
 
 /// @brief Set the file modification and access time.

Modified: llvm/trunk/include/llvm/Support/system_error.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/system_error.h?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/system_error.h (original)
+++ llvm/trunk/include/llvm/Support/system_error.h Fri May 30 20:37:45 2014
@@ -727,10 +727,6 @@ class error_code {
 public:
   error_code() : _val_(0), _cat_(&system_category()) {}
 
-  static error_code success() {
-    return error_code();
-  }
-
   error_code(int _val, const error_category& _cat)
     : _val_(_val), _cat_(&_cat) {}
 

Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Fri May 30 20:37:45 2014
@@ -490,7 +490,7 @@ error_code BitcodeReader::ParseAttribute
     case BitstreamEntry::Error:
       return Error(MalformedBlock);
     case BitstreamEntry::EndBlock:
-      return error_code::success();
+      return error_code();
     case BitstreamEntry::Record:
       // The interesting case.
       break;
@@ -619,7 +619,7 @@ error_code BitcodeReader::ParseAttrKind(
   *Kind = GetAttrFromCode(Code);
   if (*Kind == Attribute::None)
     return Error(InvalidValue);
-  return error_code::success();
+  return error_code();
 }
 
 error_code BitcodeReader::ParseAttributeGroupBlock() {
@@ -640,7 +640,7 @@ error_code BitcodeReader::ParseAttribute
     case BitstreamEntry::Error:
       return Error(MalformedBlock);
     case BitstreamEntry::EndBlock:
-      return error_code::success();
+      return error_code();
     case BitstreamEntry::Record:
       // The interesting case.
       break;
@@ -731,7 +731,7 @@ error_code BitcodeReader::ParseTypeTable
     case BitstreamEntry::EndBlock:
       if (NumRecords != TypeList.size())
         return Error(MalformedBlock);
-      return error_code::success();
+      return error_code();
     case BitstreamEntry::Record:
       // The interesting case.
       break;
@@ -947,7 +947,7 @@ error_code BitcodeReader::ParseValueSymb
     case BitstreamEntry::Error:
       return Error(MalformedBlock);
     case BitstreamEntry::EndBlock:
-      return error_code::success();
+      return error_code();
     case BitstreamEntry::Record:
       // The interesting case.
       break;
@@ -1002,7 +1002,7 @@ error_code BitcodeReader::ParseMetadata(
     case BitstreamEntry::Error:
       return Error(MalformedBlock);
     case BitstreamEntry::EndBlock:
-      return error_code::success();
+      return error_code();
     case BitstreamEntry::Record:
       // The interesting case.
       break;
@@ -1178,7 +1178,7 @@ error_code BitcodeReader::ResolveGlobalA
     FunctionPrefixWorklist.pop_back();
   }
 
-  return error_code::success();
+  return error_code();
 }
 
 static APInt ReadWideAPInt(ArrayRef<uint64_t> Vals, unsigned TypeBits) {
@@ -1212,7 +1212,7 @@ error_code BitcodeReader::ParseConstants
       // Once all the constants have been read, go through and resolve forward
       // references.
       ValueList.ResolveConstantForwardRefs();
-      return error_code::success();
+      return error_code();
     case BitstreamEntry::Record:
       // The interesting case.
       break;
@@ -1642,7 +1642,7 @@ error_code BitcodeReader::ParseUseLists(
     case BitstreamEntry::Error:
       return Error(MalformedBlock);
     case BitstreamEntry::EndBlock:
-      return error_code::success();
+      return error_code();
     case BitstreamEntry::Record:
       // The interesting case.
       break;
@@ -1682,7 +1682,7 @@ error_code BitcodeReader::RememberAndSki
   // Skip over the function block for now.
   if (Stream.SkipBlock())
     return Error(InvalidRecord);
-  return error_code::success();
+  return error_code();
 }
 
 error_code BitcodeReader::GlobalCleanup() {
@@ -1711,7 +1711,7 @@ error_code BitcodeReader::GlobalCleanup(
   // want lazy deserialization.
   std::vector<std::pair<GlobalVariable*, unsigned> >().swap(GlobalInits);
   std::vector<std::pair<GlobalAlias*, unsigned> >().swap(AliasInits);
-  return error_code::success();
+  return error_code();
 }
 
 error_code BitcodeReader::ParseModule(bool Resume) {
@@ -1791,7 +1791,7 @@ error_code BitcodeReader::ParseModule(bo
         // just finish the parse now.
         if (LazyStreamer && SeenValueSymbolTable) {
           NextUnreadBit = Stream.GetCurrentBitNo();
-          return error_code::success();
+          return error_code();
         }
         break;
       case bitc::USELIST_BLOCK_ID:
@@ -2054,7 +2054,7 @@ error_code BitcodeReader::ParseBitcodeIn
   // need to understand them all.
   while (1) {
     if (Stream.AtEndOfStream())
-      return error_code::success();
+      return error_code();
 
     BitstreamEntry Entry =
       Stream.advance(BitstreamCursor::AF_DontAutoprocessAbbrevs);
@@ -2063,7 +2063,7 @@ error_code BitcodeReader::ParseBitcodeIn
     case BitstreamEntry::Error:
       return Error(MalformedBlock);
     case BitstreamEntry::EndBlock:
-      return error_code::success();
+      return error_code();
 
     case BitstreamEntry::SubBlock:
       switch (Entry.ID) {
@@ -2079,7 +2079,7 @@ error_code BitcodeReader::ParseBitcodeIn
         if (error_code EC = ParseModule(false))
           return EC;
         if (LazyStreamer)
-          return error_code::success();
+          return error_code();
         break;
       default:
         if (Stream.SkipBlock())
@@ -2096,7 +2096,7 @@ error_code BitcodeReader::ParseBitcodeIn
       if (Stream.getAbbrevIDWidth() == 2 && Entry.ID == 2 &&
           Stream.Read(6) == 2 && Stream.Read(24) == 0xa0a0a &&
           Stream.AtEndOfStream())
-        return error_code::success();
+        return error_code();
 
       return Error(InvalidRecord);
     }
@@ -2118,7 +2118,7 @@ error_code BitcodeReader::ParseModuleTri
     case BitstreamEntry::Error:
       return Error(MalformedBlock);
     case BitstreamEntry::EndBlock:
-      return error_code::success();
+      return error_code();
     case BitstreamEntry::Record:
       // The interesting case.
       break;
@@ -2161,7 +2161,7 @@ error_code BitcodeReader::ParseTriple(st
     case BitstreamEntry::Error:
       return Error(MalformedBlock);
     case BitstreamEntry::EndBlock:
-      return error_code::success();
+      return error_code();
 
     case BitstreamEntry::SubBlock:
       if (Entry.ID == bitc::MODULE_BLOCK_ID)
@@ -2193,7 +2193,7 @@ error_code BitcodeReader::ParseMetadataA
     case BitstreamEntry::Error:
       return Error(MalformedBlock);
     case BitstreamEntry::EndBlock:
-      return error_code::success();
+      return error_code();
     case BitstreamEntry::Record:
       // The interesting case.
       break;
@@ -3146,7 +3146,7 @@ OutOfRecordLoop:
   ValueList.shrinkTo(ModuleValueListSize);
   MDValueList.shrinkTo(ModuleMDValueListSize);
   std::vector<BasicBlock*>().swap(FunctionBBs);
-  return error_code::success();
+  return error_code();
 }
 
 /// Find the function body in the bitcode stream
@@ -3160,7 +3160,7 @@ error_code BitcodeReader::FindFunctionIn
     if (error_code EC = ParseModule(true))
       return EC;
   }
-  return error_code::success();
+  return error_code();
 }
 
 //===----------------------------------------------------------------------===//
@@ -3180,7 +3180,7 @@ error_code BitcodeReader::Materialize(Gl
   Function *F = dyn_cast<Function>(GV);
   // If it's not a function or is already material, ignore the request.
   if (!F || !F->isMaterializable())
-    return error_code::success();
+    return error_code();
 
   DenseMap<Function*, uint64_t>::iterator DFII = DeferredFunctionInfo.find(F);
   assert(DFII != DeferredFunctionInfo.end() && "Deferred function not found!");
@@ -3208,7 +3208,7 @@ error_code BitcodeReader::Materialize(Gl
     }
   }
 
-  return error_code::success();
+  return error_code();
 }
 
 bool BitcodeReader::isDematerializable(const GlobalValue *GV) const {
@@ -3272,7 +3272,7 @@ error_code BitcodeReader::MaterializeMod
     UpgradeInstWithTBAATag(InstsWithTBAATag[I]);
 
   UpgradeDebugInfo(*M);
-  return error_code::success();
+  return error_code();
 }
 
 error_code BitcodeReader::InitStream() {
@@ -3301,7 +3301,7 @@ error_code BitcodeReader::InitStreamFrom
   StreamFile.reset(new BitstreamReader(BufPtr, BufEnd));
   Stream.init(*StreamFile);
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code BitcodeReader::InitLazyStream() {
@@ -3325,7 +3325,7 @@ error_code BitcodeReader::InitLazyStream
     Bytes->dropLeadingBytes(bitcodeStart - buf);
     Bytes->setKnownObjectSize(bitcodeEnd - bitcodeStart);
   }
-  return error_code::success();
+  return error_code();
 }
 
 namespace {

Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp Fri May 30 20:37:45 2014
@@ -155,7 +155,7 @@ error_code SectionMemoryManager::applyMe
       }
   }
 
-  return error_code::success();
+  return error_code();
 }
 
 void SectionMemoryManager::invalidateInstructionCache() {

Modified: llvm/trunk/lib/IR/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Module.cpp?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Module.cpp (original)
+++ llvm/trunk/lib/IR/Module.cpp Fri May 30 20:37:45 2014
@@ -396,7 +396,7 @@ void Module::Dematerialize(GlobalValue *
 
 error_code Module::materializeAll() {
   if (!Materializer)
-    return error_code::success();
+    return error_code();
   return Materializer->MaterializeModule(this);
 }
 
@@ -405,7 +405,7 @@ error_code Module::materializeAllPermane
     return EC;
 
   Materializer.reset();
-  return error_code::success();
+  return error_code();
 }
 
 //===----------------------------------------------------------------------===//

Modified: llvm/trunk/lib/Object/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Archive.cpp?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Archive.cpp (original)
+++ llvm/trunk/lib/Object/Archive.cpp Fri May 30 20:37:45 2014
@@ -179,7 +179,7 @@ error_code Archive::Child::getMemoryBuff
                                   .toStringRef(Path)
                             : Name,
       false));
-  return error_code::success();
+  return error_code();
 }
 
 error_code Archive::Child::getAsBinary(std::unique_ptr<Binary> &Result,

Modified: llvm/trunk/lib/Support/DataStream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/DataStream.cpp?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Support/DataStream.cpp (original)
+++ llvm/trunk/lib/Support/DataStream.cpp Fri May 30 20:37:45 2014
@@ -68,7 +68,7 @@ public:
     if (Filename == "-") {
       Fd = 0;
       sys::ChangeStdinToBinary();
-      return error_code::success();
+      return error_code();
     }
 
     return sys::fs::openFileForRead(Filename, Fd);

Modified: llvm/trunk/lib/Support/FileOutputBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FileOutputBuffer.cpp?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Support/FileOutputBuffer.cpp (original)
+++ llvm/trunk/lib/Support/FileOutputBuffer.cpp Fri May 30 20:37:45 2014
@@ -81,7 +81,7 @@ error_code FileOutputBuffer::create(Stri
   if (Result)
     MappedFile.release();
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code FileOutputBuffer::commit(int64_t NewSmallerSize) {

Modified: llvm/trunk/lib/Support/MemoryBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/MemoryBuffer.cpp?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Support/MemoryBuffer.cpp (original)
+++ llvm/trunk/lib/Support/MemoryBuffer.cpp Fri May 30 20:37:45 2014
@@ -228,7 +228,7 @@ static error_code getMemoryBufferForStre
   } while (ReadBytes != 0);
 
   Result.reset(MemoryBuffer::getMemBufferCopy(Buffer, BufferName));
-  return error_code::success();
+  return error_code();
 }
 
 static error_code getFileAux(const char *Filename,
@@ -354,7 +354,7 @@ static error_code getOpenFileImpl(int FD
     Result.reset(new (NamedBufferAlloc(Filename)) MemoryBufferMMapFile(
         RequiresNullTerminator, FD, MapSize, Offset, EC));
     if (!EC)
-      return error_code::success();
+      return error_code();
   }
 
   MemoryBuffer *Buf = MemoryBuffer::getNewUninitMemBuffer(MapSize, Filename);
@@ -394,7 +394,7 @@ static error_code getOpenFileImpl(int FD
   }
 
   Result.swap(SB);
-  return error_code::success();
+  return error_code();
 }
 
 error_code MemoryBuffer::getOpenFile(int FD, const char *Filename,

Modified: llvm/trunk/lib/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Path.cpp?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Path.cpp (original)
+++ llvm/trunk/lib/Support/Path.cpp Fri May 30 20:37:45 2014
@@ -209,7 +209,7 @@ retry_random_path:
       return EC;
     }
 
-    return error_code::success();
+    return error_code();
   }
 
   case FS_Name: {
@@ -219,7 +219,7 @@ retry_random_path:
       return EC;
     if (Exists)
       goto retry_random_path;
-    return error_code::success();
+    return error_code();
   }
 
   case FS_Dir: {
@@ -228,7 +228,7 @@ retry_random_path:
         goto retry_random_path;
       return EC;
     }
-    return error_code::success();
+    return error_code();
   }
   }
   llvm_unreachable("Invalid Type");
@@ -711,7 +711,7 @@ error_code getUniqueID(const Twine Path,
   if (EC)
     return EC;
   Result = Status.getUniqueID();
-  return error_code::success();
+  return error_code();
 }
 
 error_code createUniqueFile(const Twine &Model, int &ResultFd,
@@ -781,7 +781,7 @@ error_code make_absolute(SmallVectorImpl
 
   // Already absolute.
   if (rootName && rootDirectory)
-    return error_code::success();
+    return error_code();
 
   // All of the following conditions will need the current directory.
   SmallString<128> current_dir;
@@ -793,7 +793,7 @@ error_code make_absolute(SmallVectorImpl
     path::append(current_dir, p);
     // Set path to the result.
     path.swap(current_dir);
-    return error_code::success();
+    return error_code();
   }
 
   if (!rootName && rootDirectory) {
@@ -802,7 +802,7 @@ error_code make_absolute(SmallVectorImpl
     path::append(curDirRootName, p);
     // Set path to the result.
     path.swap(curDirRootName);
-    return error_code::success();
+    return error_code();
   }
 
   if (rootName && !rootDirectory) {
@@ -814,7 +814,7 @@ error_code make_absolute(SmallVectorImpl
     SmallString<128> res;
     path::append(res, pRootName, bRootDirectory, bRelativePath, pRelativePath);
     path.swap(res);
-    return error_code::success();
+    return error_code();
   }
 
   llvm_unreachable("All rootName and rootDirectory combinations should have "
@@ -861,7 +861,7 @@ error_code is_directory(const Twine &pat
   if (error_code ec = status(path, st))
     return ec;
   result = is_directory(st);
-  return error_code::success();
+  return error_code();
 }
 
 bool is_regular_file(file_status status) {
@@ -873,7 +873,7 @@ error_code is_regular_file(const Twine &
   if (error_code ec = status(path, st))
     return ec;
   result = is_regular_file(st);
-  return error_code::success();
+  return error_code();
 }
 
 bool is_other(file_status status) {
@@ -899,13 +899,13 @@ error_code has_magic(const Twine &path,
     if (ec == errc::value_too_large) {
       // Magic.size() > file_size(Path).
       result = false;
-      return error_code::success();
+      return error_code();
     }
     return ec;
   }
 
   result = Magic == Buffer;
-  return error_code::success();
+  return error_code();
 }
 
 /// @brief Identify the magic in magic.
@@ -1047,7 +1047,7 @@ error_code identify_magic(const Twine &p
     return ec;
 
   result = identify_magic(Magic);
-  return error_code::success();
+  return error_code();
 }
 
 error_code directory_entry::status(file_status &result) const {

Modified: llvm/trunk/lib/Support/Unix/Memory.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Memory.inc?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Memory.inc (original)
+++ llvm/trunk/lib/Support/Unix/Memory.inc Fri May 30 20:37:45 2014
@@ -84,7 +84,7 @@ Memory::allocateMappedMemory(size_t NumB
                              const MemoryBlock *const NearBlock,
                              unsigned PFlags,
                              error_code &EC) {
-  EC = error_code::success();
+  EC = error_code();
   if (NumBytes == 0)
     return MemoryBlock();
 
@@ -140,7 +140,7 @@ Memory::allocateMappedMemory(size_t NumB
 error_code
 Memory::releaseMappedMemory(MemoryBlock &M) {
   if (M.Address == nullptr || M.Size == 0)
-    return error_code::success();
+    return error_code();
 
   if (0 != ::munmap(M.Address, M.Size))
     return error_code(errno, system_category());
@@ -148,13 +148,13 @@ Memory::releaseMappedMemory(MemoryBlock
   M.Address = nullptr;
   M.Size = 0;
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code
 Memory::protectMappedMemory(const MemoryBlock &M, unsigned Flags) {
   if (M.Address == nullptr || M.Size == 0)
-    return error_code::success();
+    return error_code();
 
   if (!Flags)
     return error_code(EINVAL, generic_category());
@@ -168,7 +168,7 @@ Memory::protectMappedMemory(const Memory
   if (Flags & MF_EXEC)
     Memory::InvalidateInstructionCache(M.Address, M.Size);
 
-  return error_code::success();
+  return error_code();
 }
 
 /// AllocateRWX - Allocate a slab of memory with read/write/execute

Modified: llvm/trunk/lib/Support/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Path.inc?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Path.inc (original)
+++ llvm/trunk/lib/Support/Unix/Path.inc Fri May 30 20:37:45 2014
@@ -100,7 +100,7 @@ static error_code TempDir(SmallVectorImp
   result.clear();
   StringRef d(dir);
   result.append(d.begin(), d.end());
-  return error_code::success();
+  return error_code();
 }
 
 namespace llvm {
@@ -235,7 +235,7 @@ error_code current_path(SmallVectorImpl<
       !llvm::sys::fs::status(".", DotStatus) &&
       PWDStatus.getUniqueID() == DotStatus.getUniqueID()) {
     result.append(pwd, pwd + strlen(pwd));
-    return error_code::success();
+    return error_code();
   }
 
 #ifdef MAXPATHLEN
@@ -257,7 +257,7 @@ error_code current_path(SmallVectorImpl<
   }
 
   result.set_size(strlen(result.data()));
-  return error_code::success();
+  return error_code();
 }
 
 error_code create_directory(const Twine &path, bool IgnoreExisting) {
@@ -269,7 +269,7 @@ error_code create_directory(const Twine
       return error_code(errno, system_category());
   }
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code normalize_separators(SmallVectorImpl<char> &Path) {
@@ -282,7 +282,7 @@ error_code normalize_separators(SmallVec
         *PI = '/';
     }
   }
-  return error_code::success();
+  return error_code();
 }
 
 // Note that we are using symbolic link because hard links are not supported by
@@ -297,7 +297,7 @@ error_code create_link(const Twine &to,
   if (::symlink(t.begin(), f.begin()) == -1)
     return error_code(errno, system_category());
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code remove(const Twine &path, bool IgnoreNonExisting) {
@@ -308,7 +308,7 @@ error_code remove(const Twine &path, boo
   if (lstat(p.begin(), &buf) != 0) {
     if (errno != errc::no_such_file_or_directory || !IgnoreNonExisting)
       return error_code(errno, system_category());
-    return error_code::success();
+    return error_code();
   }
 
   // Note: this check catches strange situations. In all cases, LLVM should
@@ -324,7 +324,7 @@ error_code remove(const Twine &path, boo
       return error_code(errno, system_category());
   }
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code rename(const Twine &from, const Twine &to) {
@@ -337,7 +337,7 @@ error_code rename(const Twine &from, con
   if (::rename(f.begin(), t.begin()) == -1)
     return error_code(errno, system_category());
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code resize_file(const Twine &path, uint64_t size) {
@@ -347,7 +347,7 @@ error_code resize_file(const Twine &path
   if (::truncate(p.begin(), size) == -1)
     return error_code(errno, system_category());
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code exists(const Twine &path, bool &result) {
@@ -361,7 +361,7 @@ error_code exists(const Twine &path, boo
   } else
     result = true;
 
-  return error_code::success();
+  return error_code();
 }
 
 bool can_write(const Twine &Path) {
@@ -395,7 +395,7 @@ error_code equivalent(const Twine &A, co
   if (error_code ec = status(A, fsA)) return ec;
   if (error_code ec = status(B, fsB)) return ec;
   result = equivalent(fsA, fsB);
-  return error_code::success();
+  return error_code();
 }
 
 static error_code fillStatus(int StatRet, const struct stat &Status,
@@ -429,7 +429,7 @@ static error_code fillStatus(int StatRet
       file_status(Type, Perms, Status.st_dev, Status.st_ino, Status.st_mtime,
                   Status.st_uid, Status.st_gid, Status.st_size);
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code status(const Twine &Path, file_status &Result) {
@@ -455,7 +455,7 @@ error_code setLastModificationAndAccessT
   Times[1] = Times[0];
   if (::futimens(FD, Times))
     return error_code(errno, system_category());
-  return error_code::success();
+  return error_code();
 #elif defined(HAVE_FUTIMES)
   timeval Times[2];
   Times[0].tv_sec = Time.toEpochTime();
@@ -463,7 +463,7 @@ error_code setLastModificationAndAccessT
   Times[1] = Times[0];
   if (::futimes(FD, Times))
     return error_code(errno, system_category());
-  return error_code::success();
+  return error_code();
 #else
 #warning Missing futimes() and futimens()
   return make_error_code(errc::not_supported);
@@ -497,7 +497,7 @@ error_code mapped_file_region::init(int
   Mapping = ::mmap(nullptr, Size, prot, flags, FD, Offset);
   if (Mapping == MAP_FAILED)
     return error_code(errno, system_category());
-  return error_code::success();
+  return error_code();
 }
 
 mapped_file_region::mapped_file_region(const Twine &path,
@@ -602,7 +602,7 @@ error_code detail::directory_iterator_de
     ::closedir(reinterpret_cast<DIR *>(it.IterationHandle));
   it.IterationHandle = 0;
   it.CurrentEntry = directory_entry();
-  return error_code::success();
+  return error_code();
 }
 
 error_code detail::directory_iterator_increment(detail::DirIterState &it) {
@@ -619,7 +619,7 @@ error_code detail::directory_iterator_in
   } else
     return directory_iterator_destruct(it);
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code get_magic(const Twine &path, uint32_t len,
@@ -650,7 +650,7 @@ error_code get_magic(const Twine &path,
   }
   std::fclose(file);
   result.set_size(size);
-  return error_code::success();
+  return error_code();
 }
 
 error_code openFileForRead(const Twine &Name, int &ResultFD) {
@@ -660,7 +660,7 @@ error_code openFileForRead(const Twine &
     if (errno != EINTR)
       return error_code(errno, system_category());
   }
-  return error_code::success();
+  return error_code();
 }
 
 error_code openFileForWrite(const Twine &Name, int &ResultFD,
@@ -690,7 +690,7 @@ error_code openFileForWrite(const Twine
     if (errno != EINTR)
       return error_code(errno, system_category());
   }
-  return error_code::success();
+  return error_code();
 }
 
 } // end namespace fs

Modified: llvm/trunk/lib/Support/Unix/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Process.inc?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Process.inc (original)
+++ llvm/trunk/lib/Support/Unix/Process.inc Fri May 30 20:37:45 2014
@@ -195,7 +195,7 @@ error_code Process::GetArgumentVector(Sm
                                       SpecificBumpPtrAllocator<char> &) {
   ArgsOut.append(ArgsIn.begin(), ArgsIn.end());
 
-  return error_code::success();
+  return error_code();
 }
 
 bool Process::StandardInIsUserInput() {

Modified: llvm/trunk/lib/Support/Windows/Memory.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Memory.inc?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Memory.inc (original)
+++ llvm/trunk/lib/Support/Windows/Memory.inc Fri May 30 20:37:45 2014
@@ -70,7 +70,7 @@ MemoryBlock Memory::allocateMappedMemory
                                          const MemoryBlock *const NearBlock,
                                          unsigned Flags,
                                          error_code &EC) {
-  EC = error_code::success();
+  EC = error_code();
   if (NumBytes == 0)
     return MemoryBlock();
 
@@ -115,7 +115,7 @@ MemoryBlock Memory::allocateMappedMemory
 
 error_code Memory::releaseMappedMemory(MemoryBlock &M) {
   if (M.Address == 0 || M.Size == 0)
-    return error_code::success();
+    return error_code();
 
   if (!VirtualFree(M.Address, 0, MEM_RELEASE))
     return error_code(::GetLastError(), system_category());
@@ -123,13 +123,13 @@ error_code Memory::releaseMappedMemory(M
   M.Address = 0;
   M.Size = 0;
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code Memory::protectMappedMemory(const MemoryBlock &M,
                                        unsigned Flags) {
   if (M.Address == 0 || M.Size == 0)
-    return error_code::success();
+    return error_code();
 
   DWORD Protect = getWindowsProtectionFlags(Flags);
 
@@ -140,7 +140,7 @@ error_code Memory::protectMappedMemory(c
   if (Flags & MF_EXEC)
     Memory::InvalidateInstructionCache(M.Address, M.Size);
 
-  return error_code::success();
+  return error_code();
 }
 
 /// InvalidateInstructionCache - Before the JIT can run a block of code
@@ -159,7 +159,7 @@ MemoryBlock Memory::AllocateRWX(size_t N
   error_code EC;
   MB = allocateMappedMemory(NumBytes, NearBlock,
                             MF_READ|MF_WRITE|MF_EXEC, EC);
-  if (EC != error_code::success() && ErrMsg) {
+  if (EC != error_code() && ErrMsg) {
     MakeErrMsg(ErrMsg, EC.message());
   }
   return MB;
@@ -167,7 +167,7 @@ MemoryBlock Memory::AllocateRWX(size_t N
 
 bool Memory::ReleaseRWX(MemoryBlock &M, std::string *ErrMsg) {
   error_code EC = releaseMappedMemory(M);
-  if (EC == error_code::success())
+  if (EC == error_code())
     return false;
   MakeErrMsg(ErrMsg, EC.message());
   return true;

Modified: llvm/trunk/lib/Support/Windows/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Path.inc (original)
+++ llvm/trunk/lib/Support/Windows/Path.inc Fri May 30 20:37:45 2014
@@ -155,12 +155,12 @@ error_code create_directory(const Twine
       return ec;
   }
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code normalize_separators(SmallVectorImpl<char> &Path) {
   (void) Path;
-  return error_code::success();
+  return error_code();
 }
 
 // We can't use symbolic links for windows.
@@ -180,7 +180,7 @@ error_code create_link(const Twine &to,
   if (!::CreateHardLinkW(wide_from.begin(), wide_to.begin(), NULL))
     return windows_error(::GetLastError());
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code remove(const Twine &path, bool IgnoreNonExisting) {
@@ -191,7 +191,7 @@ error_code remove(const Twine &path, boo
   if (error_code EC = status(path, ST)) {
     if (EC != errc::no_such_file_or_directory || !IgnoreNonExisting)
       return EC;
-    return error_code::success();
+    return error_code();
   }
 
   if (error_code ec = UTF8ToUTF16(path.toStringRef(path_storage),
@@ -204,14 +204,14 @@ error_code remove(const Twine &path, boo
       if (EC != errc::no_such_file_or_directory || !IgnoreNonExisting)
         return EC;
     }
-    return error_code::success();
+    return error_code();
   }
   if (!::DeleteFileW(c_str(path_utf16))) {
     error_code EC = windows_error(::GetLastError());
     if (EC != errc::no_such_file_or_directory || !IgnoreNonExisting)
       return EC;
   }
-  return error_code::success();
+  return error_code();
 }
 
 error_code rename(const Twine &from, const Twine &to) {
@@ -227,11 +227,11 @@ error_code rename(const Twine &from, con
   if (error_code ec = UTF8ToUTF16(f, wide_from)) return ec;
   if (error_code ec = UTF8ToUTF16(t, wide_to)) return ec;
 
-  error_code ec = error_code::success();
+  error_code ec = error_code();
   for (int i = 0; i < 2000; i++) {
     if (::MoveFileExW(wide_from.begin(), wide_to.begin(),
                       MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING))
-      return error_code::success();
+      return error_code();
     ec = windows_error(::GetLastError());
     if (ec != windows_error::access_denied)
       break;
@@ -283,7 +283,7 @@ error_code exists(const Twine &path, boo
     result = false;
   } else
     result = true;
-  return error_code::success();
+  return error_code();
 }
 
 bool can_write(const Twine &Path) {
@@ -325,7 +325,7 @@ error_code equivalent(const Twine &A, co
   if (error_code ec = status(A, fsA)) return ec;
   if (error_code ec = status(B, fsB)) return ec;
   result = equivalent(fsA, fsB);
-  return error_code::success();
+  return error_code();
 }
 
 static bool isReservedName(StringRef path) {
@@ -363,16 +363,16 @@ static error_code getStatus(HANDLE FileH
     if (Err != NO_ERROR)
       return windows_error(Err);
     Result = file_status(file_type::type_unknown);
-    return error_code::success();
+    return error_code();
   }
   case FILE_TYPE_DISK:
     break;
   case FILE_TYPE_CHAR:
     Result = file_status(file_type::character_file);
-    return error_code::success();
+    return error_code();
   case FILE_TYPE_PIPE:
     Result = file_status(file_type::fifo_file);
-    return error_code::success();
+    return error_code();
   }
 
   BY_HANDLE_FILE_INFORMATION Info;
@@ -388,7 +388,7 @@ static error_code getStatus(HANDLE FileH
                     Info.ftLastWriteTime.dwLowDateTime,
                     Info.dwVolumeSerialNumber, Info.nFileSizeHigh,
                     Info.nFileSizeLow, Info.nFileIndexHigh, Info.nFileIndexLow);
-    return error_code::success();
+    return error_code();
   }
 
 handle_status_error:
@@ -410,7 +410,7 @@ error_code status(const Twine &path, fil
   StringRef path8 = path.toStringRef(path_storage);
   if (isReservedName(path8)) {
     result = file_status(file_type::character_file);
-    return error_code::success();
+    return error_code();
   }
 
   if (error_code ec = UTF8ToUTF16(path8, path_utf16))
@@ -458,7 +458,7 @@ error_code setLastModificationAndAccessT
   HANDLE FileHandle = reinterpret_cast<HANDLE>(_get_osfhandle(FD));
   if (!SetFileTime(FileHandle, NULL, &FT, &FT))
     return windows_error(::GetLastError());
-  return error_code::success();
+  return error_code();
 }
 
 error_code get_magic(const Twine &path, uint32_t len,
@@ -500,7 +500,7 @@ error_code get_magic(const Twine &path,
   }
 
   result.set_size(len);
-  return error_code::success();
+  return error_code();
 }
 
 error_code mapped_file_region::init(int FD, bool CloseFD, uint64_t Offset) {
@@ -584,7 +584,7 @@ error_code mapped_file_region::init(int
       _close(FileDescriptor); // Also closes FileHandle.
   } else
     ::CloseHandle(FileHandle);
-  return error_code::success();
+  return error_code();
 }
 
 mapped_file_region::mapped_file_region(const Twine &path,
@@ -753,7 +753,7 @@ error_code detail::directory_iterator_co
   path::append(directory_entry_path, directory_entry_name_utf8.str());
   it.CurrentEntry = directory_entry(directory_entry_path.str());
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code detail::directory_iterator_destruct(detail::DirIterState &it) {
@@ -762,7 +762,7 @@ error_code detail::directory_iterator_de
     ScopedFindHandle close(HANDLE(it.IterationHandle));
   it.IterationHandle = 0;
   it.CurrentEntry = directory_entry();
-  return error_code::success();
+  return error_code();
 }
 
 error_code detail::directory_iterator_increment(detail::DirIterState &it) {
@@ -788,7 +788,7 @@ error_code detail::directory_iterator_in
     return ec;
 
   it.CurrentEntry.replace_filename(Twine(directory_entry_path_utf8));
-  return error_code::success();
+  return error_code();
 }
 
 error_code openFileForRead(const Twine &Name, int &ResultFD) {
@@ -821,7 +821,7 @@ error_code openFileForRead(const Twine &
   }
 
   ResultFD = FD;
-  return error_code::success();
+  return error_code();
 }
 
 error_code openFileForWrite(const Twine &Name, int &ResultFD,
@@ -879,7 +879,7 @@ error_code openFileForWrite(const Twine
   }
 
   ResultFD = FD;
-  return error_code::success();
+  return error_code();
 }
 } // end namespace fs
 
@@ -923,7 +923,7 @@ llvm::error_code UTF8ToUTF16(llvm::Strin
   utf16.push_back(0);
   utf16.pop_back();
 
-  return llvm::error_code::success();
+  return llvm::error_code();
 }
 
 llvm::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len,
@@ -951,7 +951,7 @@ llvm::error_code UTF16ToUTF8(const wchar
   utf8.push_back(0);
   utf8.pop_back();
 
-  return llvm::error_code::success();
+  return llvm::error_code();
 }
 } // end namespace windows
 } // end namespace sys

Modified: llvm/trunk/lib/Support/Windows/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Process.inc?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Process.inc (original)
+++ llvm/trunk/lib/Support/Windows/Process.inc Fri May 30 20:37:45 2014
@@ -208,7 +208,7 @@ Process::GetArgumentVector(SmallVectorIm
   if (ec)
     return ec;
 
-  return error_code::success();
+  return error_code();
 }
 
 bool Process::StandardInIsUserInput() {

Modified: llvm/trunk/unittests/Support/MemoryTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/MemoryTest.cpp?rev=209952&r1=209951&r2=209952&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/MemoryTest.cpp (original)
+++ llvm/trunk/unittests/Support/MemoryTest.cpp Fri May 30 20:37:45 2014
@@ -59,7 +59,7 @@ protected:
 TEST_P(MappedMemoryTest, AllocAndRelease) {
   error_code EC;
   MemoryBlock M1 = Memory::allocateMappedMemory(sizeof(int), 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
 
   EXPECT_NE((void*)0, M1.base());
   EXPECT_LE(sizeof(int), M1.size());
@@ -70,11 +70,11 @@ TEST_P(MappedMemoryTest, AllocAndRelease
 TEST_P(MappedMemoryTest, MultipleAllocAndRelease) {
   error_code EC;
   MemoryBlock M1 = Memory::allocateMappedMemory(16, 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M2 = Memory::allocateMappedMemory(64, 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M3 = Memory::allocateMappedMemory(32, 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
 
   EXPECT_NE((void*)0, M1.base());
   EXPECT_LE(16U, M1.size());
@@ -90,7 +90,7 @@ TEST_P(MappedMemoryTest, MultipleAllocAn
   EXPECT_FALSE(Memory::releaseMappedMemory(M1));
   EXPECT_FALSE(Memory::releaseMappedMemory(M3));
   MemoryBlock M4 = Memory::allocateMappedMemory(16, 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   EXPECT_NE((void*)0, M4.base());
   EXPECT_LE(16U, M4.size());
   EXPECT_FALSE(Memory::releaseMappedMemory(M4));
@@ -105,7 +105,7 @@ TEST_P(MappedMemoryTest, BasicWrite) {
 
   error_code EC;
   MemoryBlock M1 = Memory::allocateMappedMemory(sizeof(int), 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
 
   EXPECT_NE((void*)0, M1.base());
   EXPECT_LE(sizeof(int), M1.size());
@@ -124,11 +124,11 @@ TEST_P(MappedMemoryTest, MultipleWrite)
     return;
   error_code EC;
   MemoryBlock M1 = Memory::allocateMappedMemory(sizeof(int), 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M2 = Memory::allocateMappedMemory(8 * sizeof(int), 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M3 = Memory::allocateMappedMemory(4 * sizeof(int), 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
 
   EXPECT_FALSE(doesOverlap(M1, M2));
   EXPECT_FALSE(doesOverlap(M2, M3));
@@ -160,7 +160,7 @@ TEST_P(MappedMemoryTest, MultipleWrite)
   EXPECT_FALSE(Memory::releaseMappedMemory(M3));
 
   MemoryBlock M4 = Memory::allocateMappedMemory(64 * sizeof(int), 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   EXPECT_NE((void*)0, M4.base());
   EXPECT_LE(64U * sizeof(int), M4.size());
   x = (int*)M4.base();
@@ -178,11 +178,11 @@ TEST_P(MappedMemoryTest, MultipleWrite)
 TEST_P(MappedMemoryTest, EnabledWrite) {
   error_code EC;
   MemoryBlock M1 = Memory::allocateMappedMemory(2 * sizeof(int), 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M2 = Memory::allocateMappedMemory(8 * sizeof(int), 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M3 = Memory::allocateMappedMemory(4 * sizeof(int), 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
 
   EXPECT_NE((void*)0, M1.base());
   EXPECT_LE(2U * sizeof(int), M1.size());
@@ -217,10 +217,10 @@ TEST_P(MappedMemoryTest, EnabledWrite) {
   EXPECT_EQ(6, y[6]);
 
   MemoryBlock M4 = Memory::allocateMappedMemory(16, 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   EXPECT_NE((void*)0, M4.base());
   EXPECT_LE(16U, M4.size());
-  EXPECT_EQ(error_code::success(), Memory::protectMappedMemory(M4, getTestableEquivalent(Flags)));
+  EXPECT_EQ(error_code(), Memory::protectMappedMemory(M4, getTestableEquivalent(Flags)));
   x = (int*)M4.base();
   *x = 4;
   EXPECT_EQ(4, *x);
@@ -231,11 +231,11 @@ TEST_P(MappedMemoryTest, EnabledWrite) {
 TEST_P(MappedMemoryTest, SuccessiveNear) {
   error_code EC;
   MemoryBlock M1 = Memory::allocateMappedMemory(16, 0, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M2 = Memory::allocateMappedMemory(64, &M1, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M3 = Memory::allocateMappedMemory(32, &M2, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
 
   EXPECT_NE((void*)0, M1.base());
   EXPECT_LE(16U, M1.size());
@@ -257,11 +257,11 @@ TEST_P(MappedMemoryTest, DuplicateNear)
   error_code EC;
   MemoryBlock Near((void*)(3*PageSize), 16);
   MemoryBlock M1 = Memory::allocateMappedMemory(16, &Near, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M2 = Memory::allocateMappedMemory(64, &Near, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M3 = Memory::allocateMappedMemory(32, &Near, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
 
   EXPECT_NE((void*)0, M1.base());
   EXPECT_LE(16U, M1.size());
@@ -279,11 +279,11 @@ TEST_P(MappedMemoryTest, ZeroNear) {
   error_code EC;
   MemoryBlock Near(0, 0);
   MemoryBlock M1 = Memory::allocateMappedMemory(16, &Near, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M2 = Memory::allocateMappedMemory(64, &Near, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M3 = Memory::allocateMappedMemory(32, &Near, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
 
   EXPECT_NE((void*)0, M1.base());
   EXPECT_LE(16U, M1.size());
@@ -305,11 +305,11 @@ TEST_P(MappedMemoryTest, ZeroSizeNear) {
   error_code EC;
   MemoryBlock Near((void*)(4*PageSize), 0);
   MemoryBlock M1 = Memory::allocateMappedMemory(16, &Near, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M2 = Memory::allocateMappedMemory(64, &Near, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
   MemoryBlock M3 = Memory::allocateMappedMemory(32, &Near, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
 
   EXPECT_NE((void*)0, M1.base());
   EXPECT_LE(16U, M1.size());
@@ -331,7 +331,7 @@ TEST_P(MappedMemoryTest, UnalignedNear)
   error_code EC;
   MemoryBlock Near((void*)(2*PageSize+5), 0);
   MemoryBlock M1 = Memory::allocateMappedMemory(15, &Near, Flags, EC);
-  EXPECT_EQ(error_code::success(), EC);
+  EXPECT_EQ(error_code(), EC);
 
   EXPECT_NE((void*)0, M1.base());
   EXPECT_LE(sizeof(int), M1.size());





More information about the llvm-commits mailing list