[Lldb-commits] [PATCH] D140839: [lldb] Enable TestFrameFormatNameWithArgs in case of cross compilation

2023-01-16 Thread Michael Buch via Phabricator via lldb-commits
Michael137 added inline comments.



Comment at: lldb/test/Shell/helper/build.py:29
 default='host',
-choices=['32', '64', 'host'],
 help='Specify the architecture to target.')

Why was this needed?

Other than that, LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140839/new/

https://reviews.llvm.org/D140839

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D141828: [WIP][lldb] Add support for DW_AT_default_value in template params

2023-01-16 Thread Michael Buch via Phabricator via lldb-commits
Michael137 created this revision.
Michael137 added a reviewer: dblaikie.
Herald added a reviewer: shafik.
Herald added a project: All.
Michael137 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

**Summary**

This patch makes LLDB understand the `DW_AT_default_value` on
template argument DIEs. As a result, type summaries will no
longer contain the defaulted template arguments, reducing
noise substantially. E.g.,

Before:

  (lldb) v nested
  (std::vector, 
std::allocator >, std::allocator, std::allocator > > >, 
std::allocator, 
std::allocator >, std::allocator, std::allocator  > > > > >) nested = size=0 {}

After:

  (lldb) v nested
  (std::vector > >) nested = size=0 {}

See discussion in https://reviews.llvm.org/D140423

**TODO**

- TODO: need to adjust API tests


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141828

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp


Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2026,6 +2026,7 @@
 CompilerType clang_type;
 uint64_t uval64 = 0;
 bool uval64_valid = false;
+bool is_default_template_arg = false;
 if (num_attributes > 0) {
   DWARFFormValue form_value;
   for (size_t i = 0; i < num_attributes; ++i) {
@@ -2056,6 +2057,11 @@
 uval64 = form_value.Unsigned();
   }
   break;
+case DW_AT_default_value:
+  if (attributes.ExtractFormValueAtIndex(i, form_value)) {
+is_default_template_arg = form_value.Boolean();
+  }
+  break;
 default:
   break;
 }
@@ -2078,19 +2084,21 @@
   if (!size)
 return false;
   llvm::APInt apint(*size, uval64, is_signed);
-  template_param_infos.InsertArg(
-  name,
+  auto TA =
   clang::TemplateArgument(ast, llvm::APSInt(apint, !is_signed),
-  ClangUtil::GetQualType(clang_type)));
+  ClangUtil::GetQualType(clang_type));
+  TA.setIsDefaulted(is_default_template_arg);
+  template_param_infos.InsertArg(name, std::move(TA));
 } else {
-  template_param_infos.InsertArg(
-  name,
-  clang::TemplateArgument(ClangUtil::GetQualType(clang_type)));
+  auto TA = 
clang::TemplateArgument(ClangUtil::GetQualType(clang_type));
+  TA.setIsDefaulted(is_default_template_arg);
+  template_param_infos.InsertArg(name, std::move(TA));
 }
   } else {
 auto *tplt_type = m_ast.CreateTemplateTemplateParmDecl(template_name);
-template_param_infos.InsertArg(
-name, clang::TemplateArgument(clang::TemplateName(tplt_type)));
+auto TA = clang::TemplateArgument(clang::TemplateName(tplt_type));
+TA.setIsDefaulted(is_default_template_arg);
+template_param_infos.InsertArg(name, std::move(TA));
   }
 }
   }


Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2026,6 +2026,7 @@
 CompilerType clang_type;
 uint64_t uval64 = 0;
 bool uval64_valid = false;
+bool is_default_template_arg = false;
 if (num_attributes > 0) {
   DWARFFormValue form_value;
   for (size_t i = 0; i < num_attributes; ++i) {
@@ -2056,6 +2057,11 @@
 uval64 = form_value.Unsigned();
   }
   break;
+case DW_AT_default_value:
+  if (attributes.ExtractFormValueAtIndex(i, form_value)) {
+is_default_template_arg = form_value.Boolean();
+  }
+  break;
 default:
   break;
 }
@@ -2078,19 +2084,21 @@
   if (!size)
 return false;
   llvm::APInt apint(*size, uval64, is_signed);
-  template_param_infos.InsertArg(
-  name,
+  auto TA =
   clang::TemplateArgument(ast, llvm::APSInt(apint, !is_signed),
-  ClangUtil::GetQualType(clang_type)));
+  ClangUtil::GetQualType(clang_type));
+  TA.setIsDefaulted(is_default_template_arg);
+  template_param_infos.InsertArg(name, std::move(TA));
 } else {
-  template_param_infos.InsertArg(
-  name,
-  clang::TemplateArgument(ClangUtil::GetQualType(clang_type)));
+  auto TA = clang::TemplateArgument(ClangUtil::GetQualType(clang_type));
+  TA.setIsDefaulted(is_default_template_arg);
+  template_param_infos.InsertAr

[Lldb-commits] [lldb] c8e4eb1 - [LLDB] Fix help text for "platform settings"

2023-01-16 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2023-01-16T09:37:29Z
New Revision: c8e4eb1043f4be6d9d823ce8f3238dca3479ffd4

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

LOG: [LLDB] Fix help text for "platform settings"

This claims to take a platform name argument but doesn't.

That was probably the intent in fbb7634934d40548b650574a2f2a85ab41527674
but it has only ever worked with the current platform.

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D136928

Added: 


Modified: 
lldb/source/Commands/CommandObjectPlatform.cpp

Removed: 




diff  --git a/lldb/source/Commands/CommandObjectPlatform.cpp 
b/lldb/source/Commands/CommandObjectPlatform.cpp
index 69c44fe8c8c44..1ab218fa6fb27 100644
--- a/lldb/source/Commands/CommandObjectPlatform.cpp
+++ b/lldb/source/Commands/CommandObjectPlatform.cpp
@@ -379,8 +379,7 @@ class CommandObjectPlatformSettings : public 
CommandObjectParsed {
 public:
   CommandObjectPlatformSettings(CommandInterpreter &interpreter)
   : CommandObjectParsed(interpreter, "platform settings",
-"Set settings for the current target's platform, "
-"or for a platform by name.",
+"Set settings for the current target's platform.",
 "platform settings", 0),
 m_option_working_dir(LLDB_OPT_SET_1, false, "working-dir", 'w',
  
CommandCompletions::eRemoteDiskDirectoryCompletion,



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D136928: [LLDB] Fix help text for "platform settings"

2023-01-16 Thread David Spickett via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc8e4eb1043f4: [LLDB] Fix help text for "platform 
settings" (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136928/new/

https://reviews.llvm.org/D136928

Files:
  lldb/source/Commands/CommandObjectPlatform.cpp


Index: lldb/source/Commands/CommandObjectPlatform.cpp
===
--- lldb/source/Commands/CommandObjectPlatform.cpp
+++ lldb/source/Commands/CommandObjectPlatform.cpp
@@ -379,8 +379,7 @@
 public:
   CommandObjectPlatformSettings(CommandInterpreter &interpreter)
   : CommandObjectParsed(interpreter, "platform settings",
-"Set settings for the current target's platform, "
-"or for a platform by name.",
+"Set settings for the current target's platform.",
 "platform settings", 0),
 m_option_working_dir(LLDB_OPT_SET_1, false, "working-dir", 'w',
  
CommandCompletions::eRemoteDiskDirectoryCompletion,


Index: lldb/source/Commands/CommandObjectPlatform.cpp
===
--- lldb/source/Commands/CommandObjectPlatform.cpp
+++ lldb/source/Commands/CommandObjectPlatform.cpp
@@ -379,8 +379,7 @@
 public:
   CommandObjectPlatformSettings(CommandInterpreter &interpreter)
   : CommandObjectParsed(interpreter, "platform settings",
-"Set settings for the current target's platform, "
-"or for a platform by name.",
+"Set settings for the current target's platform.",
 "platform settings", 0),
 m_option_working_dir(LLDB_OPT_SET_1, false, "working-dir", 'w',
  CommandCompletions::eRemoteDiskDirectoryCompletion,
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D141828: [WIP][lldb] Add support for DW_AT_default_value in template params

2023-01-16 Thread Michael Buch via Phabricator via lldb-commits
Michael137 updated this revision to Diff 489488.
Michael137 added a comment.

- Add tests


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141828/new/

https://reviews.llvm.org/D141828

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unique_ptr/TestDataFormatterLibcxxUniquePtr.py
  lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp

Index: lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
===
--- lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
+++ lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
@@ -6,11 +6,14 @@
 //
 //===--===//
 
+#include "Plugins/Platform/MacOSX/PlatformMacOSX.h"
+#include "Plugins/Platform/MacOSX/PlatformRemoteMacOSX.h"
 #include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h"
 #include "Plugins/SymbolFile/DWARF/DWARFCompileUnit.h"
 #include "Plugins/SymbolFile/DWARF/DWARFDIE.h"
 #include "TestingSupport/Symbol/ClangTestUtils.h"
 #include "TestingSupport/Symbol/YAMLModuleTester.h"
+#include "lldb/Core/Debugger.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
@@ -19,7 +22,23 @@
 using namespace lldb_private::dwarf;
 
 namespace {
-class DWARFASTParserClangTests : public testing::Test {};
+static std::once_flag debugger_initialize_flag;
+
+class DWARFASTParserClangTests : public testing::Test {
+  void SetUp() override {
+HostInfo::Initialize();
+PlatformMacOSX::Initialize();
+std::call_once(debugger_initialize_flag,
+   []() { Debugger::Initialize(nullptr); });
+ArchSpec arch("x86_64-apple-macosx-");
+Platform::SetHostPlatform(
+PlatformRemoteMacOSX::CreateInstance(true, &arch, nullptr, nullptr));
+  }
+  void TearDown() override {
+PlatformMacOSX::Terminate();
+HostInfo::Terminate();
+  }
+};
 
 class DWARFASTParserClangStub : public DWARFASTParserClang {
 public:
@@ -404,3 +423,367 @@
   EXPECT_THAT_EXPECTED(Extract(ast.UnsignedIntTy, uint_max + 2),
llvm::Failed());
 }
+
+TEST_F(DWARFASTParserClangTests, TestDefaultTemplateParamParsing) {
+  // Tests parsing DW_AT_default_value for template parameters.
+
+  // template 
+  // class foo {};
+  //
+  // template  class CT = foo>
+  // class baz {};
+  //
+  // template >
+  // class bar {};
+  //
+  // int main() {
+  // bar<> br;
+  // baz<> bz;
+  // return 0;
+  // }
+  //
+  // YAML generated on Linux using obj2yaml on the above program
+  // compiled with Clang.
+  const char *yamldata = R"(
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:ELFDATA2LSB
+  Type:ET_REL
+  Machine: EM_AARCH64
+  SectionHeaderStringTable: .strtab
+Sections:
+  - Name:.text
+Type:SHT_PROGBITS
+Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
+AddressAlign:0x4
+Content: FF4300D1E0031F2AFF0F00B9FF430091C0035FD6
+  - Name:.linker-options
+Type:SHT_LLVM_LINKER_OPTIONS
+Flags:   [ SHF_EXCLUDE ]
+AddressAlign:0x1
+Content: ''
+  - Name:.debug_abbrev
+Type:SHT_PROGBITS
+AddressAlign:0x1
+Content: 011101252513050325721710171B25111B12067317022E0B1206401803253A0B3B0B49133F19033400021803253A0B3B0B491304240003253E0B0B0B050201360B03250B0B3A0B3B0B062F00491303251E19073000491303251E191C0D083000491303251E191C0F09020003253C190A8682010003251E1990422500
+  - Name:.debug_info
+Type:SHT_PROGBITS
+AddressAlign:0x1
+Content: 7F000500010801002100010200140002001400016F03000B49000302910B05000C4D000302910A0E000D780404050405050D010009066E000707490008030872000A010676000C000406080104090201090B0505110100050A0F10
+  - Name:.debug_str_offsets
+Type:SHT_PROGBITS
+AddressAlign:0x1
+Content: 4C000500
+  - Name:.comment
+Type:SHT_PROGBITS
+Flags:   [ SHF_MERGE, SHF_STRINGS ]
+AddressAlign:0x1
+EntSize: 0x1
+Content: 00636C616E672076657273696F6E2031362E302E30202868747470733A2F2F6769746875622E636F6

[Lldb-commits] [PATCH] D140630: [lldb-vscode] Add data breakpoint support

2023-01-16 Thread Callum Macmillan via Phabricator via lldb-commits
cimacmillan added a comment.

@clayborg Thanks for your feedback. I'm part the way through implementing your 
changes. Specifically about this point:

> I seem to remember that it will disable this watchpoint as soon as a local 
> variable goes out of scope, though I might not be remember things correctly

This is a behaviour I'd like to address, where for instance watchpoints are 
triggered in different functions because the stack frame addresses align. I 
have this example, I can add a test for:

  int test_a() {
  int x = 10; <- watchpoint set here
  x = 20; <- watchpoint triggered here
  }
  
  int test_b() {
  int b = 10; <- watchpoint triggered here also
  b = 20;
  }
  
  int main() {
  test_a();
  test_b();

I've refactored the Watchpoint class to use "SBValue::Watch", and I can still 
reproduce this behaviour. I also can't find where this watchpoint disable on 
scope change might be implemented. Do you have any suggestions for this? Thanks


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140630/new/

https://reviews.llvm.org/D140630

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D140630: [lldb-vscode] Add data breakpoint support

2023-01-16 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D140630#4056641 , @cimacmillan 
wrote:

> @clayborg Thanks for your feedback. I'm part the way through implementing 
> your changes. Specifically about this point:
>
>> I seem to remember that it will disable this watchpoint as soon as a local 
>> variable goes out of scope, though I might not be remember things correctly
>
> This is a behaviour I'd like to address, where for instance watchpoints are 
> triggered in different functions because the stack frame addresses align. I 
> have this example, I can add a test for:
>
>   int test_a() {
>   int x = 10; <- watchpoint set here
>   x = 20; <- watchpoint triggered here
>   }
>   
>   int test_b() {
>   int b = 10; <- watchpoint triggered here also
>   b = 20;
>   }
>   
>   int main() {
>   test_a();
>   test_b();
>
> I've refactored the Watchpoint class to use "SBValue::Watch", and I can still 
> reproduce this behaviour. I also can't find where this watchpoint disable on 
> scope change might be implemented. Do you have any suggestions for this? 
> Thanks

Upon further examination it doesn't seem like this is happening, though it 
should be possible to add some things to the watchpoint classes to make this 
happen. This is beyond the scope of this fix though, so no need to do it unless 
you have time. What we would need to do is store a StackID (see 
"lldb/Target/StackID.h") and thread ID with the watchpoint. When the watchpoint 
triggers, we would need to check if the StackID + thread ID is valid (we should 
store this info with the watchpoint when setting it from a SBValue::Watch(...), 
or not if we just watch the address) still exists in the thread's stack 
somewhere. If it does still exist then stop and report, else clear the 
watchpoint and don't report anything. If the stack ID isn't valid then we 
always stop.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140630/new/

https://reviews.llvm.org/D140630

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D140358: [lldb-vscode] Add support for disassembly view

2023-01-16 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:2177
+  const auto max_instruction_size = g_vsc.target.GetMaximumOpcodeByteSize();
+  const auto bytes_offset = -instruction_offset * max_instruction_size;
+  auto start_addr = base_addr - bytes_offset;

eloparco wrote:
> clayborg wrote:
> > Just checked out your changes, and you are still just subtracting a value 
> > from the start address and attempting to disassemble from memory which is 
> > the problem. We need to take that subtracted address, and look it up as 
> > suggested in previous code examples I posted. If you find a function to 
> > symbol, ask those objects for their instructions. and then try to use 
> > those. 
> > 
> > But basically for _any_ disassembly this is what I would recommend doing:
> > - first resolve the "start_address" (no matter how you come up the address) 
> > that want to disassemble into a SBAddress
> > - check its section. If the section is valid and contains instructions, 
> > call a function that will disassemble the address range for the section 
> > that starts at "start_address" and ends at the end of the section. We can 
> > call this "disassemble_code" as a function. More details on this below
> > - If the section does not contain instructions, just read the bytes and 
> > emit a lines like:
> > ```
> > 0x1000 .byte 0x12
> > 0x1000 .byte 0x34
> > ...
> > ```
> > 
> > Now for the disassemble_code function. We know the address range for this 
> > is in code. We then need to resolve the address passed to 
> > "disassemble_code" into a SBAddress and ask that address for a SBFunction 
> > or SBSymbol as I mentioned. Then we ask the SBFunction or SBSymbol for all 
> > instructions that they contain, and then use any instructions that fall 
> > into the range we have. If there is no SBFunction or SBSymbol, then 
> > disassemble an instruction at a time and then see if the new address will 
> > resolve to a function or symbol.
> Tried my changes on a linux x86 machine and the loop `for (unsigned i = 0; i 
> < max_instruction_size; i++) {` (L2190) takes care of the `start_address` 
> possibly being in the middle of an instruction, so that's not a problem.  The 
> problem I faced is that it tries to read too far from `base_addr` and the 
> `ReadMemory()` operation returns few instructions (without reaching 
> `base_addr`). That was not happening on my macOS M1 (arm) machine. 
> 
> To solve, I changed the loop at L2190 to
> ```
> for (unsigned i = 0; i < bytes_offset; i++) {
> auto sb_instructions =
> _get_instructions_from_memory(start_addr + i, disassemble_bytes);
> ```
> and if `start_addr` is in `sb_instructions` we're done and can exit the loop. 
> That worked.
> 
> Another similar thing that can be done is to start from `start_sbaddr` as you 
> were saying, increment the address until a valid section is found. Then call 
> `_get_instructions_from_memory()` passing the section start.
> What do you think? Delegating the disassembling to `ReadMemory()` + 
> `GetInstructions()` looks simpler to me than to manually iterate over 
> sections and get instructions from symbols and functions.
> Is there any shortcoming I'm not seeing?
so your 
```
for (unsigned i = 0; i < max_instruction_size; i++) { 
```
disassembles and tries to make sure you make it back to the original base 
address from the original disassemble packet? That can work but could a a bit 
time consuming?

The main issue, as you saw on x86, is you don't know what is in memory. You 
could have unreadable areas of memory when trying to disassemble. Also if you 
do have good memory that does contain instructions, there can be padding in 
between functions or even data between functions that the function accesses 
that can't be correctly disassembled and could throw things off again. 

The memory regions are the safest way to traverse memory to see what you have 
and would help you deal with holes in the memory. You can ask about a memory 
region with:
```
lldb::SBError SBProcess::GetMemoryRegionInfo(lldb::addr_t load_addr, 
lldb::SBMemoryRegionInfo ®ion_info);
```
If you ask about an invalid address, like zero on most platforms, it will 
return a valid "region_info" with the bounds of the unreadable address range 
filled in no read/write/execute permissions:
```
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>> region = lldb.SBMemoryRegionInfo()
>>> err = lldb.process.GetMemoryRegionInfo(0, region)
[0x-0x0001 ---]
```
So you could use the memory region info to your advantage here. If you have 
execute permissions, disassemble as instructions, and if you don't emit ".byte 
0xXX" for each byte. If there are no permissions, you can emit some other 
string like "0x: ". 

That being said, even when you do find an executable section of memory, there 
can be different stuff there even if a section _is_ executable. 

[Lldb-commits] [PATCH] D141814: [llvm][ADT] Replace uses of `makeMutableArrayRef` with deduction guides

2023-01-16 Thread Joe Loser via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa288d7f93770: [llvm][ADT] Replace uses of 
`makeMutableArrayRef` with deduction guides (authored by jloser).

Changed prior to commit:
  https://reviews.llvm.org/D141814?vs=489419&id=489635#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141814/new/

https://reviews.llvm.org/D141814

Files:
  bolt/lib/Profile/DataAggregator.cpp
  clang-tools-extra/clangd/FuzzyMatch.cpp
  clang-tools-extra/clangd/SemanticSelection.cpp
  clang-tools-extra/clangd/index/dex/Trigram.cpp
  clang-tools-extra/pseudo/include/clang-pseudo/Forest.h
  clang/include/clang/AST/DeclOpenMP.h
  clang/include/clang/AST/OpenMPClause.h
  clang/include/clang/AST/StmtOpenMP.h
  clang/include/clang/Lex/MacroInfo.h
  clang/lib/AST/StmtOpenMP.cpp
  lld/COFF/Chunks.cpp
  lld/COFF/DebugTypes.cpp
  lld/COFF/Writer.cpp
  lld/ELF/InputFiles.h
  lld/ELF/SyntheticSections.cpp
  lldb/source/Host/common/NativeProcessProtocol.cpp
  llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
  llvm/include/llvm/IR/DataLayout.h
  llvm/include/llvm/IR/Metadata.h
  llvm/include/llvm/ProfileData/InstrProf.h
  llvm/include/llvm/Support/Parallel.h
  llvm/lib/Analysis/ConstantFolding.cpp
  llvm/lib/ExecutionEngine/ExecutionEngine.cpp
  llvm/lib/Support/Path.cpp
  llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
  llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/unittests/Support/Path.cpp
  mlir/lib/Bytecode/Writer/IRNumbering.cpp
  mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp
  mlir/test/mlir-tblgen/constraint-unique.td
  mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

Index: mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
===
--- mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
+++ mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
@@ -2746,7 +2746,7 @@
   ///
   /// {0}: The region's index.
   const char *const getSingleRegion =
-  "::llvm::makeMutableArrayRef((*this)->getRegion({0}))";
+  "::llvm::MutableArrayRef((*this)->getRegion({0}))";
 
   // If we have no regions, there is nothing more to do.
   const auto canSkip = [](const NamedRegion ®ion) {
@@ -2781,7 +2781,7 @@
   /// Get a single successor.
   ///
   /// {0}: The successor's name.
-  const char *const getSingleSuccessor = "::llvm::makeMutableArrayRef({0}())";
+  const char *const getSingleSuccessor = "::llvm::MutableArrayRef({0}())";
 
   // If we have no successors, there is nothing more to do.
   const auto canSkip = [](const NamedSuccessor &successor) {
Index: mlir/test/mlir-tblgen/constraint-unique.td
===
--- mlir/test/mlir-tblgen/constraint-unique.td
+++ mlir/test/mlir-tblgen/constraint-unique.td
@@ -127,10 +127,10 @@
 // CHECK: for (auto [[$RET_VALUE:.*]] : [[$RET_VALUE_GROUP]])
 // CHECK-NEXT:  if (::mlir::failed([[$A_TYPE_CONSTRAINT]](*this, [[$RET_VALUE]].getType(), "result", index++)))
 // CHECK-NEXT:return ::mlir::failure();
-// CHECK: for (auto ®ion : ::llvm::makeMutableArrayRef((*this)->getRegion(0)))
+// CHECK: for (auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0)))
 // CHECK-NEXT:  if (::mlir::failed([[$A_REGION_CONSTRAINT]](*this, region, "d", index++)))
 // CHECK-NEXT:return ::mlir::failure();
-// CHECK: for (auto *successor : ::llvm::makeMutableArrayRef(c()))
+// CHECK: for (auto *successor : ::llvm::MutableArrayRef(c()))
 // CHECK-NEXT:  if (::mlir::failed([[$A_SUCCESSOR_CONSTRAINT]](*this, successor, "c", index++)))
 // CHECK-NEXT:return ::mlir::failure();
 
@@ -148,9 +148,9 @@
 // CHECK: for (auto [[$RET_VALUE:.*]] : [[$RET_VALUE_GROUP]])
 // CHECK-NEXT:  if (::mlir::failed([[$O_TYPE_CONSTRAINT]](*this, [[$RET_VALUE]].getType(), "result", index++)))
 // CHECK-NEXT:return ::mlir::failure();
-// CHECK: for (auto ®ion : ::llvm::makeMutableArrayRef((*this)->getRegion(0)))
+// CHECK: for (auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0)))
 // CHECK-NEXT:  if (::mlir::failed([[$O_REGION_CONSTRAINT]](*this, region, "d", index++)))
 // CHECK-NEXT:return ::mlir::failure();
-// CHECK: for (auto *successor : ::llvm::makeMutableArrayRef(c()))
+// CHECK: for (auto *successor : ::llvm::MutableArrayRef(c()))
 // CHECK-NEXT:  if (::mlir::failed([[$O_SUCCESSOR_CONSTRAINT]](*this, successor, "c", index++)))
 // CHECK-NEXT:return ::mlir::failure();
Index: mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp
===
--- mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp
+++ mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp
@@ -80,8 +80,7 @@
 LLVM_DEBUG(llvm::dbgs() << "  found coalesceable band fr

[Lldb-commits] [PATCH] D141814: [llvm][ADT] Replace uses of `makeMutableArrayRef` with deduction guides

2023-01-16 Thread Joe Loser via Phabricator via lldb-commits
jloser added inline comments.



Comment at: lldb/source/Host/common/NativeProcessProtocol.cpp:652
 
   auto data =
+  llvm::MutableArrayRef(static_cast(buf), bytes_read);

serge-sans-paille wrote:
> random nit: This could be rewritten as
> 
> ```
> llvm::MutableArrayRef data(static_cast(buf), bytes_read);
> ```
> 
> now
Yep, I just changed that before landing this. Thanks for the review!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141814/new/

https://reviews.llvm.org/D141814

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits