[Lldb-commits] [clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-02-08 Thread Ilia Kuklin via lldb-commits

https://github.com/kuilpd updated 
https://github.com/llvm/llvm-project/pull/115005

>From 4d797371598960baf7729d05590aa1a8c7077694 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin 
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 01/13] [lldb] Analyze enum promotion type during parsing

---
 clang/include/clang/AST/Decl.h|  2 +-
 .../SymbolFile/DWARF/DWARFASTParserClang.cpp  | 95 ++-
 .../TypeSystem/Clang/TypeSystemClang.cpp  | 26 +
 3 files changed, 98 insertions(+), 25 deletions(-)

diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 16403774e72b31c..41cb47516f58033 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -3903,6 +3903,7 @@ class EnumDecl : public TagDecl {
   void setInstantiationOfMemberEnum(ASTContext &C, EnumDecl *ED,
 TemplateSpecializationKind TSK);
 
+public:
   /// Sets the width in bits required to store all the
   /// non-negative enumerators of this enum.
   void setNumPositiveBits(unsigned Num) {
@@ -3914,7 +3915,6 @@ class EnumDecl : public TagDecl {
   /// negative enumerators of this enum. (see getNumNegativeBits)
   void setNumNegativeBits(unsigned Num) { EnumDeclBits.NumNegativeBits = Num; }
 
-public:
   /// True if this tag declaration is a scoped enumeration. Only
   /// possible in C++11 mode.
   void setScoped(bool Scoped = true) { EnumDeclBits.IsScoped = Scoped; }
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index e77188bfbd2e4a5..bb9c35a235c1ff4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2316,6 +2316,8 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
 return 0;
 
   size_t enumerators_added = 0;
+  unsigned NumNegativeBits = 0;
+  unsigned NumPositiveBits = 0;
 
   for (DWARFDIE die : parent_die.children()) {
 const dw_tag_t tag = die.Tag();
@@ -2367,11 +2369,102 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
 }
 
 if (name && name[0] && got_value) {
-  m_ast.AddEnumerationValueToEnumerationType(
+  auto ECD = m_ast.AddEnumerationValueToEnumerationType(
   clang_type, decl, name, enum_value, enumerator_byte_size * 8);
   ++enumerators_added;
+
+  llvm::APSInt InitVal = ECD->getInitVal();
+  // Keep track of the size of positive and negative values.
+  if (InitVal.isUnsigned() || InitVal.isNonNegative()) {
+// If the enumerator is zero that should still be counted as a positive
+// bit since we need a bit to store the value zero.
+unsigned ActiveBits = InitVal.getActiveBits();
+NumPositiveBits = std::max({NumPositiveBits, ActiveBits, 1u});
+  } else {
+NumNegativeBits =
+std::max(NumNegativeBits, (unsigned)InitVal.getSignificantBits());
+  }
 }
   }
+
+  /// The following code follows the same logic as in Sema::ActOnEnumBody
+  /// clang/lib/Sema/SemaDecl.cpp
+  // If we have an empty set of enumerators we still need one bit.
+  // From [dcl.enum]p8
+  // If the enumerator-list is empty, the values of the enumeration are as if
+  // the enumeration had a single enumerator with value 0
+  if (!NumPositiveBits && !NumNegativeBits)
+NumPositiveBits = 1;
+
+  clang::QualType qual_type(ClangUtil::GetQualType(clang_type));
+  clang::EnumDecl *enum_decl = qual_type->getAs()->getDecl();
+  enum_decl->setNumPositiveBits(NumPositiveBits);
+  enum_decl->setNumNegativeBits(NumNegativeBits);
+
+  // C++0x N3000 [conv.prom]p3:
+  //   An rvalue of an unscoped enumeration type whose underlying
+  //   type is not fixed can be converted to an rvalue of the first
+  //   of the following types that can represent all the values of
+  //   the enumeration: int, unsigned int, long int, unsigned long
+  //   int, long long int, or unsigned long long int.
+  // C99 6.4.4.3p2:
+  //   An identifier declared as an enumeration constant has type int.
+  // The C99 rule is modified by C23.
+  clang::QualType BestPromotionType;
+  unsigned BestWidth;
+
+  auto &Context = m_ast.getASTContext();
+  unsigned LongWidth = Context.getTargetInfo().getLongWidth();
+  unsigned IntWidth = Context.getTargetInfo().getIntWidth();
+  unsigned CharWidth = Context.getTargetInfo().getCharWidth();
+  unsigned ShortWidth = Context.getTargetInfo().getShortWidth();
+
+  bool is_cpp = Language::LanguageIsCPlusPlus(
+  SymbolFileDWARF::GetLanguage(*parent_die.GetCU()));
+
+  if (NumNegativeBits) {
+// If there is a negative value, figure out the smallest integer type (of
+// int/long/longlong) that fits.
+if (NumNegativeBits <= CharWidth && NumPositiveBits < CharWidth) {
+  BestWidth = CharWidth;
+} else if (NumNegativeBits <= ShortWidth && NumPositiveBits < ShortWidth) {
+  BestWidth = ShortWidth;
+} else if (NumNegativeBits <= IntWid

[Lldb-commits] [clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-02-08 Thread Ilia Kuklin via lldb-commits

kuilpd wrote:

@Michael137 
Changed the first argument of `computeEnumBits` to an `ArrayRef` to avoid the 
template and so it can be still seamlessly used from Sema.
On LLDB side, I had to create a `SmallVector` and put enum constants there at 
the point of their creation (`AddEnumerationValueToEnumerationType` returns a 
pointer anyway) so that it can be passed to `computeEnumBits` as is. It's only 
a vector of pointers, and it's discarded after, so if it's not a problem here, 
I'll make the same changes in the Sema PR.

https://github.com/llvm/llvm-project/pull/115005
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [flang] [lldb] [llvm] [mlir] [polly] Add static to command line option (cl::opt) (PR #126243)

2025-02-08 Thread Rahul Joshi via lldb-commits

jurahul wrote:

Even if a variable is defined in the main file, it could conflict with
another one in a library being linked.

In any case, my understanding is that this is a common C++ practice,
thought I do not see it spelled out explicitly in the coding standards doc:
file scoped global variables that are not intended to be referenced outside
be marked static (or be in an anonymous namespace, but LLVM’s coding
standards disallow that). It not solving any problem, its just code cleanup.

On Sat, Feb 8, 2025 at 4:10 AM Mehdi Amini ***@***.***> wrote:

> The linked bug seems to explain it, I think?
>
> I don't actually see a description of what is the problem to solve really.
>
> It seems to be the usual "if something isn't/doesn't need to be declared
> in a header, then it should be file-local static, so as to not conflict
> with other local names in other files"?
>
> All of the files are main() file, not library files. Not clear to me what
> they would conflict with?
>
> Right, though I think @joker-eph  comment
> is that for lot of the MLIR changes, these option variables are function
> local and they need not be changed to static. This issue is only applicable
> to file scoped variables.
>
> That too :)
>
> —
> Reply to this email directly, view it on GitHub
> ,
> or unsubscribe
> 
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>


https://github.com/llvm/llvm-project/pull/126243
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Upstream a few remaining Triple::XROS patches (PR #126335)

2025-02-08 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere approved this pull request.


https://github.com/llvm/llvm-project/pull/126335
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement a statusline in LLDB (PR #121860)

2025-02-08 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere updated 
https://github.com/llvm/llvm-project/pull/121860

>From 19f5185ac5b19a656e0109d8aa011c49b36c5934 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Fri, 17 Jan 2025 17:10:36 -0800
Subject: [PATCH 1/3] [lldb] Implement a statusline in LLDB
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add a statusline to command-line LLDB to display progress events and
other information related to the current state of the debugger. The
statusline is a dedicated area displayed the bottom of the screen. The
contents of the status line are configurable through a setting
consisting of LLDB’s format strings.

The statusline is configurable through the `statusline-format` setting.
The default configuration shows the target name, the current file, the
stop reason and the current progress event.

```
(lldb) settings show statusline-format
statusline-format (format-string) = 
"${ansi.bg.cyan}${ansi.fg.black}{${target.file.basename}}{ | 
${line.file.basename}:${line.number}:${line.column}}{ | ${thread.stop-reason}}{ 
| {${progress.count} }${progress.message}}"
```

The statusline is enabled by default, but can be disabled with the
following setting:

```
(lldb) settings set show-statusline false
```

The statusline supersedes the current progress reporting implementation.
Consequently, the following settings no longer have any effect (but
continue to exist):

```
show-progress -- Whether to show progress or not if the debugger's 
output is an interactive color-enabled terminal.
show-progress-ansi-prefix -- When displaying progress in a color-enabled 
terminal, use the ANSI terminal code specified in this format immediately 
before the progress message.
show-progress-ansi-suffix -- When displaying progress in a color-enabled 
terminal, use the ANSI terminal code specified in this format immediately after 
the progress message.
```

RFC: https://discourse.llvm.org/t/rfc-lldb-statusline/83948
---
 lldb/include/lldb/Core/Debugger.h |  23 ++-
 lldb/include/lldb/Core/FormatEntity.h |   4 +-
 lldb/include/lldb/Core/Statusline.h   |  60 +++
 .../Python/lldbsuite/test/lldbtest.py |   2 +
 lldb/source/Core/CMakeLists.txt   |   1 +
 lldb/source/Core/CoreProperties.td|   8 +
 lldb/source/Core/Debugger.cpp | 157 +
 lldb/source/Core/FormatEntity.cpp |  44 -
 lldb/source/Core/Statusline.cpp   | 160 ++
 .../TestTrimmedProgressReporting.py   |  51 --
 .../API/functionalities/statusline/Makefile   |   3 +
 .../statusline/TestStatusline.py  |  38 +
 .../API/functionalities/statusline/main.c |  11 ++
 13 files changed, 427 insertions(+), 135 deletions(-)
 create mode 100644 lldb/include/lldb/Core/Statusline.h
 create mode 100644 lldb/source/Core/Statusline.cpp
 delete mode 100644 
lldb/test/API/functionalities/progress_reporting/TestTrimmedProgressReporting.py
 create mode 100644 lldb/test/API/functionalities/statusline/Makefile
 create mode 100644 lldb/test/API/functionalities/statusline/TestStatusline.py
 create mode 100644 lldb/test/API/functionalities/statusline/main.c

diff --git a/lldb/include/lldb/Core/Debugger.h 
b/lldb/include/lldb/Core/Debugger.h
index 70f4c4216221c6..716e0e830371d0 100644
--- a/lldb/include/lldb/Core/Debugger.h
+++ b/lldb/include/lldb/Core/Debugger.h
@@ -19,6 +19,7 @@
 #include "lldb/Core/FormatEntity.h"
 #include "lldb/Core/IOHandler.h"
 #include "lldb/Core/SourceManager.h"
+#include "lldb/Core/Statusline.h"
 #include "lldb/Core/UserSettingsController.h"
 #include "lldb/Host/HostThread.h"
 #include "lldb/Host/StreamFile.h"
@@ -308,6 +309,10 @@ class Debugger : public 
std::enable_shared_from_this,
 
   bool SetShowProgress(bool show_progress);
 
+  bool GetShowStatusline() const;
+
+  const FormatEntity::Entry *GetStatuslineFormat() const;
+
   llvm::StringRef GetShowProgressAnsiPrefix() const;
 
   llvm::StringRef GetShowProgressAnsiSuffix() const;
@@ -604,6 +609,14 @@ class Debugger : public 
std::enable_shared_from_this,
 return m_source_file_cache;
   }
 
+  struct ProgressReport {
+uint64_t id;
+uint64_t completed;
+uint64_t total;
+std::string message;
+  };
+  std::optional GetCurrentProgressReport() const;
+
 protected:
   friend class CommandInterpreter;
   friend class REPL;
@@ -653,6 +666,8 @@ class Debugger : public 
std::enable_shared_from_this,
 
   void PrintProgress(const ProgressEventData &data);
 
+  bool StatuslineSupported();
+
   void PushIOHandler(const lldb::IOHandlerSP &reader_sp,
  bool cancel_top_handler = true);
 
@@ -728,7 +743,7 @@ class Debugger : public 
std::enable_shared_from_this,
   IOHandlerStack m_io_handler_stack;
   std::recursive_mutex m_io_handler_synchronous_mutex;
 
-  std::optional m_current_event_id;
+  std::optional m_statusline;
 
   llvm::StringMap> m_stream_handlers;

[Lldb-commits] [clang] [libc] [libcxx] [lldb] [llvm] [doc] Add Discord invite link alongside channel links (PR #126352)

2025-02-08 Thread Philip Reames via lldb-commits


@@ -149,7 +149,7 @@ Open Clang Projects
 If you hit a bug with Clang, it is very useful for us if you reduce the code
 that demonstrates the problem down to something small. There are many ways to
 do this; ask on https://discourse.llvm.org/c/clang";>Discourse,
-https://discord.com/channels/636084430946959380/636725486533345280";>Discord
+https://discord.gg/xS7Z362";>Discord

preames wrote:

Can you keep the channel link for this one, and add the invite?  

https://github.com/llvm/llvm-project/pull/126352
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libc] [libcxx] [lldb] [llvm] [doc] Add Discord invite link alongside channel links (PR #126352)

2025-02-08 Thread Philip Reames via lldb-commits

https://github.com/preames edited 
https://github.com/llvm/llvm-project/pull/126352
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libc] [libcxx] [lldb] [llvm] [doc] Add Discord invite link alongside channel links (PR #126352)

2025-02-08 Thread Philip Reames via lldb-commits

https://github.com/preames approved this pull request.

LGTM w/requested change.

Another option would be to expand a section on joining discord somewhere, and 
then scatter links to that in the docs instead of the invite link itself. 

https://github.com/llvm/llvm-project/pull/126352
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Store the command in the CommandReturnObject (PR #125132)

2025-02-08 Thread Michael Buch via lldb-commits

Michael137 wrote:

Btw, there are now two tests in the LLDB test-suite called 
`TestSBCommandReturnObject.py`:
```
./lldb/test/API/api/command-return-object/TestSBCommandReturnObject.py
./lldb/test/API/python_api/commandreturnobject/TestSBCommandReturnObject.py
```
which `lldb-dotest` complains about:
```
  File "/home/llvm-project/lldb/packages/Python/lldbsuite/test/dotest.py", line 
704, in visit
raise Exception("Found multiple tests with the name %s" % name)
Exception: Found multiple tests with the name TestSBCommandReturnObject.py
```

Could you rename one of them please?

https://github.com/llvm/llvm-project/pull/125132
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 0cdb467 - [lldb][TypeSystemClang] Create EnumExtensibilityAttr from DW_AT_APPLE_enum_kind (#126221)

2025-02-08 Thread via lldb-commits

Author: Michael Buch
Date: 2025-02-08T11:39:11Z
New Revision: 0cdb467c7da731bb83abc75480cbf66ad64aa014

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

LOG: [lldb][TypeSystemClang] Create EnumExtensibilityAttr from 
DW_AT_APPLE_enum_kind (#126221)

This patch consumes the `DW_AT_APPLE_enum_kind` attribute added in
https://github.com/llvm/llvm-project/pull/124752 and turns it into a
Clang attribute in the AST. This will currently be used by the Swift
language plugin when it creates `EnumDecl`s from debug-info and passes
it to Swift compiler, which expects these attributes

Added: 
lldb/test/Shell/Expr/TestEnumExtensibility.m

Modified: 
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h

Removed: 




diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 39296ba5b437fe6..ec0004c70c6dac6 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -492,6 +492,10 @@ ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(const 
DWARFDIE &die) {
 case DW_AT_reference:
   ref_qual = clang::RQ_LValue;
   break;
+case DW_AT_APPLE_enum_kind:
+  enum_kind = static_cast(
+  form_value.Unsigned());
+  break;
 }
   }
 }
@@ -1001,9 +1005,10 @@ TypeSP DWARFASTParserClang::ParseEnum(const 
SymbolContext &sc,
   }
 
   CompilerType clang_type = m_ast.CreateEnumerationType(
-  attrs.name.GetStringRef(), GetClangDeclContextContainingDIE(def_die, 
nullptr),
+  attrs.name.GetStringRef(),
+  GetClangDeclContextContainingDIE(def_die, nullptr),
   GetOwningClangModule(def_die), attrs.decl, enumerator_clang_type,
-  attrs.is_scoped_enum);
+  attrs.is_scoped_enum, attrs.enum_kind);
   TypeSP type_sp =
   dwarf->MakeType(def_die.GetID(), attrs.name, attrs.byte_size, nullptr,
   attrs.type.Reference().GetID(), Type::eEncodingIsUID,

diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
index 36fb381d3e291db..135dd06186c4bf4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
@@ -568,6 +568,10 @@ struct ParsedDWARFTypeAttributes {
   ///< Indicates ref-qualifier of C++ member function if present.
   ///< Is RQ_None otherwise.
   clang::RefQualifierKind ref_qual = clang::RQ_None;
+
+  ///< Has a value if this DIE represents an enum that was declared
+  ///< with enum_extensibility.
+  std::optional enum_kind;
 };
 
 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFASTPARSERCLANG_H

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index ecb571b1161bbc6..4901b6029d9ce08 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -2303,7 +2303,8 @@ CompilerType 
TypeSystemClang::GetOrCreateStructForIdentifier(
 CompilerType TypeSystemClang::CreateEnumerationType(
 llvm::StringRef name, clang::DeclContext *decl_ctx,
 OptionalClangModuleID owning_module, const Declaration &decl,
-const CompilerType &integer_clang_type, bool is_scoped) {
+const CompilerType &integer_clang_type, bool is_scoped,
+std::optional enum_kind) {
   // TODO: Do something intelligent with the Declaration object passed in
   // like maybe filling in the SourceLocation with it...
   ASTContext &ast = getASTContext();
@@ -2321,6 +2322,10 @@ CompilerType TypeSystemClang::CreateEnumerationType(
   if (decl_ctx)
 decl_ctx->addDecl(enum_decl);
 
+  if (enum_kind)
+enum_decl->addAttr(
+clang::EnumExtensibilityAttr::CreateImplicit(ast, *enum_kind));
+
   // TODO: check if we should be setting the promotion type too?
   enum_decl->setIntegerType(ClangUtil::GetQualType(integer_clang_type));
 

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
index e70ad4c2973a5cf..99d9becffd128c3 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
@@ -22,6 +22,7 @@
 
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTFwd.h"
+#include "clang/AST/Attr.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/TemplateBase.h"
 #include "clang/AST/Type.h"
@@ -498,12 +499,12 @@ class TypeSystemClang : public TypeSystem {

[Lldb-commits] [lldb] [lldb][TypeSystemClang] Create EnumExtensibilityAttr from DW_AT_APPLE_enum_kind (PR #126221)

2025-02-08 Thread Michael Buch via lldb-commits

https://github.com/Michael137 closed 
https://github.com/llvm/llvm-project/pull/126221
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [flang] [lldb] [llvm] [mlir] [polly] Add static to command line option (cl::opt) (PR #126243)

2025-02-08 Thread Mehdi Amini via lldb-commits

joker-eph wrote:

> The linked bug seems to explain it, I think? 

I don't actually see a description of what is the problem to solve really.

> It seems to be the usual "if something isn't/doesn't need to be declared in a 
> header, then it should be file-local static, so as to not conflict with other 
> local names in other files"?

All of the files are `main()`  file, not library files. Not clear to me what 
they would conflict with?

> Right, though I think @joker-eph comment is that for lot of the MLIR changes, 
> these option variables are function local and they need not be changed to 
> static. This issue is only applicable to file scoped variables.

That too :)



https://github.com/llvm/llvm-project/pull/126243
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Add DIL code for handling plain variable names. (PR #120971)

2025-02-08 Thread via lldb-commits

cmtice wrote:

This is ready to be reviewed now; please take another look. :-)

https://github.com/llvm/llvm-project/pull/120971
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] fec6d16 - [lldb] Upstream a few remaining Triple::XROS patches (#126335)

2025-02-08 Thread via lldb-commits

Author: Jason Molenda
Date: 2025-02-08T15:50:52-08:00
New Revision: fec6d168bbdf5116d2f7aaa52f0f429916af4f2d

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

LOG: [lldb] Upstream a few remaining Triple::XROS patches (#126335)

Recognize the visionOS Triple::OSType::XROS os type. Some of these have
already been landed on main, but I reviewed the downstream sources and
there were a few that still needed to be landed upstream.

Added: 


Modified: 
lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
lldb/tools/debugserver/source/RNBRemote.cpp

Removed: 




diff  --git a/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp 
b/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
index 54028b1b3261a7c..83b01b14aedc5e3 100644
--- a/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
@@ -79,6 +79,7 @@ ABISysV_x86_64::CreateInstance(lldb::ProcessSP process_sp, 
const ArchSpec &arch)
 case llvm::Triple::OSType::IOS:
 case llvm::Triple::OSType::TvOS:
 case llvm::Triple::OSType::WatchOS:
+case llvm::Triple::OSType::XROS:
   switch (os_env) {
   case llvm::Triple::EnvironmentType::MacABI:
   case llvm::Triple::EnvironmentType::Simulator:

diff  --git 
a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp 
b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index d512d6143639cd7..14d05a1a4494cfe 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -419,6 +419,8 @@ bool DynamicLoaderDarwin::JSONImageInformationIntoImageInfo(
 image_infos[i].os_type = llvm::Triple::WatchOS;
   else if (os_name == "bridgeos")
 image_infos[i].os_type = llvm::Triple::BridgeOS;
+  else if (os_name == "xros")
+image_infos[i].os_type = llvm::Triple::XROS;
   else if (os_name == "maccatalyst") {
 image_infos[i].os_type = llvm::Triple::IOS;
 image_infos[i].os_env = llvm::Triple::MacABI;
@@ -431,6 +433,9 @@ bool DynamicLoaderDarwin::JSONImageInformationIntoImageInfo(
   } else if (os_name == "watchossimulator") {
 image_infos[i].os_type = llvm::Triple::WatchOS;
 image_infos[i].os_env = llvm::Triple::Simulator;
+  } else if (os_name == "xrsimulator") {
+image_infos[i].os_type = llvm::Triple::XROS;
+image_infos[i].os_env = llvm::Triple::Simulator;
   }
 }
 if (image->HasKey("min_version_os_sdk")) {
@@ -765,7 +770,8 @@ bool DynamicLoaderDarwin::AddModulesUsingPreloadedModules(
   (dyld_triple.getEnvironment() == llvm::Triple::Simulator &&
(dyld_triple.getOS() == llvm::Triple::IOS ||
 dyld_triple.getOS() == llvm::Triple::TvOS ||
-dyld_triple.getOS() == llvm::Triple::WatchOS)))
+dyld_triple.getOS() == llvm::Triple::WatchOS ||
+dyld_triple.getOS() == llvm::Triple::XROS)))
 image_module_sp->MergeArchitecture(dyld_spec);
 }
   }
@@ -835,7 +841,7 @@ lldb_private::ArchSpec 
DynamicLoaderDarwin::ImageInfo::GetArchitecture() const {
   }
   if (os_env == llvm::Triple::Simulator &&
   (os_type == llvm::Triple::IOS || os_type == llvm::Triple::TvOS ||
-   os_type == llvm::Triple::WatchOS)) {
+   os_type == llvm::Triple::WatchOS || os_type == llvm::Triple::XROS)) {
 llvm::Triple triple(llvm::Twine(arch_spec.GetArchitectureName()) +
 "-apple-" + llvm::Triple::getOSTypeName(os_type) +
 min_version_os_sdk + "-simulator");

diff  --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp 
b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index bf2d293d2012ca4..4b69fa6e2bfb292 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -2848,7 +2848,7 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
   "DSC unmapped local symbol[{0}] has invalid "
   "string table offset {1:x} in {2}, ignoring symbol",
   nlist_index, nlist.n_strx,
-  module_sp->GetFileSpec().GetPath());
+  module_sp->GetFileSpec().GetPath()));
   continue;
 }
 if (symbol_name[0] == '\0')
@@ -6557,9 +6557,8 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP 
&pro

[Lldb-commits] [lldb] [lldb] Upstream a few remaining Triple::XROS patches (PR #126335)

2025-02-08 Thread Jason Molenda via lldb-commits

https://github.com/jasonmolenda closed 
https://github.com/llvm/llvm-project/pull/126335
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits