Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216525 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper
2014-08-27 05:25:25 +00:00
parent 16edb0e930
commit 3512034554
40 changed files with 102 additions and 131 deletions

View File

@ -783,8 +783,7 @@ ArrayRef<uint8_t> COFFObjectFile::getSymbolAuxData(
== 0 && "Aux Symbol data did not point to the beginning of a symbol");
# endif
}
return ArrayRef<uint8_t>(Aux,
Symbol->NumberOfAuxSymbols * sizeof(coff_symbol));
return makeArrayRef(Aux, Symbol->NumberOfAuxSymbols * sizeof(coff_symbol));
}
std::error_code COFFObjectFile::getSectionName(const coff_section *Sec,
@ -825,8 +824,8 @@ COFFObjectFile::getSectionContents(const coff_section *Sec,
uintptr_t ConEnd = ConStart + Sec->SizeOfRawData;
if (ConEnd > uintptr_t(Data.getBufferEnd()))
return object_error::parse_failed;
Res = ArrayRef<uint8_t>(reinterpret_cast<const unsigned char*>(ConStart),
Sec->SizeOfRawData);
Res = makeArrayRef(reinterpret_cast<const uint8_t*>(ConStart),
Sec->SizeOfRawData);
return object_error::success;
}