From 0013be16fff27ce7744210007e08ed7528212c65 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 21 Sep 2015 05:32:41 +0000 Subject: Use makeArrayRef or None to avoid unnecessarily mentioning the ArrayRef type extra times. NFC llvm-svn: 248140 --- llvm/lib/Object/MachOObjectFile.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'llvm/lib/Object/MachOObjectFile.cpp') diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index d1faf7be3af..571ed7a14fb 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -2204,65 +2204,65 @@ MachOObjectFile::getLinkOptHintsLoadCommand() const { ArrayRef MachOObjectFile::getDyldInfoRebaseOpcodes() const { if (!DyldInfoLoadCmd) - return ArrayRef(); + return None; MachO::dyld_info_command DyldInfo = getStruct(this, DyldInfoLoadCmd); const uint8_t *Ptr = reinterpret_cast( getPtr(this, DyldInfo.rebase_off)); - return ArrayRef(Ptr, DyldInfo.rebase_size); + return makeArrayRef(Ptr, DyldInfo.rebase_size); } ArrayRef MachOObjectFile::getDyldInfoBindOpcodes() const { if (!DyldInfoLoadCmd) - return ArrayRef(); + return None; MachO::dyld_info_command DyldInfo = getStruct(this, DyldInfoLoadCmd); const uint8_t *Ptr = reinterpret_cast( getPtr(this, DyldInfo.bind_off)); - return ArrayRef(Ptr, DyldInfo.bind_size); + return makeArrayRef(Ptr, DyldInfo.bind_size); } ArrayRef MachOObjectFile::getDyldInfoWeakBindOpcodes() const { if (!DyldInfoLoadCmd) - return ArrayRef(); + return None; MachO::dyld_info_command DyldInfo = getStruct(this, DyldInfoLoadCmd); const uint8_t *Ptr = reinterpret_cast( getPtr(this, DyldInfo.weak_bind_off)); - return ArrayRef(Ptr, DyldInfo.weak_bind_size); + return makeArrayRef(Ptr, DyldInfo.weak_bind_size); } ArrayRef MachOObjectFile::getDyldInfoLazyBindOpcodes() const { if (!DyldInfoLoadCmd) - return ArrayRef(); + return None; MachO::dyld_info_command DyldInfo = getStruct(this, DyldInfoLoadCmd); const uint8_t *Ptr = reinterpret_cast( getPtr(this, DyldInfo.lazy_bind_off)); - return ArrayRef(Ptr, DyldInfo.lazy_bind_size); + return makeArrayRef(Ptr, DyldInfo.lazy_bind_size); } ArrayRef MachOObjectFile::getDyldInfoExportsTrie() const { if (!DyldInfoLoadCmd) - return ArrayRef(); + return None; MachO::dyld_info_command DyldInfo = getStruct(this, DyldInfoLoadCmd); const uint8_t *Ptr = reinterpret_cast( getPtr(this, DyldInfo.export_off)); - return ArrayRef(Ptr, DyldInfo.export_size); + return makeArrayRef(Ptr, DyldInfo.export_size); } ArrayRef MachOObjectFile::getUuid() const { if (!UuidLoadCmd) - return ArrayRef(); + return None; // Returning a pointer is fine as uuid doesn't need endian swapping. const char *Ptr = UuidLoadCmd + offsetof(MachO::uuid_command, uuid); - return ArrayRef(reinterpret_cast(Ptr), 16); + return makeArrayRef(reinterpret_cast(Ptr), 16); } StringRef MachOObjectFile::getStringTableData() const { -- cgit v1.2.3