[Lldb-commits] [lldb] ea6b95d - [lldb][NFC] Make ArrayRef initialization more obvious in lldb-test.cpp

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 25 00:48:47 PST 2020


Author: Raphael Isemann
Date: 2020-02-25T09:48:17+01:00
New Revision: ea6b95dc2f68e7f3f06abc47fae44c91ceebef93

URL: https://github.com/llvm/llvm-project/commit/ea6b95dc2f68e7f3f06abc47fae44c91ceebef93
DIFF: https://github.com/llvm/llvm-project/commit/ea6b95dc2f68e7f3f06abc47fae44c91ceebef93.diff

LOG: [lldb][NFC] Make ArrayRef initialization more obvious in lldb-test.cpp

Seems like this code raised some alarm bells as it looks like an ArrayRef
to a temporary initializer list, but it's actually just calling the ArrayRef(T*, T*)
constructor. Let's clarify this and directly call the right ArrayRef constructor here.

Fixes rdar://problem/59176052

Added: 
    

Modified: 
    lldb/tools/lldb-test/lldb-test.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/tools/lldb-test/lldb-test.cpp b/lldb/tools/lldb-test/lldb-test.cpp
index 2e2310a94c74..ef6053297328 100644
--- a/lldb/tools/lldb-test/lldb-test.cpp
+++ b/lldb/tools/lldb-test/lldb-test.cpp
@@ -846,7 +846,7 @@ static void dumpSectionList(LinePrinter &Printer, const SectionList &List, bool
     if (opts::object::SectionContents) {
       lldb_private::DataExtractor Data;
       S->GetSectionData(Data);
-      ArrayRef<uint8_t> Bytes = {Data.GetDataStart(), Data.GetDataEnd()};
+      ArrayRef<uint8_t> Bytes(Data.GetDataStart(), Data.GetDataEnd());
       Printer.formatBinary("Data: ", Bytes, 0);
     }
 


        


More information about the lldb-commits mailing list