diff options
author | Craig Topper <craig.topper@gmail.com> | 2015-09-21 05:32:41 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2015-09-21 05:32:41 +0000 |
commit | 0013be16fff27ce7744210007e08ed7528212c65 (patch) | |
tree | 623d42291b99ad1b5a7972fca60ec30e7b6d235d /llvm/tools | |
parent | 18929c50694220481b53784dad9e7a5a7aaec919 (diff) | |
download | bcm5719-llvm-0013be16fff27ce7744210007e08ed7528212c65.tar.gz bcm5719-llvm-0013be16fff27ce7744210007e08ed7528212c65.zip |
Use makeArrayRef or None to avoid unnecessarily mentioning the ArrayRef type extra times. NFC
llvm-svn: 248140
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp | 6 | ||||
-rw-r--r-- | llvm/tools/llvm-objdump/COFFDump.cpp | 4 | ||||
-rw-r--r-- | llvm/tools/llvm-objdump/MachODump.cpp | 16 | ||||
-rw-r--r-- | llvm/tools/llvm-readobj/Win64EHDumper.cpp | 2 |
4 files changed, 14 insertions, 14 deletions
diff --git a/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp b/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp index bea34fee3aa..d45a28a3b0f 100644 --- a/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp +++ b/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp @@ -218,7 +218,7 @@ static void dumpCXXData(const ObjectFile *Obj) { // Complete object locators in the MS-ABI start with '??_R4' else if (SymName.startswith("??_R4")) { CompleteObjectLocator COL; - COL.Data = ArrayRef<little32_t>( + COL.Data = makeArrayRef( reinterpret_cast<const little32_t *>(SymContents.data()), 3); StringRef *I = std::begin(COL.Symbols), *E = std::end(COL.Symbols); collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I, E); @@ -227,7 +227,7 @@ static void dumpCXXData(const ObjectFile *Obj) { // Class hierarchy descriptors in the MS-ABI start with '??_R3' else if (SymName.startswith("??_R3")) { ClassHierarchyDescriptor CHD; - CHD.Data = ArrayRef<little32_t>( + CHD.Data = makeArrayRef( reinterpret_cast<const little32_t *>(SymContents.data()), 3); StringRef *I = std::begin(CHD.Symbols), *E = std::end(CHD.Symbols); collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I, E); @@ -243,7 +243,7 @@ static void dumpCXXData(const ObjectFile *Obj) { // Base class descriptors in the MS-ABI start with '??_R1' else if (SymName.startswith("??_R1")) { BaseClassDescriptor BCD; - BCD.Data = ArrayRef<little32_t>( + BCD.Data = makeArrayRef( reinterpret_cast<const little32_t *>(SymContents.data()) + 1, 5); StringRef *I = std::begin(BCD.Symbols), *E = std::end(BCD.Symbols); collectRelocatedSymbols(Obj, Sec, SecAddress, SymAddress, SymSize, I, E); diff --git a/llvm/tools/llvm-objdump/COFFDump.cpp b/llvm/tools/llvm-objdump/COFFDump.cpp index 53500a4bb76..001e352c8d0 100644 --- a/llvm/tools/llvm-objdump/COFFDump.cpp +++ b/llvm/tools/llvm-objdump/COFFDump.cpp @@ -151,7 +151,7 @@ static void printAllUnwindCodes(ArrayRef<UnwindCode> UCs) { << " remaining in buffer"; return ; } - printUnwindCode(ArrayRef<UnwindCode>(I, E)); + printUnwindCode(makeArrayRef(I, E)); I += UsedSlots; } } @@ -433,7 +433,7 @@ static void printWin64EHUnwindInfo(const Win64EH::UnwindInfo *UI) { if (UI->NumCodes) outs() << " Unwind Codes:\n"; - printAllUnwindCodes(ArrayRef<UnwindCode>(&UI->UnwindCodes[0], UI->NumCodes)); + printAllUnwindCodes(makeArrayRef(&UI->UnwindCodes[0], UI->NumCodes)); outs() << "\n"; outs().flush(); diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index df8ac09846c..8a76d8a3d1b 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -205,19 +205,19 @@ static uint64_t DumpDataInCode(const uint8_t *bytes, uint64_t Length, case MachO::DICE_KIND_DATA: if (Length >= 4) { if (!NoShowRawInsn) - dumpBytes(ArrayRef<uint8_t>(bytes, 4), outs()); + dumpBytes(makeArrayRef(bytes, 4), outs()); Value = bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; outs() << "\t.long " << Value; Size = 4; } else if (Length >= 2) { if (!NoShowRawInsn) - dumpBytes(ArrayRef<uint8_t>(bytes, 2), outs()); + dumpBytes(makeArrayRef(bytes, 2), outs()); Value = bytes[1] << 8 | bytes[0]; outs() << "\t.short " << Value; Size = 2; } else { if (!NoShowRawInsn) - dumpBytes(ArrayRef<uint8_t>(bytes, 2), outs()); + dumpBytes(makeArrayRef(bytes, 2), outs()); Value = bytes[0]; outs() << "\t.byte " << Value; Size = 1; @@ -229,14 +229,14 @@ static uint64_t DumpDataInCode(const uint8_t *bytes, uint64_t Length, break; case MachO::DICE_KIND_JUMP_TABLE8: if (!NoShowRawInsn) - dumpBytes(ArrayRef<uint8_t>(bytes, 1), outs()); + dumpBytes(makeArrayRef(bytes, 1), outs()); Value = bytes[0]; outs() << "\t.byte " << format("%3u", Value) << "\t@ KIND_JUMP_TABLE8\n"; Size = 1; break; case MachO::DICE_KIND_JUMP_TABLE16: if (!NoShowRawInsn) - dumpBytes(ArrayRef<uint8_t>(bytes, 2), outs()); + dumpBytes(makeArrayRef(bytes, 2), outs()); Value = bytes[1] << 8 | bytes[0]; outs() << "\t.short " << format("%5u", Value & 0xffff) << "\t@ KIND_JUMP_TABLE16\n"; @@ -245,7 +245,7 @@ static uint64_t DumpDataInCode(const uint8_t *bytes, uint64_t Length, case MachO::DICE_KIND_JUMP_TABLE32: case MachO::DICE_KIND_ABS_JUMP_TABLE32: if (!NoShowRawInsn) - dumpBytes(ArrayRef<uint8_t>(bytes, 4), outs()); + dumpBytes(makeArrayRef(bytes, 4), outs()); Value = bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; outs() << "\t.long " << Value; if (Kind == MachO::DICE_KIND_JUMP_TABLE32) @@ -6217,7 +6217,7 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF, DebugOut, Annotations); if (gotInst) { if (!NoShowRawInsn) { - dumpBytes(ArrayRef<uint8_t>(Bytes.data() + Index, Size), outs()); + dumpBytes(makeArrayRef(Bytes.data() + Index, Size), outs()); } formatted_raw_ostream FormattedOS(outs()); StringRef AnnotationsStr = Annotations.str(); @@ -6281,7 +6281,7 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF, } if (!NoShowRawInsn) { outs() << "\t"; - dumpBytes(ArrayRef<uint8_t>(Bytes.data() + Index, InstSize), outs()); + dumpBytes(makeArrayRef(Bytes.data() + Index, InstSize), outs()); } IP->printInst(&Inst, outs(), "", *STI); outs() << "\n"; diff --git a/llvm/tools/llvm-readobj/Win64EHDumper.cpp b/llvm/tools/llvm-readobj/Win64EHDumper.cpp index ffb0855606a..2da5ae3200f 100644 --- a/llvm/tools/llvm-readobj/Win64EHDumper.cpp +++ b/llvm/tools/llvm-readobj/Win64EHDumper.cpp @@ -254,7 +254,7 @@ void Dumper::printUnwindInfo(const Context &Ctx, const coff_section *Section, return; } - printUnwindCode(UI, ArrayRef<UnwindCode>(UCI, UCE)); + printUnwindCode(UI, makeArrayRef(UCI, UCE)); UCI = UCI + UsedSlots - 1; } } |