}
}
- ec = error_code::success();
+ ec = error_code();
}
// Get the symbol table index in the symtab section given a symbol
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 ->() {
if (EC)
return EC;
Result = Status.getSize();
- return error_code::success();
+ return error_code();
}
/// @brief Set the file modification and access time.
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) {}
case BitstreamEntry::Error:
return Error(MalformedBlock);
case BitstreamEntry::EndBlock:
- return error_code::success();
+ return error_code();
case BitstreamEntry::Record:
// The interesting case.
break;
*Kind = GetAttrFromCode(Code);
if (*Kind == Attribute::None)
return Error(InvalidValue);
- return error_code::success();
+ return error_code();
}
error_code BitcodeReader::ParseAttributeGroupBlock() {
case BitstreamEntry::Error:
return Error(MalformedBlock);
case BitstreamEntry::EndBlock:
- return error_code::success();
+ return error_code();
case BitstreamEntry::Record:
// The interesting case.
break;
case BitstreamEntry::EndBlock:
if (NumRecords != TypeList.size())
return Error(MalformedBlock);
- return error_code::success();
+ return error_code();
case BitstreamEntry::Record:
// The interesting case.
break;
case BitstreamEntry::Error:
return Error(MalformedBlock);
case BitstreamEntry::EndBlock:
- return error_code::success();
+ return error_code();
case BitstreamEntry::Record:
// The interesting case.
break;
case BitstreamEntry::Error:
return Error(MalformedBlock);
case BitstreamEntry::EndBlock:
- return error_code::success();
+ return error_code();
case BitstreamEntry::Record:
// The interesting case.
break;
FunctionPrefixWorklist.pop_back();
}
- return error_code::success();
+ return error_code();
}
static APInt ReadWideAPInt(ArrayRef<uint64_t> Vals, unsigned TypeBits) {
// 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;
case BitstreamEntry::Error:
return Error(MalformedBlock);
case BitstreamEntry::EndBlock:
- return error_code::success();
+ return error_code();
case BitstreamEntry::Record:
// The interesting case.
break;
// Skip over the function block for now.
if (Stream.SkipBlock())
return Error(InvalidRecord);
- return error_code::success();
+ return error_code();
}
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) {
// just finish the parse now.
if (LazyStreamer && SeenValueSymbolTable) {
NextUnreadBit = Stream.GetCurrentBitNo();
- return error_code::success();
+ return error_code();
}
break;
case bitc::USELIST_BLOCK_ID:
// need to understand them all.
while (1) {
if (Stream.AtEndOfStream())
- return error_code::success();
+ return error_code();
BitstreamEntry Entry =
Stream.advance(BitstreamCursor::AF_DontAutoprocessAbbrevs);
case BitstreamEntry::Error:
return Error(MalformedBlock);
case BitstreamEntry::EndBlock:
- return error_code::success();
+ return error_code();
case BitstreamEntry::SubBlock:
switch (Entry.ID) {
if (error_code EC = ParseModule(false))
return EC;
if (LazyStreamer)
- return error_code::success();
+ return error_code();
break;
default:
if (Stream.SkipBlock())
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);
}
case BitstreamEntry::Error:
return Error(MalformedBlock);
case BitstreamEntry::EndBlock:
- return error_code::success();
+ return error_code();
case BitstreamEntry::Record:
// The interesting case.
break;
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)
case BitstreamEntry::Error:
return Error(MalformedBlock);
case BitstreamEntry::EndBlock:
- return error_code::success();
+ return error_code();
case BitstreamEntry::Record:
// The interesting case.
break;
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
if (error_code EC = ParseModule(true))
return EC;
}
- return error_code::success();
+ return error_code();
}
//===----------------------------------------------------------------------===//
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!");
}
}
- return error_code::success();
+ return error_code();
}
bool BitcodeReader::isDematerializable(const GlobalValue *GV) const {
UpgradeInstWithTBAATag(InstsWithTBAATag[I]);
UpgradeDebugInfo(*M);
- return error_code::success();
+ return error_code();
}
error_code BitcodeReader::InitStream() {
StreamFile.reset(new BitstreamReader(BufPtr, BufEnd));
Stream.init(*StreamFile);
- return error_code::success();
+ return error_code();
}
error_code BitcodeReader::InitLazyStream() {
Bytes->dropLeadingBytes(bitcodeStart - buf);
Bytes->setKnownObjectSize(bitcodeEnd - bitcodeStart);
}
- return error_code::success();
+ return error_code();
}
namespace {
}
}
- return error_code::success();
+ return error_code();
}
void SectionMemoryManager::invalidateInstructionCache() {
error_code Module::materializeAll() {
if (!Materializer)
- return error_code::success();
+ return error_code();
return Materializer->MaterializeModule(this);
}
return EC;
Materializer.reset();
- return error_code::success();
+ return error_code();
}
//===----------------------------------------------------------------------===//
.toStringRef(Path)
: Name,
false));
- return error_code::success();
+ return error_code();
}
error_code Archive::Child::getAsBinary(std::unique_ptr<Binary> &Result,
if (Filename == "-") {
Fd = 0;
sys::ChangeStdinToBinary();
- return error_code::success();
+ return error_code();
}
return sys::fs::openFileForRead(Filename, Fd);
if (Result)
MappedFile.release();
- return error_code::success();
+ return error_code();
}
error_code FileOutputBuffer::commit(int64_t NewSmallerSize) {
} while (ReadBytes != 0);
Result.reset(MemoryBuffer::getMemBufferCopy(Buffer, BufferName));
- return error_code::success();
+ return error_code();
}
static error_code getFileAux(const char *Filename,
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);
}
Result.swap(SB);
- return error_code::success();
+ return error_code();
}
error_code MemoryBuffer::getOpenFile(int FD, const char *Filename,
return EC;
}
- return error_code::success();
+ return error_code();
}
case FS_Name: {
return EC;
if (Exists)
goto retry_random_path;
- return error_code::success();
+ return error_code();
}
case FS_Dir: {
goto retry_random_path;
return EC;
}
- return error_code::success();
+ return error_code();
}
}
llvm_unreachable("Invalid Type");
if (EC)
return EC;
Result = Status.getUniqueID();
- return error_code::success();
+ return error_code();
}
error_code createUniqueFile(const Twine &Model, int &ResultFd,
// 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;
path::append(current_dir, p);
// Set path to the result.
path.swap(current_dir);
- return error_code::success();
+ return error_code();
}
if (!rootName && rootDirectory) {
path::append(curDirRootName, p);
// Set path to the result.
path.swap(curDirRootName);
- return error_code::success();
+ return error_code();
}
if (rootName && !rootDirectory) {
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 "
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) {
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) {
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.
return ec;
result = identify_magic(Magic);
- return error_code::success();
+ return error_code();
}
error_code directory_entry::status(file_status &result) const {
const MemoryBlock *const NearBlock,
unsigned PFlags,
error_code &EC) {
- EC = error_code::success();
+ EC = error_code();
if (NumBytes == 0)
return MemoryBlock();
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());
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());
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
result.clear();
StringRef d(dir);
result.append(d.begin(), d.end());
- return error_code::success();
+ return error_code();
}
namespace llvm {
!llvm::sys::fs::status(".", DotStatus) &&
PWDStatus.getUniqueID() == DotStatus.getUniqueID()) {
result.append(pwd, pwd + strlen(pwd));
- return error_code::success();
+ return error_code();
}
#ifdef MAXPATHLEN
}
result.set_size(strlen(result.data()));
- return error_code::success();
+ return error_code();
}
error_code create_directory(const Twine &path, bool IgnoreExisting) {
return error_code(errno, system_category());
}
- return error_code::success();
+ return error_code();
}
error_code normalize_separators(SmallVectorImpl<char> &Path) {
*PI = '/';
}
}
- return error_code::success();
+ return error_code();
}
// Note that we are using symbolic link because hard links are not supported by
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) {
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
return error_code(errno, system_category());
}
- return error_code::success();
+ return error_code();
}
error_code rename(const Twine &from, const Twine &to) {
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) {
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) {
} else
result = true;
- return error_code::success();
+ return error_code();
}
bool can_write(const Twine &Path) {
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,
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) {
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();
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);
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,
::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) {
} else
return directory_iterator_destruct(it);
- return error_code::success();
+ return error_code();
}
error_code get_magic(const Twine &path, uint32_t len,
}
std::fclose(file);
result.set_size(size);
- return error_code::success();
+ return error_code();
}
error_code openFileForRead(const Twine &Name, int &ResultFD) {
if (errno != EINTR)
return error_code(errno, system_category());
}
- return error_code::success();
+ return error_code();
}
error_code openFileForWrite(const Twine &Name, int &ResultFD,
if (errno != EINTR)
return error_code(errno, system_category());
}
- return error_code::success();
+ return error_code();
}
} // end namespace fs
SpecificBumpPtrAllocator<char> &) {
ArgsOut.append(ArgsIn.begin(), ArgsIn.end());
- return error_code::success();
+ return error_code();
}
bool Process::StandardInIsUserInput() {
const MemoryBlock *const NearBlock,
unsigned Flags,
error_code &EC) {
- EC = error_code::success();
+ EC = error_code();
if (NumBytes == 0)
return MemoryBlock();
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());
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);
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
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;
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;
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.
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) {
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),
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) {
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;
result = false;
} else
result = true;
- return error_code::success();
+ return error_code();
}
bool can_write(const Twine &Path) {
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) {
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;
Info.ftLastWriteTime.dwLowDateTime,
Info.dwVolumeSerialNumber, Info.nFileSizeHigh,
Info.nFileSizeLow, Info.nFileIndexHigh, Info.nFileIndexLow);
- return error_code::success();
+ return error_code();
}
handle_status_error:
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))
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,
}
result.set_size(len);
- return error_code::success();
+ return error_code();
}
error_code mapped_file_region::init(int FD, bool CloseFD, uint64_t Offset) {
_close(FileDescriptor); // Also closes FileHandle.
} else
::CloseHandle(FileHandle);
- return error_code::success();
+ return error_code();
}
mapped_file_region::mapped_file_region(const Twine &path,
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) {
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) {
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) {
}
ResultFD = FD;
- return error_code::success();
+ return error_code();
}
error_code openFileForWrite(const Twine &Name, int &ResultFD,
}
ResultFD = FD;
- return error_code::success();
+ return error_code();
}
} // end namespace fs
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,
utf8.push_back(0);
utf8.pop_back();
- return llvm::error_code::success();
+ return llvm::error_code();
}
} // end namespace windows
} // end namespace sys
if (ec)
return ec;
- return error_code::success();
+ return error_code();
}
bool Process::StandardInIsUserInput() {
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());
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());
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));
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());
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));
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();
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());
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);
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());
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());
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());
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());
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());