[jenkins-infra/jenkins.io] 55cd26: typo

2024-05-24 Thread 'Hervé Le Meur' via Jenkins Commits
  Branch: refs/heads/lemeurherve-patch-1
  Home:   https://github.com/jenkins-infra/jenkins.io
  Commit: 55cd26be636016de37de0e639f8620591335589d
  
https://github.com/jenkins-infra/jenkins.io/commit/55cd26be636016de37de0e639f8620591335589d
  Author: Hervé Le Meur <91831478+lemeurhe...@users.noreply.github.com>
  Date:   2024-05-24 (Fri, 24 May 2024)

  Changed paths:
M content/doc/book/pipeline/development.adoc

  Log Message:
  ---
  typo



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkins-infra/jenkins.io/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkins-infra/jenkins.io/push/refs/heads/lemeurherve-patch-1/3c6ce5-55cd26%40github.com.


[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)

2024-05-24 Thread Aaron Ballman via cfe-commits
.substr(PercentSelectBraceLen, Iter - FullDiagText.begin() 
-
+   PercentSelectBraceLen);
 SmallVector SelectPieces;
 SelectText.split(SelectPieces, '|');
 
@@ -1355,7 +1357,7 @@ static void verifyDiagnosticWording(const Record ) {
   if (isDigit(FullDiagText.back()) && *(FullDiagText.end() - 2) == '}') {
 // Scan backwards to find the opening curly brace.
 size_t BraceCount = 1;
-auto Iter = FullDiagText.end() - /*}0*/ 3;
+auto Iter = FullDiagText.end() - sizeof("}0");
 for (auto End = FullDiagText.begin(); Iter != End; --Iter) {
   char Ch = *Iter;
   if (Ch == '}')
@@ -1371,9 +1373,10 @@ static void verifyDiagnosticWording(const Record ) {
 
 // Continue the backwards scan to find the word before the '{' to see if it
 // is 'select'.
+constexpr size_t SelectLen = sizeof("select") - 1;
 bool IsSelect =
-(FullDiagText.substr(Iter - /*select*/ 6 - FullDiagText.begin(),
- /*select*/ 6) == "select");
+(FullDiagText.substr(Iter - SelectLen - FullDiagText.begin(),
+ SelectLen) == "select");
 if (IsSelect) {
   // Gather the content between the {} for the select in question so we can
   // split it into pieces.

>From 8e7ab56ce75fc44c3c992328228762bf41addf87 Mon Sep 17 00:00:00 2001
From: Aaron Ballman 
Date: Fri, 24 May 2024 06:54:02 -0400
Subject: [PATCH 3/3] Gracefully handle empty text at the start

This handles cases like '%select{|okay}0 Now' where we're checking for
improper capitalization at the start but have an empty string to check.
---
 clang/utils/TableGen/ClangDiagnosticsEmitter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp 
b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
index 166c8b11746a7..247e44fdc3291 100644
--- a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
+++ b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
@@ -1216,7 +1216,7 @@ static bool isRemark(const Record ) {
 // Presumes the text has been split at the first whitespace or hyphen.
 static bool isExemptAtStart(StringRef Text) {
   // Fast path, the first character is lowercase or not alphanumeric.
-  if (isLower(Text[0]) || !isAlnum(Text[0]))
+  if (Text.empty() || isLower(Text[0]) || !isAlnum(Text[0]))
 return true;
 
   // If the text is all uppercase (or numbers, +, or _), then we assume it's an

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


[clang] [SPIR-V] Prefer llvm-spirv- tool (PR #77897)

2024-05-24 Thread Sven van Haastregt via cfe-commits
Henry =?utf-8?q?Linjamäki?= 
Message-ID:
In-Reply-To: 


svenvh wrote:

> Thanks for the review. Could you merge this PR on my behalf (I don't have 
> write access)?

Yes I am happy to do so, but would you mind rebasing this PR onto latest `main` 
first?  Just so that the checks can run again to avoid any potential new 
regressions since the checks ran last.

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


[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)

2024-05-24 Thread Aaron Ballman via cfe-commits
.substr(PercentSelectBraceLen, Iter - FullDiagText.begin() 
-
+   PercentSelectBraceLen);
 SmallVector SelectPieces;
 SelectText.split(SelectPieces, '|');
 
@@ -1355,7 +1357,7 @@ static void verifyDiagnosticWording(const Record ) {
   if (isDigit(FullDiagText.back()) && *(FullDiagText.end() - 2) == '}') {
 // Scan backwards to find the opening curly brace.
 size_t BraceCount = 1;
-auto Iter = FullDiagText.end() - /*}0*/ 3;
+auto Iter = FullDiagText.end() - sizeof("}0");
 for (auto End = FullDiagText.begin(); Iter != End; --Iter) {
   char Ch = *Iter;
   if (Ch == '}')
@@ -1371,9 +1373,10 @@ static void verifyDiagnosticWording(const Record ) {
 
 // Continue the backwards scan to find the word before the '{' to see if it
 // is 'select'.
+constexpr size_t SelectLen = sizeof("select") - 1;
 bool IsSelect =
-(FullDiagText.substr(Iter - /*select*/ 6 - FullDiagText.begin(),
- /*select*/ 6) == "select");
+(FullDiagText.substr(Iter - SelectLen - FullDiagText.begin(),
+ SelectLen) == "select");
 if (IsSelect) {
   // Gather the content between the {} for the select in question so we can
   // split it into pieces.

>From 8e7ab56ce75fc44c3c992328228762bf41addf87 Mon Sep 17 00:00:00 2001
From: Aaron Ballman 
Date: Fri, 24 May 2024 06:54:02 -0400
Subject: [PATCH 3/3] Gracefully handle empty text at the start

This handles cases like '%select{|okay}0 Now' where we're checking for
improper capitalization at the start but have an empty string to check.
---
 clang/utils/TableGen/ClangDiagnosticsEmitter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp 
b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
index 166c8b11746a7..247e44fdc3291 100644
--- a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
+++ b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
@@ -1216,7 +1216,7 @@ static bool isRemark(const Record ) {
 // Presumes the text has been split at the first whitespace or hyphen.
 static bool isExemptAtStart(StringRef Text) {
   // Fast path, the first character is lowercase or not alphanumeric.
-  if (isLower(Text[0]) || !isAlnum(Text[0]))
+  if (Text.empty() || isLower(Text[0]) || !isAlnum(Text[0]))
 return true;
 
   // If the text is all uppercase (or numbers, +, or _), then we assume it's an

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


[clang] [clang-format] Don't always break before << between string literals (PR #92214)

2024-05-24 Thread via cfe-commits


@@ -10539,6 +10539,17 @@ TEST_F(FormatTest, KeepStringLabelValuePairsOnALine) {
   "  bbb);");
 }
 
+TEST_F(FormatTest, WrapBeforeInsertionOperatorbetweenStringLiterals) {
+  verifyFormat("QStringList() << \"foo\" << \"bar\";");

Alexolut wrote:

Will `verifyNoChange` here be better suitable?

https://github.com/llvm/llvm-project/pull/92214
___________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[jenkinsci/additional-identities-plugin]

2024-05-24 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/heads/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x
  Home:   https://github.com/jenkinsci/additional-identities-plugin

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/additional-identities-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/additional-identities-plugin/push/refs/heads/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x/757049-00%40github.com.


[jenkinsci/additional-identities-plugin] 43e186: Update dependency io.jenkins.tools.bom:bom-2.426.x...

2024-05-24 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/heads/main
  Home:   https://github.com/jenkinsci/additional-identities-plugin
  Commit: 43e18698d39e6023d4eb51d755875b6a6ca632ec
  
https://github.com/jenkinsci/additional-identities-plugin/commit/43e18698d39e6023d4eb51d755875b6a6ca632ec
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2024-05-24 (Fri, 24 May 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Update dependency io.jenkins.tools.bom:bom-2.426.x to v3080



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/additional-identities-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/additional-identities-plugin/push/refs/heads/main/94b9e7-43e186%40github.com.


[jenkinsci/additional-identities-plugin]

2024-05-24 Thread 'renovate[bot]' via Jenkins Commits
  Branch: 
refs/renovate/branches/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x
  Home:   https://github.com/jenkinsci/additional-identities-plugin

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/additional-identities-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/additional-identities-plugin/push/refs/renovate/branches/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x/eb2d6d-00%40github.com.


[jenkinsci/additional-identities-plugin] 757049: Update dependency io.jenkins.tools.bom:bom-2.426.x...

2024-05-24 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/heads/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x
  Home:   https://github.com/jenkinsci/additional-identities-plugin
  Commit: 7570494847e557738584145a4fc2fab6d82303a8
  
https://github.com/jenkinsci/additional-identities-plugin/commit/7570494847e557738584145a4fc2fab6d82303a8
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2024-05-24 (Fri, 24 May 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Update dependency io.jenkins.tools.bom:bom-2.426.x to v3080



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/additional-identities-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/additional-identities-plugin/push/refs/heads/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x/00-757049%40github.com.


[jenkinsci/additional-identities-plugin] eb2d6d: Update dependency io.jenkins.tools.bom:bom-2.426.x...

2024-05-24 Thread 'renovate[bot]' via Jenkins Commits
  Branch: 
refs/renovate/branches/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x
  Home:   https://github.com/jenkinsci/additional-identities-plugin
  Commit: eb2d6ddf667fb151b39be02caac7a47b60a0e0b2
  
https://github.com/jenkinsci/additional-identities-plugin/commit/eb2d6ddf667fb151b39be02caac7a47b60a0e0b2
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2024-05-24 (Fri, 24 May 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Update dependency io.jenkins.tools.bom:bom-2.426.x to v3080



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/additional-identities-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/additional-identities-plugin/push/refs/renovate/branches/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x/00-eb2d6d%40github.com.


[clang] [SPIR-V] Prefer llvm-spirv- tool (PR #77897)

2024-05-24 Thread Henry Linjamäki via cfe-commits

linehill wrote:

Thanks for the review. Could you merge this PR on my behalf (I don't have write 
access)?

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


[Lldb-commits] [lldb] [lldb/DWARF] Refactor DWARFDIE::Get{Decl, TypeLookup}Context (PR #93291)

2024-05-24 Thread via lldb-commits
 const {
   llvm::SmallSet seen;
-  return GetDeclContextImpl(seen, *this);
+  std::vector context;
+  GetDeclContextImpl(*this, seen, context);
+  std::reverse(context.begin(), context.end());
+  return context;
 }
 
-std::vector
-DWARFDIE::GetTypeLookupContext() const {
-  std::vector context;
-  // If there is no name, then there is no need to look anything up for this
-  // DIE.
-  const char *name = GetName();
-  if (!name || !name[0])
-return context;
-  const dw_tag_t tag = Tag();
-  if (tag == DW_TAG_compile_unit || tag == DW_TAG_partial_unit)
-return context;
-  DWARFDIE parent = GetParent();
-  if (parent)
-context = parent.GetTypeLookupContext();
-  auto push_ctx = [&](CompilerContextKind kind, llvm::StringRef name) {
-context.push_back({kind, ConstString(name)});
-  };
-  switch (tag) {
-  case DW_TAG_namespace:
-push_ctx(CompilerContextKind::Namespace, name);
-break;
-  case DW_TAG_structure_type:
-push_ctx(CompilerContextKind::Struct, name);
-break;
-  case DW_TAG_union_type:
-push_ctx(CompilerContextKind::Union, name);
-break;
-  case DW_TAG_class_type:
-push_ctx(CompilerContextKind::Class, name);
-break;
-  case DW_TAG_enumeration_type:
-push_ctx(CompilerContextKind::Enum, name);
-break;
-  case DW_TAG_variable:
-push_ctx(CompilerContextKind::Variable, GetPubname());
-break;
-  case DW_TAG_typedef:
-push_ctx(CompilerContextKind::Typedef, name);
-break;
-  case DW_TAG_base_type:
-push_ctx(CompilerContextKind::Builtin, name);
-break;
-  default:
-break;
+static void GetTypeLookupContextImpl(DWARFDIE die,
+ llvm::SmallSet ,
+ std::vector ) {
+  // Stop if we hit a cycle.
+  while (die && seen.insert(die.GetID()).second) {
+// If there is no name, then there is no need to look anything up for this
+// DIE.
+const char *name = die.GetName();
+if (!name || !name[0])
+  return;
+
+// Add this DIE's contribution at the end of the chain.
+auto push_ctx = [&](CompilerContextKind kind, llvm::StringRef name) {
+  context.push_back({kind, ConstString(name)});
+};
+switch (die.Tag()) {
+case DW_TAG_namespace:
+  push_ctx(CompilerContextKind::Namespace, die.GetName());
+  break;
+case DW_TAG_structure_type:
+  push_ctx(CompilerContextKind::Struct, die.GetName());
+  break;
+case DW_TAG_union_type:
+  push_ctx(CompilerContextKind::Union, die.GetName());
+  break;
+case DW_TAG_class_type:
+  push_ctx(CompilerContextKind::Class, die.GetName());
+  break;
+case DW_TAG_enumeration_type:
+  push_ctx(CompilerContextKind::Enum, die.GetName());
+  break;
+case DW_TAG_variable:
+  push_ctx(CompilerContextKind::Variable, die.GetPubname());
+  break;
+case DW_TAG_typedef:
+  push_ctx(CompilerContextKind::Typedef, die.GetName());
+  break;
+case DW_TAG_base_type:
+  push_ctx(CompilerContextKind::Builtin, name);
+  break;
+default:
+  break;
+}
+// Now process the parent.
+die = die.GetParent();
   }
+}
+
+std::vector DWARFDIE::GetTypeLookupContext() const {
+  llvm::SmallSet seen;
+  std::vector context;
+  GetTypeLookupContextImpl(*this, seen, context);
+  std::reverse(context.begin(), context.end());
   return context;
 }
 

``




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


[Lldb-commits] [lldb] [lldb/DWARF] Refactor DWARFDIE::Get{Decl, TypeLookup}Context (PR #93291)

2024-05-24 Thread Pavel Labath via lldb-commits
   push_ctx(CompilerContextKind::Struct, die.GetName());
+  break;
+case DW_TAG_union_type:
+  push_ctx(CompilerContextKind::Union, die.GetName());
+  break;
+case DW_TAG_class_type:
+  push_ctx(CompilerContextKind::Class, die.GetName());
+  break;
+case DW_TAG_enumeration_type:
+  push_ctx(CompilerContextKind::Enum, die.GetName());
+  break;
+case DW_TAG_subprogram:
+  push_ctx(CompilerContextKind::Function, die.GetName());
+  break;
+case DW_TAG_variable:
+  push_ctx(CompilerContextKind::Variable, die.GetPubname());
+  break;
+case DW_TAG_typedef:
+  push_ctx(CompilerContextKind::Typedef, die.GetName());
+  break;
+default:
+  break;
+}
+// Now process the parent.
+die = die.GetParent();
   }
-  return context;
 }
 
-std::vector DWARFDIE::GetDeclContext() const {
+std::vector DWARFDIE::GetDeclContext() const {
   llvm::SmallSet seen;
-  return GetDeclContextImpl(seen, *this);
+  std::vector context;
+  GetDeclContextImpl(*this, seen, context);
+  std::reverse(context.begin(), context.end());
+  return context;
 }
 
-std::vector
-DWARFDIE::GetTypeLookupContext() const {
-  std::vector context;
-  // If there is no name, then there is no need to look anything up for this
-  // DIE.
-  const char *name = GetName();
-  if (!name || !name[0])
-return context;
-  const dw_tag_t tag = Tag();
-  if (tag == DW_TAG_compile_unit || tag == DW_TAG_partial_unit)
-return context;
-  DWARFDIE parent = GetParent();
-  if (parent)
-context = parent.GetTypeLookupContext();
-  auto push_ctx = [&](CompilerContextKind kind, llvm::StringRef name) {
-context.push_back({kind, ConstString(name)});
-  };
-  switch (tag) {
-  case DW_TAG_namespace:
-push_ctx(CompilerContextKind::Namespace, name);
-break;
-  case DW_TAG_structure_type:
-push_ctx(CompilerContextKind::Struct, name);
-break;
-  case DW_TAG_union_type:
-push_ctx(CompilerContextKind::Union, name);
-break;
-  case DW_TAG_class_type:
-push_ctx(CompilerContextKind::Class, name);
-break;
-  case DW_TAG_enumeration_type:
-push_ctx(CompilerContextKind::Enum, name);
-break;
-  case DW_TAG_variable:
-push_ctx(CompilerContextKind::Variable, GetPubname());
-break;
-  case DW_TAG_typedef:
-push_ctx(CompilerContextKind::Typedef, name);
-break;
-  case DW_TAG_base_type:
-push_ctx(CompilerContextKind::Builtin, name);
-break;
-  default:
-break;
+static void GetTypeLookupContextImpl(DWARFDIE die,
+ llvm::SmallSet ,
+ std::vector ) {
+  // Stop if we hit a cycle.
+  while (die && seen.insert(die.GetID()).second) {
+// If there is no name, then there is no need to look anything up for this
+// DIE.
+const char *name = die.GetName();
+if (!name || !name[0])
+  return;
+
+// Add this DIE's contribution at the end of the chain.
+auto push_ctx = [&](CompilerContextKind kind, llvm::StringRef name) {
+  context.push_back({kind, ConstString(name)});
+};
+switch (die.Tag()) {
+case DW_TAG_namespace:
+  push_ctx(CompilerContextKind::Namespace, die.GetName());
+  break;
+case DW_TAG_structure_type:
+  push_ctx(CompilerContextKind::Struct, die.GetName());
+  break;
+case DW_TAG_union_type:
+  push_ctx(CompilerContextKind::Union, die.GetName());
+  break;
+case DW_TAG_class_type:
+  push_ctx(CompilerContextKind::Class, die.GetName());
+  break;
+case DW_TAG_enumeration_type:
+  push_ctx(CompilerContextKind::Enum, die.GetName());
+  break;
+case DW_TAG_variable:
+  push_ctx(CompilerContextKind::Variable, die.GetPubname());
+  break;
+case DW_TAG_typedef:
+  push_ctx(CompilerContextKind::Typedef, die.GetName());
+  break;
+case DW_TAG_base_type:
+  push_ctx(CompilerContextKind::Builtin, name);
+  break;
+default:
+  break;
+}
+// Now process the parent.
+die = die.GetParent();
   }
+}
+
+std::vector DWARFDIE::GetTypeLookupContext() const {
+  llvm::SmallSet seen;
+  std::vector context;
+  GetTypeLookupContextImpl(*this, seen, context);
+  std::reverse(context.begin(), context.end());
   return context;
 }
 

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


[clang] [serialization] no transitive decl change (PR #92083)

2024-05-24 Thread Jan Svoboda via cfe-commits


@@ -255,6 +255,12 @@ class DeclOffset {
   }
 };
 
+// The unaligned decl ID used in the Blobs of bistreams.
+using unalighed_decl_id_t =

jansvoboda11 wrote:

I know this typo isn't introduced by your PR, but since your PR is touching it, 
please fix it in a prep commit.
```suggestion
using unaligned_decl_id_t =
```

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


[clang] [serialization] no transitive decl change (PR #92083)

2024-05-24 Thread Jan Svoboda via cfe-commits


@@ -124,6 +130,15 @@ class DeclIDBase {
 
   bool isInvalid() const { return ID == PREDEF_DECL_NULL_ID; }
 
+  unsigned getModuleFileIndex() const { return ID >> 32; }
+
+  unsigned getLocalDeclIndex() const {
+// Implement it directly instead of calling `llvm::maskTrailingOnes` since
+// we don't want `MathExtras.h` to be inclued here.

jansvoboda11 wrote:

Why not? Just to keep the amount of code lower? Can't we move the function body 
to an implementation file?

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


[llvm-branch-commits] [mlir] 2790b4d - Revert "[mlir] Fix race condition introduced in ThreadLocalCache (#93280)"

2024-05-24 Thread via llvm-branch-commits
 /// Owning pointers to all of the values that have been constructed for 
this
 /// object in the static cache.
-SmallVector instances;
+SmallVector, 1> instances;
 
 /// A mutex used when a new thread instance has been added to the cache for
 /// this object.
@@ -108,14 +57,14 @@ class ThreadLocalCache {
   /// instance of the non-static cache and a weak reference to an instance of
   /// ValueT. We use a weak reference here so that the object can be destroyed
   /// without needing to lock access to the cache itself.
-  struct CacheType : public llvm::SmallDenseMap {
+  struct CacheType
+  : public llvm::SmallDenseMap, ValueT *>> 
{
 ~CacheType() {
-  // Remove the values of this cache that haven't already expired. This is
-  // required because if we don't remove them, they will contain a 
reference
-  // back to the data here that is being destroyed.
-  for (auto &[instance, observer] : *this)
-if (std::shared_ptr state = 
observer.keepalive.lock())
-  state->remove(*observer.ptr);
+  // Remove the values of this cache that haven't already expired.
+  for (auto  : *this)
+if (std::shared_ptr value = it.second.first.lock())
+  it.first->remove(value.get());
 }
 
 /// Clear out any unused entries within the map. This method is not
@@ -123,7 +72,7 @@ class ThreadLocalCache {
 void clearExpiredEntries() {
   for (auto it = this->begin(), e = this->end(); it != e;) {
 auto curIt = it++;
-if (!*curIt->second.ptr)
+if (curIt->second.first.expired())
   this->erase(curIt);
   }
 }
@@ -140,23 +89,27 @@ class ThreadLocalCache {
   ValueT () {
 // Check for an already existing instance for this thread.
 CacheType  = getStaticCache();
-Observer  = staticCache[perInstanceState.get()];
-if (ValueT *value = *threadInstance.ptr)
+std::pair, ValueT *>  =
+staticCache[perInstanceState.get()];
+if (ValueT *value = threadInstance.second)
   return *value;
 
 // Otherwise, create a new instance for this thread.
 {
   llvm::sys::SmartScopedLock threadInstanceLock(
   perInstanceState->instanceMutex);
-  perInstanceState->instances.emplace_back(threadInstance);
+  threadInstance.second =
+  perInstanceState->instances.emplace_back(std::make_unique())
+  .get();
 }
-threadInstance.keepalive = perInstanceState;
+threadInstance.first =
+std::shared_ptr(perInstanceState, threadInstance.second);
 
 // Before returning the new instance, take the chance to clear out any used
 // entries in the static map. The cache is only cleared within the same
 // thread to remove the need to lock the cache itself.
 staticCache.clearExpiredEntries();
-return **threadInstance.ptr;
+return *threadInstance.second;
   }
   ValueT *() { return get(); }
   ValueT *operator->() { return (); }



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


[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

2024-05-24 Thread Sebastian Wolf via cfe-commits
ed a callExpr here to match CXXOperatorCallExpr ``()->operator[](0)``
+  // and CXXMemberCallExpr ``a[0]``.
   Finder->addMatcher(
-  callExpr(callee(cxxMethodDecl(hasName("operator[]")).bind("f")))
-  .bind("x"),
+  callExpr(
+  callee(
+  cxxMethodDecl(hasOverloadedOperatorName("[]")).bind("operator")),
+  callee(cxxMethodDecl(hasParent(
+  cxxRecordDecl(hasMethod(hasName("at"))).bind("parent")
+  .bind("caller"),
   this);
 }
 
 void AvoidBoundsErrorsCheck::check(const MatchFinder::MatchResult ) {
   const ASTContext  = *Result.Context;
   const SourceManager  = Context.getSourceManager();
-  const CallExpr *MatchedExpr = Result.Nodes.getNodeAs("x");
-  const CXXMethodDecl *MatchedFunction = 
Result.Nodes.getNodeAs("f");
-  const QualType Type = MatchedFunction->getThisType();
-  if (!isApplicable(Type)) {
-return;
-  }
+  const CallExpr *MatchedExpr = Result.Nodes.getNodeAs("caller");
+  const CXXMethodDecl *MatchedOperator =
+  Result.Nodes.getNodeAs("operator");
+  const CXXRecordDecl *MatchedParent =
+  Result.Nodes.getNodeAs("parent");
 
-  // Get original code.
-  const SourceLocation b(MatchedExpr->getBeginLoc());
-  const SourceLocation e(MatchedExpr->getEndLoc());
-  const std::string OriginalCode =
-  Lexer::getSourceText(CharSourceRange::getTokenRange(b, e), Source,
-   getLangOpts())
-  .str();
-  const auto Range = SourceRange(b, e);
+  const CXXMethodDecl *Alternative =
+  findAlternative(MatchedParent, MatchedOperator);
+  if (!Alternative)
+return;
 
-  // Build replacement.
-  std::string NewCode = OriginalCode;
-  const auto BeginOpen = NewCode.find("[");
-  NewCode.replace(BeginOpen, 1, ".at(");
-  const auto BeginClose = NewCode.find("]");
-  NewCode.replace(BeginClose, 1, ")");
+  const SourceLocation AlternativeSource(Alternative->getBeginLoc());
 
-  diag(MatchedExpr->getBeginLoc(), "Do not use operator[], use at() instead.")
-  << FixItHint::CreateReplacement(Range, NewCode);
+  diag(MatchedExpr->getBeginLoc(),
+   "found possibly unsafe operator[], consider using at() instead");
+  diag(Alternative->getBeginLoc(), "alternative at() defined here",
+   DiagnosticIDs::Note);
 }
 
 } // namespace clang::tidy::cppcoreguidelines
diff --git 
a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/avoid-bounds-errors.cpp
 
b/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/avoid-bounds-errors.cpp
index 23453b1f2df21..5e12e7d71790d 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/avoid-bounds-errors.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/avoid-bounds-errors.cpp
@@ -38,23 +38,22 @@ namespace json {
 std::array a;
 
 auto b = a[0];
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: Do not use operator[], use at() 
instead. [cppcoreguidelines-avoid-bounds-errors]
-// CHECK-FIXES: auto b = a.at(0);
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: found possibly unsafe operator[], 
consider using at() instead [cppcoreguidelines-avoid-bounds-errors]
 auto c = a[1+1];
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: Do not use operator[], use at() 
instead. [cppcoreguidelines-avoid-bounds-errors]
-// CHECK-FIXES: auto c = a.at(1+1);
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: found possibly unsafe operator[], 
consider using at() instead [cppcoreguidelines-avoid-bounds-errors]
 constexpr int index = 1;
 auto d = a[index];
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: Do not use operator[], use at() 
instead. [cppcoreguidelines-avoid-bounds-errors]
-// CHECK-FIXES: auto d = a.at(index);
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: found possibly unsafe operator[], 
consider using at() instead [cppcoreguidelines-avoid-bounds-errors]
 
 int e(int index) {
   return a[index];
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: Do not use operator[], use at() 
instead. [cppcoreguidelines-avoid-bounds-errors]
-// CHECK-FIXES: return a.at(index);
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: found possibly unsafe operator[], 
consider using at() instead [cppcoreguidelines-avoid-bounds-errors]
 }
 
-auto f = a.at(0);
+auto f = ()->operator[](1);
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: found possibly unsafe operator[], 
consider using at() instead [cppcoreguidelines-avoid-bounds-errors]
+
+auto g = a.at(0);
 
 std::unique_ptr p;
 auto q = p[0];

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


[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
ix=21 %s
 // 21: "-fpatchable-function-entry=2" "-fpatchable-function-entry-offset=1"
 
-// RUN: not %clang -target powerpc64-ibm-aix-xcoff -fsyntax-only %s 
-fpatchable-function-entry=1 2>&1 | FileCheck --check-prefix=AIX64 %s
+// RUN: not %clang --target=powerpc64-ibm-aix-xcoff -fsyntax-only %s 
-fpatchable-function-entry=1 2>&1 | FileCheck --check-prefix=AIX64 %s
 // AIX64: error: unsupported option '-fpatchable-function-entry=1' for target 
'powerpc64-ibm-aix-xcoff'
 
-// RUN: not %clang -target powerpc-ibm-aix-xcoff -fsyntax-only %s 
-fpatchable-function-entry=1 2>&1 | FileCheck --check-prefix=AIX32 %s
+// RUN: not %clang --target=powerpc-ibm-aix-xcoff -fsyntax-only %s 
-fpatchable-function-entry=1 2>&1 | FileCheck --check-prefix=AIX32 %s
 // AIX32: error: unsupported option '-fpatchable-function-entry=1' for target 
'powerpc-ibm-aix-xcoff'
 
 // RUN: not %clang --target=x86_64 -fsyntax-only %s 
-fpatchable-function-entry=1,0, 2>&1 | FileCheck --check-prefix=EXCESS %s
diff --git a/clang/test/Sema/patchable-function-entry-attr-aix.cpp 
b/clang/test/Sema/patchable-function-entry-attr-aix.cpp
deleted file mode 100644
index 648ad739b1df7..0
--- a/clang/test/Sema/patchable-function-entry-attr-aix.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -fsyntax-only -verify %s
-
-// expected-error@+1 {{'patchable_function_entry' attribute is not yet 
supported on AIX}}
-__attribute__((patchable_function_entry(0))) void f();
diff --git a/clang/test/Sema/patchable-function-entry-attr.cpp 
b/clang/test/Sema/patchable-function-entry-attr.cpp
index c08293dfe6672..bd4d57a7e3093 100644
--- a/clang/test/Sema/patchable-function-entry-attr.cpp
+++ b/clang/test/Sema/patchable-function-entry-attr.cpp
@@ -9,8 +9,11 @@
 // RUN: %clang_cc1 -triple powerpc-unknown-linux-gnu -fsyntax-only 
-verify=silence %s
 // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -fsyntax-only 
-verify=silence %s
 // RUN: %clang_cc1 -triple ppc64le -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -fsyntax-only -verify=AIX %s
+// RUN: %clang_cc1 -triple powerpc-ibm-aix-xcoff -fsyntax-only -verify=AIX %s
 
 // silence-no-diagnostics
 
+// AIX-error@+2 {{'patchable_function_entry' attribute is not yet supported on 
AIX}}
 // expected-warning@+1 {{unknown attribute 'patchable_function_entry' ignored}}
 [[gnu::patchable_function_entry(0)]] void f();
diff --git a/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll 
b/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll
index 088b616eb77fc..0c2d2829a6d4b 100644
--- a/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll
+++ b/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll
@@ -1,5 +1,7 @@
-; RUN: llc -mtriple=powerpc-unknown-linux-gnu %s -o - | FileCheck %s 
--check-prefixes=CHECK,PPC32
-; RUN: llc -mtriple=powerpc64-unknown-linux-gnu %s -o - | FileCheck %s 
--check-prefixes=CHECK,PPC64
+; RUN: llc -mtriple=powerpc %s -o - | FileCheck %s --check-prefixes=CHECK,PPC32
+; RUN: llc -mtriple=powerpc64 %s -o - | FileCheck %s 
--check-prefixes=CHECK,PPC64
+
+@a = global i32 0, align 4
 
 define void @f0() {
 ; CHECK-LABEL: f0:
@@ -33,17 +35,24 @@ define void @f2() "patchable-function-entry"="1" {
   ret void
 }
 
-define void @f3() "patchable-function-entry"="1" 
"patchable-function-prefix"="2" {
+define i32 @f3() "patchable-function-entry"="1" 
"patchable-function-prefix"="2" {
 ; CHECK-LABEL: .Ltmp0:
 ; CHECK-COUNT-2: nop
 ; CHECK-LABEL: f3:
 ; CHECK:   # %bb.0:
 ; CHECK-NEXT:nop
-; CHECK-NEXT:blr
+; PPC32: lis 3, a@ha
+; PPC32-NEXT:lwz 3, a@l(3)
+; PPC64: addis 3, 2, .LC0@toc@ha
+; PPC64-NEXT:ld 3, .LC0@toc@l(3)
+; PPC64-NEXT:lwz 3, 0(3)
+; CHECK: blr
 ; CHECK:   .section__patchable_function_entries
 ; PPC32:   .p2align2, 0x0
 ; PPC64:   .p2align3, 0x0
 ; PPC32-NEXT:  .long   .Ltmp0
 ; PPC64-NEXT:  .quad   .Ltmp0
-  ret void
+entry:
+  %0 = load i32, ptr @a, align 4
+  ret i32 %0
 }

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


[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits


@@ -0,0 +1,49 @@
+; RUN: llc -mtriple=powerpc-unknown-linux-gnu %s -o - | FileCheck %s 
--check-prefixes=CHECK,PPC32
+; RUN: llc -mtriple=powerpc64-unknown-linux-gnu %s -o - | FileCheck %s 
--check-prefixes=CHECK,PPC64
+
+define void @f0() {
+; CHECK-LABEL: f0:
+; CHECK-NOT:   nop
+; CHECK:   # %bb.0:
+; CHECK-NEXT:blr
+; CHECK-NOT:   .section__patchable_function_entries
+  ret void
+}
+
+define void @f1() "patchable-function-entry"="0" {
+; CHECK-LABEL: f1:
+; CHECK-NOT:   nop
+; CHECK:   # %bb.0:
+; CHECK-NEXT:blr
+; CHECK-NOT:   .section__patchable_function_entries
+  ret void
+}
+
+define void @f2() "patchable-function-entry"="1" {
+; CHECK-LABEL: f2:
+; CHECK-LABEL-NEXT:  .Lfunc_begin2:
+; CHECK:   # %bb.0:
+; CHECK-NEXT:nop
+; CHECK-NEXT:blr
+; CHECK:   .section__patchable_function_entries
+; PPC32:   .p2align2, 0x0
+; PPC64:   .p2align3, 0x0
+; PPC32-NEXT:  .long   .Lfunc_begin2
+; PPC64-NEXT:  .quad   .Lfunc_begin2
+  ret void
+}
+
+define void @f3() "patchable-function-entry"="1" 
"patchable-function-prefix"="2" {
+; CHECK-LABEL: .Ltmp0:
+; CHECK-COUNT-2: nop
+; CHECK-LABEL: f3:

chenzheng1030 wrote:

Updated.

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


[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits


@@ -6,15 +6,20 @@
 // RUN: %clang -target loongarch64 %s -fpatchable-function-entry=1,0 -c -### 
2>&1 | FileCheck %s
 // RUN: %clang -target riscv32 %s -fpatchable-function-entry=1,0 -c -### 2>&1 
| FileCheck %s
 // RUN: %clang -target riscv64 %s -fpatchable-function-entry=1,0 -c -### 2>&1 
| FileCheck %s
+// RUN: %clang -target powerpc-unknown-linux-gnu %s 
-fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s

chenzheng1030 wrote:

Thank you. Updated.

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


[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits


@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -fsyntax-only -verify %s
+
+// expected-error@+1 {{'patchable_function_entry' attribute is not yet 
supported on AIX}}
+__attribute__((patchable_function_entry(0))) void f();

chenzheng1030 wrote:

Updated, moved the file to the existing one.

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


[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits

https://github.com/chenzheng1030 edited 
https://github.com/llvm/llvm-project/pull/92997
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits


@@ -6681,7 +6681,9 @@ void Clang::ConstructJob(Compilation , const JobAction 
,
 StringRef S0 = A->getValue(), S = S0;
 unsigned Size, Offset = 0;
 if (!Triple.isAArch64() && !Triple.isLoongArch() && !Triple.isRISCV() &&
-!Triple.isX86())
+!Triple.isX86() &&
+!(!Triple.isOSAIX() && (Triple.getArch() == llvm::Triple::ppc ||

chenzheng1030 wrote:

Linux little endian targets are this patch's scope. This patch tries to support 
-fpatchable-function-entry for big endian targets but not AIX.

If we are going to support little endian, we first need to check the 
possibility about removal of XRAY. (XRAY also uses backend node 
`PATCHABLE_FUNCTION_ENTER`)

https://github.com/llvm/llvm-project/pull/92997
___________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits


@@ -0,0 +1,49 @@
+; RUN: llc -mtriple=powerpc-unknown-linux-gnu %s -o - | FileCheck %s 
--check-prefixes=CHECK,PPC32

chenzheng1030 wrote:

Thank you, changed the triple. Little endian is not going to be supported in 
this patch.

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


[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits

https://github.com/chenzheng1030 commented:

> So PPC64 can use ELFv2 for Triple::OpenBSD. We probably want to diagnose this 
> OS for PPC64, since with ELFv2 we might emit separate local and global entry 
> points which means only certain values can be passed to 
> -fpatchable-function-entry option.

For targets with ABI elfv2 which means there are dual entries, this patch can 
generate expected patchable entry:
For -mtriple=powerpc64-unknown-freebsd-unknown
```
.Ltmp0:
nop
nop
f3: # @f3
.Lfunc_begin0:
.cfi_startproc
.Lfunc_gep0:
addis 2, 12, .TOC.-.Lfunc_gep0@ha
addi 2, 2, .TOC.-.Lfunc_gep0@l
.Lfunc_lep0:
.localentry f3, .Lfunc_lep0-.Lfunc_gep0
# %bb.0:# %entry
nop
```

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


[jenkinsci/scoring-load-balancer-plugin] 259ba0: Update dependency io.jenkins.tools.bom:bom-2.426.x...

2024-05-24 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/heads/main
  Home:   https://github.com/jenkinsci/scoring-load-balancer-plugin
  Commit: 259ba0d7a0a5dc3759dfee16643fb65e28a2a7cb
  
https://github.com/jenkinsci/scoring-load-balancer-plugin/commit/259ba0d7a0a5dc3759dfee16643fb65e28a2a7cb
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2024-05-24 (Fri, 24 May 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Update dependency io.jenkins.tools.bom:bom-2.426.x to v3080



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/scoring-load-balancer-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/scoring-load-balancer-plugin/push/refs/heads/main/3a9b29-259ba0%40github.com.


[jenkinsci/scoring-load-balancer-plugin]

2024-05-24 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/heads/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x
  Home:   https://github.com/jenkinsci/scoring-load-balancer-plugin

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/scoring-load-balancer-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/scoring-load-balancer-plugin/push/refs/heads/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x/192cbe-00%40github.com.


[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Andrey Ali Khan Bolshakov via cfe-commits


@@ -1265,13 +1238,62 @@ class TemplateDiff {
 IsNullPtr = true;
 return;
   case TemplateArgument::Expression:
-// TODO: Sometimes, the desugared template argument Expr differs from
-// the sugared template argument Expr.  It may be useful in the future
-// but for now, it is just discarded.
-if (!E)
-  E = TA.getAsExpr();
-return;
+E = Iter->getAsExpr();
+break;
+  case TemplateArgument::Null:
+  case TemplateArgument::Type:
+  case TemplateArgument::Template:
+  case TemplateArgument::TemplateExpansion:
+llvm_unreachable("TemplateArgument kind is not expected for NTTP");
+  case TemplateArgument::Pack:
+llvm_unreachable("TemplateArgument kind handled elsewhere");

bolshakov-a wrote:

Nit: "... _should be_ handled ..."?

https://github.com/llvm/llvm-project/pull/93265
___________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Andrey Ali Khan Bolshakov via cfe-commits

https://github.com/bolshakov-a approved this pull request.

One question about the version of the C++ standard under testing, otherwise 
LGTM, thanks!

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


[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Andrey Ali Khan Bolshakov via cfe-commits

https://github.com/bolshakov-a edited 
https://github.com/llvm/llvm-project/pull/93265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Andrey Ali Khan Bolshakov via cfe-commits




bolshakov-a wrote:

I don't see any C++26-specific stuff here, only C++20.

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


[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
s -fpatchable-function-entry=1,0 -c -### 2>&1 
| FileCheck %s
 // RUN: %clang -target riscv64 %s -fpatchable-function-entry=1,0 -c -### 2>&1 
| FileCheck %s
-// RUN: %clang -target powerpc-unknown-linux-gnu %s 
-fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s
-// RUN: %clang -target powerpc64-unknown-linux-gnu %s 
-fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s
+// RUN: %clang --target=powerpc-unknown-linux-gnu %s 
-fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s
+// RUN: %clang --target=powerpc64-unknown-linux-gnu %s 
-fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s
 // CHECK: "-fpatchable-function-entry=1"
 
 // RUN: %clang -target aarch64 -fsyntax-only %s -fpatchable-function-entry=1,1 
-c -### 2>&1 | FileCheck --check-prefix=11 %s
@@ -15,10 +15,10 @@
 // RUN: %clang -target aarch64 -fsyntax-only %s -fpatchable-function-entry=2,1 
-c -### 2>&1 | FileCheck --check-prefix=21 %s
 // 21: "-fpatchable-function-entry=2" "-fpatchable-function-entry-offset=1"
 
-// RUN: not %clang -target powerpc64-ibm-aix-xcoff -fsyntax-only %s 
-fpatchable-function-entry=1 2>&1 | FileCheck --check-prefix=AIX64 %s
+// RUN: not %clang --target=powerpc64-ibm-aix-xcoff -fsyntax-only %s 
-fpatchable-function-entry=1 2>&1 | FileCheck --check-prefix=AIX64 %s
 // AIX64: error: unsupported option '-fpatchable-function-entry=1' for target 
'powerpc64-ibm-aix-xcoff'
 
-// RUN: not %clang -target powerpc-ibm-aix-xcoff -fsyntax-only %s 
-fpatchable-function-entry=1 2>&1 | FileCheck --check-prefix=AIX32 %s
+// RUN: not %clang --target=powerpc-ibm-aix-xcoff -fsyntax-only %s 
-fpatchable-function-entry=1 2>&1 | FileCheck --check-prefix=AIX32 %s
 // AIX32: error: unsupported option '-fpatchable-function-entry=1' for target 
'powerpc-ibm-aix-xcoff'
 
 // RUN: not %clang -target x86_64 -fsyntax-only %s 
-fpatchable-function-entry=1,0, 2>&1 | FileCheck --check-prefix=EXCESS %s
diff --git a/clang/test/Sema/patchable-function-entry-attr-aix.cpp 
b/clang/test/Sema/patchable-function-entry-attr-aix.cpp
deleted file mode 100644
index 648ad739b1df7..0
--- a/clang/test/Sema/patchable-function-entry-attr-aix.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -fsyntax-only -verify %s
-
-// expected-error@+1 {{'patchable_function_entry' attribute is not yet 
supported on AIX}}
-__attribute__((patchable_function_entry(0))) void f();
diff --git a/clang/test/Sema/patchable-function-entry-attr.cpp 
b/clang/test/Sema/patchable-function-entry-attr.cpp
index c08293dfe6672..bd4d57a7e3093 100644
--- a/clang/test/Sema/patchable-function-entry-attr.cpp
+++ b/clang/test/Sema/patchable-function-entry-attr.cpp
@@ -9,8 +9,11 @@
 // RUN: %clang_cc1 -triple powerpc-unknown-linux-gnu -fsyntax-only 
-verify=silence %s
 // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -fsyntax-only 
-verify=silence %s
 // RUN: %clang_cc1 -triple ppc64le -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -fsyntax-only -verify=AIX %s
+// RUN: %clang_cc1 -triple powerpc-ibm-aix-xcoff -fsyntax-only -verify=AIX %s
 
 // silence-no-diagnostics
 
+// AIX-error@+2 {{'patchable_function_entry' attribute is not yet supported on 
AIX}}
 // expected-warning@+1 {{unknown attribute 'patchable_function_entry' ignored}}
 [[gnu::patchable_function_entry(0)]] void f();
diff --git a/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll 
b/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll
index 088b616eb77fc..0c2d2829a6d4b 100644
--- a/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll
+++ b/llvm/test/CodeGen/PowerPC/patchable-function-entry.ll
@@ -1,5 +1,7 @@
-; RUN: llc -mtriple=powerpc-unknown-linux-gnu %s -o - | FileCheck %s 
--check-prefixes=CHECK,PPC32
-; RUN: llc -mtriple=powerpc64-unknown-linux-gnu %s -o - | FileCheck %s 
--check-prefixes=CHECK,PPC64
+; RUN: llc -mtriple=powerpc %s -o - | FileCheck %s --check-prefixes=CHECK,PPC32
+; RUN: llc -mtriple=powerpc64 %s -o - | FileCheck %s 
--check-prefixes=CHECK,PPC64
+
+@a = global i32 0, align 4
 
 define void @f0() {
 ; CHECK-LABEL: f0:
@@ -33,17 +35,24 @@ define void @f2() "patchable-function-entry"="1" {
   ret void
 }
 
-define void @f3() "patchable-function-entry"="1" 
"patchable-function-prefix"="2" {
+define i32 @f3() "patchable-function-entry"="1" 
"patchable-function-prefix"="2" {
 ; CHECK-LABEL: .Ltmp0:
 ; CHECK-COUNT-2: nop
 ; CHECK-LABEL: f3:
 ; CHECK:   # %bb.0:
 ; CHECK-NEXT:nop
-; CHECK-NEXT:blr
+; PPC32: lis 3, a@ha
+; PPC32-NEXT:lwz 3, a@l(3)
+; PPC64: addis 3, 2, .LC0@toc@ha
+; PPC64-NEXT:ld 3, .LC0@toc@l(3)
+; PPC64-NEXT:lwz 3, 0(3)
+; CHECK: blr
 ; CHECK:   .section__patchable_function_entries
 ; PPC32:   .p2align2, 0x0
 ; PPC64:   .p2align3, 0x0
 ; PPC32-NEXT:  .long   .Ltmp0
 ; PPC64-NEXT:  .quad   .Ltmp0
-  ret void
+entry:
+  %0 = load i32, ptr @a, align 4
+  ret i32 %0
 }

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


[jenkinsci/scoring-load-balancer-plugin]

2024-05-24 Thread 'renovate[bot]' via Jenkins Commits
  Branch: 
refs/renovate/branches/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x
  Home:   https://github.com/jenkinsci/scoring-load-balancer-plugin

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/scoring-load-balancer-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/scoring-load-balancer-plugin/push/refs/renovate/branches/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x/3623fe-00%40github.com.


[jenkinsci/scoring-load-balancer-plugin] 192cbe: Update dependency io.jenkins.tools.bom:bom-2.426.x...

2024-05-24 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/heads/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x
  Home:   https://github.com/jenkinsci/scoring-load-balancer-plugin
  Commit: 192cbe505446d32a342a44168647de7c68d21fbf
  
https://github.com/jenkinsci/scoring-load-balancer-plugin/commit/192cbe505446d32a342a44168647de7c68d21fbf
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2024-05-24 (Fri, 24 May 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Update dependency io.jenkins.tools.bom:bom-2.426.x to v3080



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/scoring-load-balancer-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/scoring-load-balancer-plugin/push/refs/heads/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x/00-192cbe%40github.com.


[jenkinsci/scoring-load-balancer-plugin] 3623fe: Update dependency io.jenkins.tools.bom:bom-2.426.x...

2024-05-24 Thread 'renovate[bot]' via Jenkins Commits
  Branch: 
refs/renovate/branches/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x
  Home:   https://github.com/jenkinsci/scoring-load-balancer-plugin
  Commit: 3623fef04627bf102da1f5b19a1b686597ea528b
  
https://github.com/jenkinsci/scoring-load-balancer-plugin/commit/3623fef04627bf102da1f5b19a1b686597ea528b
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2024-05-24 (Fri, 24 May 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Update dependency io.jenkins.tools.bom:bom-2.426.x to v3080



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/scoring-load-balancer-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/scoring-load-balancer-plugin/push/refs/renovate/branches/renovate/io.jenkins.tools.bom-bom-2.426.x-3080.x/00-3623fe%40github.com.


[clang] [Clang] Only check exprs that might be immediate escalating in evaluated contexts (PR #93187)

2024-05-24 Thread Mariya Podchishchaeva via cfe-commits


@@ -5146,6 +5153,12 @@ class Sema final : public SemaBase {
 return ExprEvalContexts.back();
   };
 
+  const ExpressionEvaluationContextRecord () const {
+assert(ExprEvalContexts.size() >= 2 &&
+   "Must be in an expression evaluation context");
+return ExprEvalContexts[ExprEvalContexts.size() - 2];

Fznamznon wrote:

Submitted https://github.com/llvm/llvm-project/issues/93284

https://github.com/llvm/llvm-project/pull/93187
_______
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas (PR #93206)

2024-05-24 Thread Younan Zhang via cfe-commits
+}
+} // namespace GH91633
+
+namespace GH90669 {
+
+struct __normal_iterator {};
+
+struct vector {
+  __normal_iterator begin(); // #begin
+  int end();
+};
+
+template 
+bool operator==(_IteratorR __lhs, int)
+  requires requires { __lhs; }
+{}
+
+template  void queued_for_each(PrepareFunc prep) {
+  prep(vector{}); //#prep
+}
+
+void scan() {
+  queued_for_each([&](auto ino) -> int { // #queued-for-each
+for (auto e : ino) { // #for-each
+  // expected-error@#for-each {{cannot increment value of type 
'__normal_iterator'}}
+  // expected-note-re@#prep {{instantiation {{.*}} requested here}}
+  // expected-note-re@#queued-for-each {{instantiation {{.*}} requested 
here}}
+  // expected-note@#for-each {{implicit call to 'operator++'}}
+  // expected-note@#begin {{selected 'begin' function}}
+};
+  });
+}
+} // namespace GH90669
+
+namespace GH89496 {
+template  struct RevIter {
+  Iter current;
+  constexpr explicit RevIter(Iter x) : current(x) {}
+  inline constexpr bool operator==(const RevIter ) const
+requires requires {
+  // { current == other.current } -> std::convertible_to;
+  { other };
+}
+  {
+return true;
+  }
+};
+struct Foo {
+  Foo() {};
+};
+void CrashFunc() {
+  auto lambda = [&](auto from, auto to) -> Foo {
+(void)(from == to);
+return Foo();
+  };
+  auto from = RevIter(nullptr);
+  auto to = RevIter(nullptr);
+  lambda(from, to);
+}
+} // namespace pr89496

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


[clang] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas (PR #93206)

2024-05-24 Thread Younan Zhang via cfe-commits

https://github.com/zyn0217 edited 
https://github.com/llvm/llvm-project/pull/93206
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas (PR #93206)

2024-05-24 Thread Younan Zhang via cfe-commits

https://github.com/zyn0217 edited 
https://github.com/llvm/llvm-project/pull/93206
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] MangledSymbol: Added move to Names param in init list (PR #87287)

2024-05-24 Thread Braden Helmer via cfe-commits

https://github.com/bradenhelmer closed 
https://github.com/llvm/llvm-project/pull/87287
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] Clang doc async (PR #93276)

2024-05-24 Thread via cfe-commits
ided.
   std::string Format = getFormatString();
   llvm::outs() << "Emiting docs in " << Format << " format.\n";
@@ -179,7 +183,7 @@ Example usage for a project using a compile commands 
database:
   SourceRoot,
   RepositoryUrl,
   {UserStylesheets.begin(), UserStylesheets.end()},
-  {"index.js", "index_json.js"}};
+  {"index.js"}};
 
   if (Format == "html") {
 void *MainAddr = (void *)(intptr_t)GetExecutablePath;

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


[Lldb-commits] [lldb] [lldb] Fixed the TestDAP_repl_mode_detection test in case of a remote target (PR #93165)

2024-05-24 Thread Dmitry Vasilyev via lldb-commits

slydiman wrote:

Replaced by #93169.

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


[Lldb-commits] [lldb] [lldb] Fixed the TestDAP_repl_mode_detection test in case of a remote target (PR #93165)

2024-05-24 Thread Dmitry Vasilyev via lldb-commits

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


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -1694,6 +1718,35 @@ let Predicates = [HasPAuth] in {
 def BLRABZ  : AuthOneOperand<0b001, 1, "blrabz">;
   }
 
+  // BLRA pseudo, generalized version of BLRAA/BLRAB/Z.
+  // This directly manipulates x16/x17, which are the only registers the OS
+  // guarantees are safe to use for sensitive operations.

kovdan01 wrote:

Yes, having a more detailed comment here would be nice. As for now, from the 
comment it was unclear that this is Darwin-specific. It's also probably worth 
mentioning that it's harmless for non-Darwin, as you said.

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


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -817,10 +817,44 @@ bool AArch64ExpandPseudo::expandCALL_RVMARKER(
   MachineInstr  = *MBBI;
   MachineOperand  = MI.getOperand(0);
   assert(RVTarget.isGlobal() && "invalid operand for attached call");
-  MachineInstr *OriginalCall =
-  createCall(MBB, MBBI, TII, MI.getOperand(1),
- // Regmask starts after the RV and call targets.
- /*RegMaskStartIdx=*/2);
+
+  MachineInstr *OriginalCall = nullptr;
+
+  if (MI.getOpcode() == AArch64::BLRA_RVMARKER) {
+// Pointer auth call.
+MachineOperand  = MI.getOperand(2);
+assert((Key.getImm() == 0 || Key.getImm() == 1) &&
+   "invalid key for ptrauth call");
+MachineOperand  = MI.getOperand(3);

kovdan01 wrote:

```suggestion
const MachineOperand  = MI.getOperand(3);
```

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


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -817,10 +817,44 @@ bool AArch64ExpandPseudo::expandCALL_RVMARKER(
   MachineInstr  = *MBBI;
   MachineOperand  = MI.getOperand(0);
   assert(RVTarget.isGlobal() && "invalid operand for attached call");
-  MachineInstr *OriginalCall =
-  createCall(MBB, MBBI, TII, MI.getOperand(1),
- // Regmask starts after the RV and call targets.
- /*RegMaskStartIdx=*/2);
+
+  MachineInstr *OriginalCall = nullptr;
+
+  if (MI.getOpcode() == AArch64::BLRA_RVMARKER) {
+// Pointer auth call.
+MachineOperand  = MI.getOperand(2);
+assert((Key.getImm() == 0 || Key.getImm() == 1) &&
+   "invalid key for ptrauth call");
+MachineOperand  = MI.getOperand(3);
+MachineOperand  = MI.getOperand(4);
+
+OriginalCall = BuildMI(MBB, MBBI, MI.getDebugLoc(), 
TII->get(AArch64::BLRA))
+   .getInstr();
+OriginalCall->addOperand(MI.getOperand(1));
+OriginalCall->addOperand(Key);
+OriginalCall->addOperand(IntDisc);
+OriginalCall->addOperand(AddrDisc);
+
+unsigned RegMaskStartIdx = 5;
+// Skip register arguments. Those are added during ISel, but are not
+// needed for the concrete branch.
+while (!MI.getOperand(RegMaskStartIdx).isRegMask()) {
+  auto MOP = MI.getOperand(RegMaskStartIdx);

kovdan01 wrote:

Just above `auto` is not used in the same kind of assignments. IMHO things 
should be kept consistent, so either `const auto &` or `const MachineOperand &` 
should be used for all such cases in this context.

https://github.com/llvm/llvm-project/pull/85736
___________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -9206,6 +9222,31 @@ void SelectionDAGBuilder::visitCall(const CallInst ) {
 LowerCallTo(I, Callee, I.isTailCall(), I.isMustTailCall());
 }
 
+void SelectionDAGBuilder::LowerCallSiteWithPtrAuthBundle(
+const CallBase , const BasicBlock *EHPadBB) {
+  auto PAB = CB.getOperandBundle("ptrauth");
+  auto *CalleeV = CB.getCalledOperand();

kovdan01 wrote:

```suggestion
  const auto *CalleeV = CB.getCalledOperand();
```

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


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -9206,6 +9222,31 @@ void SelectionDAGBuilder::visitCall(const CallInst ) {
 LowerCallTo(I, Callee, I.isTailCall(), I.isMustTailCall());
 }
 
+void SelectionDAGBuilder::LowerCallSiteWithPtrAuthBundle(
+const CallBase , const BasicBlock *EHPadBB) {
+  auto PAB = CB.getOperandBundle("ptrauth");
+  auto *CalleeV = CB.getCalledOperand();
+
+  // Gather the call ptrauth data from the operand bundle:
+  //   [ i32 , i64  ]
+  auto *Key = cast(PAB->Inputs[0]);
+  Value *Discriminator = PAB->Inputs[1];

kovdan01 wrote:

```suggestion
  const Value *Discriminator = PAB->Inputs[1];
```

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


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -8640,6 +8642,15 @@ void SelectionDAGBuilder::LowerCallTo(const CallBase 
, SDValue Callee,
   CB.countOperandBundlesOfType(LLVMContext::OB_preallocated) != 0)
   .setCFIType(CFIType)
   .setConvergenceControlToken(ConvControlToken);
+
+  // Set the pointer authentication info if we have it.
+  if (PAI) {
+if (!TLI.supportPtrAuthBundles())
+  report_fatal_error(

kovdan01 wrote:

OK, your point makes sense, let's leave it "as is" if nobody else minds

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


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -817,10 +817,44 @@ bool AArch64ExpandPseudo::expandCALL_RVMARKER(
   MachineInstr  = *MBBI;
   MachineOperand  = MI.getOperand(0);
   assert(RVTarget.isGlobal() && "invalid operand for attached call");
-  MachineInstr *OriginalCall =
-  createCall(MBB, MBBI, TII, MI.getOperand(1),
- // Regmask starts after the RV and call targets.
- /*RegMaskStartIdx=*/2);
+
+  MachineInstr *OriginalCall = nullptr;
+
+  if (MI.getOpcode() == AArch64::BLRA_RVMARKER) {
+// Pointer auth call.
+MachineOperand  = MI.getOperand(2);
+assert((Key.getImm() == 0 || Key.getImm() == 1) &&
+   "invalid key for ptrauth call");
+MachineOperand  = MI.getOperand(3);
+MachineOperand  = MI.getOperand(4);

kovdan01 wrote:

```suggestion
const MachineOperand  = MI.getOperand(4);
```

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


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -2642,6 +2642,20 @@ bool IRTranslator::translateCallBase(const CallBase ,
 }
   }
 
+  std::optional PAI;
+  if (CB.countOperandBundlesOfType(LLVMContext::OB_ptrauth)) {
+// Functions should never be ptrauth-called directly.
+assert(!CB.getCalledFunction() && "invalid direct ptrauth call");
+
+auto PAB = CB.getOperandBundle("ptrauth");
+Value *Key = PAB->Inputs[0];
+Value *Discriminator = PAB->Inputs[1];

kovdan01 wrote:

```suggestion
const Value *Discriminator = PAB->Inputs[1];
```

https://github.com/llvm/llvm-project/pull/85736
_______
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -9206,6 +9222,31 @@ void SelectionDAGBuilder::visitCall(const CallInst ) {
 LowerCallTo(I, Callee, I.isTailCall(), I.isMustTailCall());
 }
 
+void SelectionDAGBuilder::LowerCallSiteWithPtrAuthBundle(
+const CallBase , const BasicBlock *EHPadBB) {
+  auto PAB = CB.getOperandBundle("ptrauth");
+  auto *CalleeV = CB.getCalledOperand();
+
+  // Gather the call ptrauth data from the operand bundle:
+  //   [ i32 , i64  ]
+  auto *Key = cast(PAB->Inputs[0]);

kovdan01 wrote:

```suggestion
  const auto *Key = cast(PAB->Inputs[0]);
```

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


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -2642,6 +2642,20 @@ bool IRTranslator::translateCallBase(const CallBase ,
 }
   }
 
+  std::optional PAI;
+  if (CB.countOperandBundlesOfType(LLVMContext::OB_ptrauth)) {
+// Functions should never be ptrauth-called directly.
+assert(!CB.getCalledFunction() && "invalid direct ptrauth call");
+
+auto PAB = CB.getOperandBundle("ptrauth");
+Value *Key = PAB->Inputs[0];

kovdan01 wrote:

```suggestion
const Value *Key = PAB->Inputs[0];
```

https://github.com/llvm/llvm-project/pull/85736
_______
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits

https://github.com/kovdan01 requested changes to this pull request.

@ahmedbougacha In terms of functionality, LGTM (but I'll prefer other guys also 
looking through the changes). I've left several minor style-related comments.

One more overall style comment which might probably require an additional PR: 
sometimes identifiers use `PtrAuth`, sometimes `Ptrauth`. Is this intentional? 
If not, I suggest to use the same case style - it would keep things consistent 
and allow for case-sensitive search.

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


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -1769,6 +1775,41 @@ void AArch64AsmPrinter::emitPtrauthAuthResign(const 
MachineInstr *MI) {
 OutStreamer->emitLabel(EndSym);
 }
 
+void AArch64AsmPrinter::emitPtrauthBranch(const MachineInstr *MI) {
+  unsigned InstsEmitted = 0;
+

kovdan01 wrote:

This blank line is probably unintentional and does not seem to improve 
readability, so IMHO should be deleted

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


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits


@@ -817,10 +817,44 @@ bool AArch64ExpandPseudo::expandCALL_RVMARKER(
   MachineInstr  = *MBBI;
   MachineOperand  = MI.getOperand(0);
   assert(RVTarget.isGlobal() && "invalid operand for attached call");
-  MachineInstr *OriginalCall =
-  createCall(MBB, MBBI, TII, MI.getOperand(1),
- // Regmask starts after the RV and call targets.
- /*RegMaskStartIdx=*/2);
+
+  MachineInstr *OriginalCall = nullptr;
+
+  if (MI.getOpcode() == AArch64::BLRA_RVMARKER) {
+// Pointer auth call.
+MachineOperand  = MI.getOperand(2);

kovdan01 wrote:

```suggestion
const MachineOperand  = MI.getOperand(2);
```

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


[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-24 Thread Daniil Kovalev via llvm-branch-commits

https://github.com/kovdan01 edited 
https://github.com/llvm/llvm-project/pull/85736
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[clang-tools-extra] clang-doc switched from using relative to absolute paths (PR #93281)

2024-05-24 Thread Florian Hahn via cfe-commits

https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/93281

>From f5872e7c82d097ae3c141765d3f1d7e3d0b25b82 Mon Sep 17 00:00:00 2001
From: PeterChou1 
Date: Fri, 24 May 2024 04:28:08 -0400
Subject: [PATCH 1/2] clang-doc switched from using relative to absolute paths

---
 clang-tools-extra/clang-doc/assets/index.js | 72 ++---
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/clang-tools-extra/clang-doc/assets/index.js 
b/clang-tools-extra/clang-doc/assets/index.js
index a5ac90f2e06e7..fe35e706cc98d 100644
--- a/clang-tools-extra/clang-doc/assets/index.js
+++ b/clang-tools-extra/clang-doc/assets/index.js
@@ -1,48 +1,46 @@
-// Append using posix-style a file name or directory to Base
-function append(Base, New) {
-  if (!New)
-return Base;
-  if (Base)
-Base += "/";
-  Base += New;
-  return Base;
-}
-
-// Get relative path to access FilePath from CurrentDirectory
-function computeRelativePath(FilePath, CurrentDirectory) {
-  var Path = FilePath;
-  while (Path) {
-if (CurrentDirectory == Path)
-  return FilePath.substring(Path.length + 1);
-Path = Path.substring(0, Path.lastIndexOf("/"));
-  }
-
-  var Dir = CurrentDirectory;
-  var Result = "";
-  while (Dir) {
-if (Dir == FilePath)
-  break;
-Dir = Dir.substring(0, Dir.lastIndexOf("/"));
-Result = append(Result, "..")
+function genLink(Ref) {
+  var Path = 
`${window.location.protocol}//${window.location.host}/${Ref.Path}`;
+  if (Ref.RefType !== "namespace") {
+if (Ref.Path === "") {
+  Path = `${Path}${Ref.Name}.html`;
+}
+else {
+  Path = `${Path}/${Ref.Name}.html`;
+}
   }
-  Result = append(Result, FilePath.substring(Dir.length))
-  return Result;
-}
-
-function genLink(Ref, CurrentDirectory) {
-  var Path = computeRelativePath(Ref.Path, CurrentDirectory);
-  if (Ref.RefType == "namespace")
-Path = append(Path, "index.html");
-  else
-Path = append(Path, Ref.Name + ".html")
 
-ANode = document.createElement("a");
+  ANode = document.createElement("a");
   ANode.setAttribute("href", Path);
   var TextNode = document.createTextNode(Ref.Name);
   ANode.appendChild(TextNode);
   return ANode;
 }
 
+function genHTMLOfIndex(Index, CurrentDirectory, IsOutermostList) {
+  // Out will store the HTML elements that Index requires to be generated
+  var Out = [];
+  if (Index.Name) {
+var SpanNode = document.createElement("span");
+var TextNode = document.createTextNode(Index.Name);
+SpanNode.appendChild(genLink(Index));
+Out.push(SpanNode);
+  }
+  if (Index.Children.length == 0)
+return Out;
+  // Only the outermost list should use ol, the others should use ul
+  var ListNodeName = IsOutermostList ? "ol" : "ul";
+  var ListNode = document.createElement(ListNodeName);
+  for (Child of Index.Children) {
+var LiNode = document.createElement("li");
+ChildNodes = genHTMLOfIndex(Child, CurrentDirectory, false);
+for (Node of ChildNodes)
+  LiNode.appendChild(Node);
+ListNode.appendChild(LiNode);
+  }
+  Out.push(ListNode);
+  return Out;
+}
+
 function genHTMLOfIndex(Index, CurrentDirectory, IsOutermostList) {
   // Out will store the HTML elements that Index requires to be generated
   var Out = [];

>From a22609f75064194604e476a12bc8154676dacfb9 Mon Sep 17 00:00:00 2001
From: PeterChou1 
Date: Fri, 24 May 2024 05:10:03 -0400
Subject: [PATCH 2/2] remove duplicate function

---
 clang-tools-extra/clang-doc/assets/index.js | 24 -
 1 file changed, 24 deletions(-)

diff --git a/clang-tools-extra/clang-doc/assets/index.js 
b/clang-tools-extra/clang-doc/assets/index.js
index fe35e706cc98d..b013418c82093 100644
--- a/clang-tools-extra/clang-doc/assets/index.js
+++ b/clang-tools-extra/clang-doc/assets/index.js
@@ -16,30 +16,6 @@ function genLink(Ref) {
   return ANode;
 }
 
-function genHTMLOfIndex(Index, CurrentDirectory, IsOutermostList) {
-  // Out will store the HTML elements that Index requires to be generated
-  var Out = [];
-  if (Index.Name) {
-var SpanNode = document.createElement("span");
-var TextNode = document.createTextNode(Index.Name);
-SpanNode.appendChild(genLink(Index));
-Out.push(SpanNode);
-  }
-  if (Index.Children.length == 0)
-return Out;
-  // Only the outermost list should use ol, the others should use ul
-  var ListNodeName = IsOutermostList ? "ol" : "ul";
-  var ListNode = document.createElement(ListNodeName);
-  for (Child of Index.Children) {
-var LiNode = document.createElement("li");
-ChildNodes = genHTMLOfIndex(Child, CurrentDirectory, false);
-for (Node of ChildNodes)
-  LiNode.appendChild(Node);
-ListNode.appendChild(LiNode);
-  }
-  Out.push(ListNode);
-  return Out;
-}
 
 function genHTMLOfIndex(Ind

[clang-tools-extra] clang-doc switched from using relative to absolute paths (PR #93281)

2024-05-24 Thread via cfe-commits

https://github.com/PeterChou1 updated 
https://github.com/llvm/llvm-project/pull/93281

>From f5872e7c82d097ae3c141765d3f1d7e3d0b25b82 Mon Sep 17 00:00:00 2001
From: PeterChou1 
Date: Fri, 24 May 2024 04:28:08 -0400
Subject: [PATCH 1/2] clang-doc switched from using relative to absolute paths

---
 clang-tools-extra/clang-doc/assets/index.js | 72 ++---
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/clang-tools-extra/clang-doc/assets/index.js 
b/clang-tools-extra/clang-doc/assets/index.js
index a5ac90f2e06e7..fe35e706cc98d 100644
--- a/clang-tools-extra/clang-doc/assets/index.js
+++ b/clang-tools-extra/clang-doc/assets/index.js
@@ -1,48 +1,46 @@
-// Append using posix-style a file name or directory to Base
-function append(Base, New) {
-  if (!New)
-return Base;
-  if (Base)
-Base += "/";
-  Base += New;
-  return Base;
-}
-
-// Get relative path to access FilePath from CurrentDirectory
-function computeRelativePath(FilePath, CurrentDirectory) {
-  var Path = FilePath;
-  while (Path) {
-if (CurrentDirectory == Path)
-  return FilePath.substring(Path.length + 1);
-Path = Path.substring(0, Path.lastIndexOf("/"));
-  }
-
-  var Dir = CurrentDirectory;
-  var Result = "";
-  while (Dir) {
-if (Dir == FilePath)
-  break;
-Dir = Dir.substring(0, Dir.lastIndexOf("/"));
-Result = append(Result, "..")
+function genLink(Ref) {
+  var Path = 
`${window.location.protocol}//${window.location.host}/${Ref.Path}`;
+  if (Ref.RefType !== "namespace") {
+if (Ref.Path === "") {
+  Path = `${Path}${Ref.Name}.html`;
+}
+else {
+  Path = `${Path}/${Ref.Name}.html`;
+}
   }
-  Result = append(Result, FilePath.substring(Dir.length))
-  return Result;
-}
-
-function genLink(Ref, CurrentDirectory) {
-  var Path = computeRelativePath(Ref.Path, CurrentDirectory);
-  if (Ref.RefType == "namespace")
-Path = append(Path, "index.html");
-  else
-Path = append(Path, Ref.Name + ".html")
 
-ANode = document.createElement("a");
+  ANode = document.createElement("a");
   ANode.setAttribute("href", Path);
   var TextNode = document.createTextNode(Ref.Name);
   ANode.appendChild(TextNode);
   return ANode;
 }
 
+function genHTMLOfIndex(Index, CurrentDirectory, IsOutermostList) {
+  // Out will store the HTML elements that Index requires to be generated
+  var Out = [];
+  if (Index.Name) {
+var SpanNode = document.createElement("span");
+var TextNode = document.createTextNode(Index.Name);
+SpanNode.appendChild(genLink(Index));
+Out.push(SpanNode);
+  }
+  if (Index.Children.length == 0)
+return Out;
+  // Only the outermost list should use ol, the others should use ul
+  var ListNodeName = IsOutermostList ? "ol" : "ul";
+  var ListNode = document.createElement(ListNodeName);
+  for (Child of Index.Children) {
+var LiNode = document.createElement("li");
+ChildNodes = genHTMLOfIndex(Child, CurrentDirectory, false);
+for (Node of ChildNodes)
+  LiNode.appendChild(Node);
+ListNode.appendChild(LiNode);
+  }
+  Out.push(ListNode);
+  return Out;
+}
+
 function genHTMLOfIndex(Index, CurrentDirectory, IsOutermostList) {
   // Out will store the HTML elements that Index requires to be generated
   var Out = [];

>From a22609f75064194604e476a12bc8154676dacfb9 Mon Sep 17 00:00:00 2001
From: PeterChou1 
Date: Fri, 24 May 2024 05:10:03 -0400
Subject: [PATCH 2/2] remove duplicate function

---
 clang-tools-extra/clang-doc/assets/index.js | 24 -
 1 file changed, 24 deletions(-)

diff --git a/clang-tools-extra/clang-doc/assets/index.js 
b/clang-tools-extra/clang-doc/assets/index.js
index fe35e706cc98d..b013418c82093 100644
--- a/clang-tools-extra/clang-doc/assets/index.js
+++ b/clang-tools-extra/clang-doc/assets/index.js
@@ -16,30 +16,6 @@ function genLink(Ref) {
   return ANode;
 }
 
-function genHTMLOfIndex(Index, CurrentDirectory, IsOutermostList) {
-  // Out will store the HTML elements that Index requires to be generated
-  var Out = [];
-  if (Index.Name) {
-var SpanNode = document.createElement("span");
-var TextNode = document.createTextNode(Index.Name);
-SpanNode.appendChild(genLink(Index));
-Out.push(SpanNode);
-  }
-  if (Index.Children.length == 0)
-return Out;
-  // Only the outermost list should use ol, the others should use ul
-  var ListNodeName = IsOutermostList ? "ol" : "ul";
-  var ListNode = document.createElement(ListNodeName);
-  for (Child of Index.Children) {
-var LiNode = document.createElement("li");
-ChildNodes = genHTMLOfIndex(Child, CurrentDirectory, false);
-for (Node of ChildNodes)
-  LiNode.appendChild(Node);
-ListNode.appendChild(LiNode);
-  }
-  Out.push(ListNode);
-  return Out;
-}
 
 function gen

[clang] [clang][Driver] Fix enabling strict alising by default when the environment is MSVC (PR #91689)

2024-05-24 Thread via cfe-commits

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

lgtm

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


[clang-tools-extra] clang-doc switched from using relative to absolute paths (PR #93281)

2024-05-24 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-tools-extra

Author: None (PeterChou1)


Changes

issue: https://github.com/llvm/llvm-project/issues/92867

I solved the problem by making the js use absolute path instead relative I 
think this also makes it more permanent since there is no need to compute 
relative path anymore

---
Full diff: https://github.com/llvm/llvm-project/pull/93281.diff


1 Files Affected:

- (modified) clang-tools-extra/clang-doc/assets/index.js (+35-37) 


``diff
diff --git a/clang-tools-extra/clang-doc/assets/index.js 
b/clang-tools-extra/clang-doc/assets/index.js
index a5ac90f2e06e7..fe35e706cc98d 100644
--- a/clang-tools-extra/clang-doc/assets/index.js
+++ b/clang-tools-extra/clang-doc/assets/index.js
@@ -1,48 +1,46 @@
-// Append using posix-style a file name or directory to Base
-function append(Base, New) {
-  if (!New)
-return Base;
-  if (Base)
-Base += "/";
-  Base += New;
-  return Base;
-}
-
-// Get relative path to access FilePath from CurrentDirectory
-function computeRelativePath(FilePath, CurrentDirectory) {
-  var Path = FilePath;
-  while (Path) {
-if (CurrentDirectory == Path)
-  return FilePath.substring(Path.length + 1);
-Path = Path.substring(0, Path.lastIndexOf("/"));
-  }
-
-  var Dir = CurrentDirectory;
-  var Result = "";
-  while (Dir) {
-if (Dir == FilePath)
-  break;
-Dir = Dir.substring(0, Dir.lastIndexOf("/"));
-Result = append(Result, "..")
+function genLink(Ref) {
+  var Path = 
`${window.location.protocol}//${window.location.host}/${Ref.Path}`;
+  if (Ref.RefType !== "namespace") {
+if (Ref.Path === "") {
+  Path = `${Path}${Ref.Name}.html`;
+}
+else {
+  Path = `${Path}/${Ref.Name}.html`;
+}
   }
-  Result = append(Result, FilePath.substring(Dir.length))
-  return Result;
-}
-
-function genLink(Ref, CurrentDirectory) {
-  var Path = computeRelativePath(Ref.Path, CurrentDirectory);
-  if (Ref.RefType == "namespace")
-Path = append(Path, "index.html");
-  else
-Path = append(Path, Ref.Name + ".html")
 
-ANode = document.createElement("a");
+  ANode = document.createElement("a");
   ANode.setAttribute("href", Path);
   var TextNode = document.createTextNode(Ref.Name);
   ANode.appendChild(TextNode);
   return ANode;
 }
 
+function genHTMLOfIndex(Index, CurrentDirectory, IsOutermostList) {
+  // Out will store the HTML elements that Index requires to be generated
+  var Out = [];
+  if (Index.Name) {
+var SpanNode = document.createElement("span");
+var TextNode = document.createTextNode(Index.Name);
+SpanNode.appendChild(genLink(Index));
+Out.push(SpanNode);
+  }
+  if (Index.Children.length == 0)
+return Out;
+  // Only the outermost list should use ol, the others should use ul
+  var ListNodeName = IsOutermostList ? "ol" : "ul";
+  var ListNode = document.createElement(ListNodeName);
+  for (Child of Index.Children) {
+var LiNode = document.createElement("li");
+ChildNodes = genHTMLOfIndex(Child, CurrentDirectory, false);
+for (Node of ChildNodes)
+  LiNode.appendChild(Node);
+ListNode.appendChild(LiNode);
+  }
+  Out.push(ListNode);
+  return Out;
+}
+
 function genHTMLOfIndex(Index, CurrentDirectory, IsOutermostList) {
   // Out will store the HTML elements that Index requires to be generated
   var Out = [];

``




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


[clang-tools-extra] clang-doc switched from using relative to absolute paths (PR #93281)

2024-05-24 Thread via cfe-commits

https://github.com/PeterChou1 created 
https://github.com/llvm/llvm-project/pull/93281

issue: https://github.com/llvm/llvm-project/issues/92867

I solved the problem by making the js use absolute path instead relative I 
think this also makes it more permanent since there is no need to compute 
relative path anymore

>From f5872e7c82d097ae3c141765d3f1d7e3d0b25b82 Mon Sep 17 00:00:00 2001
From: PeterChou1 
Date: Fri, 24 May 2024 04:28:08 -0400
Subject: [PATCH] clang-doc switched from using relative to absolute paths

---
 clang-tools-extra/clang-doc/assets/index.js | 72 ++---
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/clang-tools-extra/clang-doc/assets/index.js 
b/clang-tools-extra/clang-doc/assets/index.js
index a5ac90f2e06e7..fe35e706cc98d 100644
--- a/clang-tools-extra/clang-doc/assets/index.js
+++ b/clang-tools-extra/clang-doc/assets/index.js
@@ -1,48 +1,46 @@
-// Append using posix-style a file name or directory to Base
-function append(Base, New) {
-  if (!New)
-return Base;
-  if (Base)
-Base += "/";
-  Base += New;
-  return Base;
-}
-
-// Get relative path to access FilePath from CurrentDirectory
-function computeRelativePath(FilePath, CurrentDirectory) {
-  var Path = FilePath;
-  while (Path) {
-if (CurrentDirectory == Path)
-  return FilePath.substring(Path.length + 1);
-Path = Path.substring(0, Path.lastIndexOf("/"));
-  }
-
-  var Dir = CurrentDirectory;
-  var Result = "";
-  while (Dir) {
-if (Dir == FilePath)
-  break;
-Dir = Dir.substring(0, Dir.lastIndexOf("/"));
-Result = append(Result, "..")
+function genLink(Ref) {
+  var Path = 
`${window.location.protocol}//${window.location.host}/${Ref.Path}`;
+  if (Ref.RefType !== "namespace") {
+if (Ref.Path === "") {
+  Path = `${Path}${Ref.Name}.html`;
+}
+else {
+  Path = `${Path}/${Ref.Name}.html`;
+}
   }
-  Result = append(Result, FilePath.substring(Dir.length))
-  return Result;
-}
-
-function genLink(Ref, CurrentDirectory) {
-  var Path = computeRelativePath(Ref.Path, CurrentDirectory);
-  if (Ref.RefType == "namespace")
-Path = append(Path, "index.html");
-  else
-Path = append(Path, Ref.Name + ".html")
 
-ANode = document.createElement("a");
+  ANode = document.createElement("a");
   ANode.setAttribute("href", Path);
   var TextNode = document.createTextNode(Ref.Name);
   ANode.appendChild(TextNode);
   return ANode;
 }
 
+function genHTMLOfIndex(Index, CurrentDirectory, IsOutermostList) {
+  // Out will store the HTML elements that Index requires to be generated
+  var Out = [];
+  if (Index.Name) {
+var SpanNode = document.createElement("span");
+var TextNode = document.createTextNode(Index.Name);
+SpanNode.appendChild(genLink(Index));
+Out.push(SpanNode);
+  }
+  if (Index.Children.length == 0)
+return Out;
+  // Only the outermost list should use ol, the others should use ul
+  var ListNodeName = IsOutermostList ? "ol" : "ul";
+  var ListNode = document.createElement(ListNodeName);
+  for (Child of Index.Children) {
+var LiNode = document.createElement("li");
+ChildNodes = genHTMLOfIndex(Child, CurrentDirectory, false);
+for (Node of ChildNodes)
+  LiNode.appendChild(Node);
+ListNode.appendChild(LiNode);
+  }
+  Out.push(ListNode);
+  return Out;
+}
+
 function genHTMLOfIndex(Index, CurrentDirectory, IsOutermostList) {
   // Out will store the HTML elements that Index requires to be generated
   var Out = [];

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


[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-24 Thread Jan Svoboda via cfe-commits

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

LGTM, thanks!

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


[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-24 Thread Jan Svoboda via cfe-commits

https://github.com/jansvoboda11 deleted 
https://github.com/llvm/llvm-project/pull/89950
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-24 Thread Jan Svoboda via cfe-commits


@@ -0,0 +1,36 @@
+// Check that the scanner can adjust arguments by reading .rsp files in 
advance.
+
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json

jansvoboda11 wrote:

Ok, that makes sense, thanks!

https://github.com/llvm/llvm-project/pull/89950
_______
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-24 Thread Jan Svoboda via cfe-commits


@@ -86,6 +86,8 @@ static bool DeprecatedDriverCommand;
 static ResourceDirRecipeKind ResourceDirRecipe;
 static bool Verbose;
 static bool PrintTiming;
+static llvm::BumpPtrAllocator Alloc;
+static llvm::StringSaver Saver{Alloc};

jansvoboda11 wrote:

Why do these need to be global?

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


[clang] [analyzer] Fix a test issue in mingw configurations (PR #92737)

2024-05-24 Thread via cfe-commits

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

lgtm

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


[clang] [clang][Sema] Fix crash when diagnosing candidates with parameter packs (PR #93079)

2024-05-24 Thread kadir çetinkaya via cfe-commits

https://github.com/kadircet updated 
https://github.com/llvm/llvm-project/pull/93079

From 9c691ab41ba500c1962bf9d63de86b65f184f047 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya 
Date: Wed, 22 May 2024 19:37:18 +0200
Subject: [PATCH] [clang][Sema] Fix crash when diagnosing candidates with
 parameter packs

Prevent OOB access by not printing target parameter range when there's a
pack in the function parameters.

Fixes https://github.com/llvm/llvm-project/issues/93076.
Fixes https://github.com/llvm/llvm-project/issues/76354.
Fixes https://github.com/llvm/llvm-project/issues/70191.
---
 clang/docs/ReleaseNotes.rst  |  3 ++-
 clang/lib/Sema/SemaOverload.cpp  | 11 +--
 clang/test/SemaCXX/overload-template.cpp |  3 +++
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 45676a02b760b..023af70572306 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -730,7 +730,6 @@ Bug Fixes to C++ Support
   from being explicitly specialized for a given implicit instantiation of the 
class template.
 - Fixed a crash when ``this`` is used in a dependent class scope function 
template specialization
   that instantiates to a static member function.
-
 - Fix crash when inheriting from a cv-qualified type. Fixes #GH35603
 - Fix a crash when the using enum declaration uses an anonymous enumeration. 
Fixes (#GH86790).
 - Handled an edge case in ``getFullyPackExpandedSize`` so that we now avoid a 
false-positive diagnostic. (#GH84220)
@@ -790,6 +789,8 @@ Bug Fixes to C++ Support
   Fixes (#GH87210), (GH89541).
 - Clang no longer tries to check if an expression is immediate-escalating in 
an unevaluated context.
   Fixes (#GH91308).
+- Fixed a crash when diagnosing failed conversions involving template parameter
+  packs. (#GH93076)
 
 Bug Fixes to AST Handling
 ^
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 0c89fca8d38eb..86e869c7c72ff 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -13,6 +13,7 @@
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTLambda.h"
 #include "clang/AST/CXXInheritance.h"
+#include "clang/AST/Decl.h"
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DependenceFlags.h"
@@ -11301,8 +11302,14 @@ static void DiagnoseBadConversion(Sema , 
OverloadCandidate *Cand,
   Expr *FromExpr = Conv.Bad.FromExpr;
   QualType FromTy = Conv.Bad.getFromType();
   QualType ToTy = Conv.Bad.getToType();
-  SourceRange ToParamRange =
-  !isObjectArgument ? Fn->getParamDecl(I)->getSourceRange() : 
SourceRange();
+  SourceRange ToParamRange;
+
+  // FIXME: In presence of parameter packs we can't determine parameter range
+  // reliably, as we don't have access to instantiation.
+  bool HasParamPack = llvm::any_of(Fn->parameters().take_front(I),
+   [](const ParmVarDecl *Parm) { return Parm->isParameterPack(); 
});
+  if (!isObjectArgument && !HasParamPack)
+ToParamRange = Fn->getParamDecl(I)->getSourceRange();
 
   if (FromTy == S.Context.OverloadTy) {
 assert(FromExpr && "overload set argument came from implicit argument?");
diff --git a/clang/test/SemaCXX/overload-template.cpp 
b/clang/test/SemaCXX/overload-template.cpp
index 0fe13c479cce2..01cfe87a05831 100644
--- a/clang/test/SemaCXX/overload-template.cpp
+++ b/clang/test/SemaCXX/overload-template.cpp
@@ -58,3 +58,6 @@ namespace overloadCheck{
   }
 }
 #endif
+
+template  int b(a...); // expected-note {{candidate function 
template not viable: no known conversion from 'int ()' to 'int' for 2nd 
argument}}
+int d() { return b(0, d); } // expected-error {{no matching function 
for call to 'b'}}

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


[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-24 Thread Shengchen Kan via cfe-commits


@@ -58024,15 +58043,22 @@ X86TargetLowering::getRegForInlineAsmConstraint(const 
TargetRegisterInfo *TRI,
 case 'r':   // GENERAL_REGS
 case 'l':   // INDEX_REGS
   if (VT == MVT::i8 || VT == MVT::i1)
-return std::make_pair(0U, ::GR8_NOREX2RegClass);
+return std::make_pair(0U, Subtarget.useInlineAsmGPR32()
+  ? ::GR8_NOREX2RegClass
+  : ::GR8RegClass);
   if (VT == MVT::i16)
-return std::make_pair(0U, ::GR16_NOREX2RegClass);
+return std::make_pair(0U, Subtarget.useInlineAsmGPR32()
+  ? ::GR16_NOREX2RegClass
+  : ::GR16RegClass);
   if (VT == MVT::i32 || VT == MVT::f32 ||
   (!VT.isVector() && !Subtarget.is64Bit()))
-return std::make_pair(0U, ::GR32_NOREX2RegClass);
+return std::make_pair(0U, Subtarget.useInlineAsmGPR32()

KanRobert wrote:

The order should be reversed.
Subtarget.useInlineAsmGPR32() ? GR32 : GR32_NOREX2

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


[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-24 Thread Freddy Ye via cfe-commits


@@ -58024,15 +58043,22 @@ X86TargetLowering::getRegForInlineAsmConstraint(const 
TargetRegisterInfo *TRI,
 case 'r':   // GENERAL_REGS
 case 'l':   // INDEX_REGS
   if (VT == MVT::i8 || VT == MVT::i1)
-return std::make_pair(0U, ::GR8_NOREX2RegClass);
+return std::make_pair(0U, Subtarget.useInlineAsmGPR32()
+  ? ::GR8_NOREX2RegClass
+  : ::GR8RegClass);
   if (VT == MVT::i16)
-return std::make_pair(0U, ::GR16_NOREX2RegClass);
+return std::make_pair(0U, Subtarget.useInlineAsmGPR32()
+  ? ::GR16_NOREX2RegClass
+  : ::GR16RegClass);
   if (VT == MVT::i32 || VT == MVT::f32 ||
   (!VT.isVector() && !Subtarget.is64Bit()))
-return std::make_pair(0U, ::GR32_NOREX2RegClass);
+return std::make_pair(0U, Subtarget.useInlineAsmGPR32()

FreddyLeaf wrote:

covered by getPreserverdRegister in RA.

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


[clang] [clang][Sema] Fix crash when diagnosing candidates with parameter packs (PR #93079)

2024-05-24 Thread kadir çetinkaya via cfe-commits

kadircet wrote:

@shafik thx for the pointers, i didn't know this came up before and even there 
were attempted fixes. I can verify that both of those are also fixed with this 
patch.

@knightXun do you plan to proceed with 
https://github.com/llvm/llvm-project/pull/70280 ? If so I am happy to discard 
this PR in favor of yours.

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


[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-05-24 Thread Mital Ashok via cfe-commits
ka '{{.+}}') in initializer 
list}}
 //   since-cxx11-note@-2 {{in instantiation of function template 
specialization 'cwg2627::f<65>' requested here}}
@@ -115,30 +100,18 @@ struct E {
 };
 
 template std::int16_t g(E);
-// until-cxx23-pedantic-warning-re@#cwg2627-g {{narrowing 
non-constant-expression from 'int' bit-field of width 16 to '{{.+}}' is a C++23 
extension}}
-//   until-cxx23-pedantic-note-re@-2 {{in instantiation of function template 
specialization 'cwg2627::g<{{.+}}, cwg2627::E>' requested here}}
-//   until-cxx23-pedantic-note@#cwg2627-g {{insert an explicit cast to silence 
this issue}}
 template std::int16_t g(E);
-// until-cxx23-pedantic-warning-re@#cwg2627-g {{narrowing 
non-constant-expression from 'unsigned int' bit-field of width 15 to '{{.+}}' 
is a C++23 extension}}
-//   until-cxx23-pedantic-note-re@-2 {{in instantiation of function template 
specialization 'cwg2627::g<{{.+}}, cwg2627::E>' requested 
here}}
-//   until-cxx23-pedantic-note@#cwg2627-g {{insert an explicit cast to silence 
this issue}}
 template std::int16_t g(E);
 // since-cxx11-error-re@#cwg2627-g {{non-constant-expression cannot be 
narrowed from type 'unsigned int' to '{{.+}}' in initializer list}}
 //   since-cxx11-note-re@-2 {{in instantiation of function template 
specialization 'cwg2627::g<{{.+}}, cwg2627::E>' requested 
here}}
 //   since-cxx11-note@#cwg2627-g {{insert an explicit cast to silence this 
issue}}
 template std::uint16_t g(E);
-// until-cxx23-pedantic-warning-re@#cwg2627-g {{narrowing 
non-constant-expression from 'unsigned int' bit-field of width 16 to '{{.+}}' 
is a C++23 extension}}
-//   until-cxx23-pedantic-note-re@-2 {{in instantiation of function template 
specialization 'cwg2627::g<{{.+}}, cwg2627::E>' requested 
here}}
-//   until-cxx23-pedantic-note@#cwg2627-g {{insert an explicit cast to silence 
this issue}}
 template std::uint16_t g(E);
 // since-cxx11-error-re@#cwg2627-g {{non-constant-expression cannot be 
narrowed from type 'int' to '{{.+}}' in initializer list}}
 //   since-cxx11-note-re@-2 {{in instantiation of function template 
specialization 'cwg2627::g<{{.+}}, cwg2627::E>' requested here}}
 //   since-cxx11-note@#cwg2627-g {{insert an explicit cast to silence this 
issue}}
 
 template bool g(E);
-// until-cxx23-pedantic-warning@#cwg2627-g {{narrowing non-constant-expression 
from 'unsigned int' bit-field of width 1 to 'bool' is a C++23 extension}}
-//   until-cxx23-pedantic-note@-2 {{in instantiation of function template 
specialization 'cwg2627::g>' requested here}}
-//   until-cxx23-pedantic-note@#cwg2627-g {{insert an explicit cast to silence 
this issue}}
 template bool g(E);
 // since-cxx11-error@#cwg2627-g {{non-constant-expression cannot be narrowed 
from type 'int' to 'bool' in initializer list}}
 //   since-cxx11-note@-2 {{in instantiation of function template 
specialization 'cwg2627::g>' requested here}}
@@ -149,14 +122,22 @@ constexpr decltype(Target{ std::declval().i }, 
false) is_narrowing(int)
 template
 constexpr bool is_narrowing(long) { return true; }
 
-constexpr bool is_cxx23 = __cplusplus >= 202302L;
-static_assert(is_narrowing>(0) == !is_cxx23, "");
-static_assert(is_narrowing>(0) == !is_cxx23, "");
+static_assert(!is_narrowing>(0), "");
+static_assert(!is_narrowing>(0), "");
 static_assert(is_narrowing>(0), "");
-static_assert(is_narrowing>(0) == !is_cxx23, 
"");
+static_assert(!is_narrowing>(0), "");
 static_assert(is_narrowing>(0), "");
-static_assert(is_narrowing>(0) == !is_cxx23, "");
+static_assert(!is_narrowing>(0), "");
 static_assert(is_narrowing>(0), "");
+
+template
+struct F {
+  signed int x : N;
+  decltype(std::int16_t{ x }) dependent_narrowing;
+  decltype(unsigned{ x }) always_narrowing;
+// since-cxx11-error@-1 {{non-constant-expression cannot be narrowed from type 
'int' to 'unsigned int' in initializer list}}
+//   since-cxx11-note@-2 {{insert an explicit cast to silence this issue}}
+};
 #endif
 }
 

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


[clang] [clang][Sema] Fix crash when diagnosing candidates with parameter packs (PR #93079)

2024-05-24 Thread kadir çetinkaya via cfe-commits

https://github.com/kadircet updated 
https://github.com/llvm/llvm-project/pull/93079

From 6a057ff4b539045ce81e55b63702892496d18a97 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya 
Date: Wed, 22 May 2024 19:37:18 +0200
Subject: [PATCH] [clang][Sema] Fix crash when diagnosing candidates with
 parameter packs

Prevent OOB access.

Fixes https://github.com/llvm/llvm-project/issues/93076.
Fixes https://github.com/llvm/llvm-project/issues/76354.
Fixes https://github.com/llvm/llvm-project/issues/70191.
---
 clang/lib/Sema/SemaOverload.cpp  | 11 +--
 clang/test/SemaCXX/overload-template.cpp |  3 +++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 0c89fca8d38eb..86e869c7c72ff 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -13,6 +13,7 @@
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTLambda.h"
 #include "clang/AST/CXXInheritance.h"
+#include "clang/AST/Decl.h"
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DependenceFlags.h"
@@ -11301,8 +11302,14 @@ static void DiagnoseBadConversion(Sema , 
OverloadCandidate *Cand,
   Expr *FromExpr = Conv.Bad.FromExpr;
   QualType FromTy = Conv.Bad.getFromType();
   QualType ToTy = Conv.Bad.getToType();
-  SourceRange ToParamRange =
-  !isObjectArgument ? Fn->getParamDecl(I)->getSourceRange() : 
SourceRange();
+  SourceRange ToParamRange;
+
+  // FIXME: In presence of parameter packs we can't determine parameter range
+  // reliably, as we don't have access to instantiation.
+  bool HasParamPack = llvm::any_of(Fn->parameters().take_front(I),
+   [](const ParmVarDecl *Parm) { return Parm->isParameterPack(); 
});
+  if (!isObjectArgument && !HasParamPack)
+ToParamRange = Fn->getParamDecl(I)->getSourceRange();
 
   if (FromTy == S.Context.OverloadTy) {
 assert(FromExpr && "overload set argument came from implicit argument?");
diff --git a/clang/test/SemaCXX/overload-template.cpp 
b/clang/test/SemaCXX/overload-template.cpp
index 0fe13c479cce2..01cfe87a05831 100644
--- a/clang/test/SemaCXX/overload-template.cpp
+++ b/clang/test/SemaCXX/overload-template.cpp
@@ -58,3 +58,6 @@ namespace overloadCheck{
   }
 }
 #endif
+
+template  int b(a...); // expected-note {{candidate function 
template not viable: no known conversion from 'int ()' to 'int' for 2nd 
argument}}
+int d() { return b(0, d); } // expected-error {{no matching function 
for call to 'b'}}

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


[clang] [clang][Sema] Fix crash when diagnosing candidates with parameter packs (PR #93079)

2024-05-24 Thread via cfe-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff a79a0c52885c3a60d6afdda3b125866b8ed75fce 
7c5716a726fe0c4a2a3e0ddfe8f992491bd0299d -- clang/lib/Sema/SemaOverload.cpp 
clang/test/SemaCXX/overload-template.cpp
``





View the diff from clang-format here.


``diff
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 86e869c7c7..61d3c1633a 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -11306,8 +11306,10 @@ static void DiagnoseBadConversion(Sema , 
OverloadCandidate *Cand,
 
   // FIXME: In presence of parameter packs we can't determine parameter range
   // reliably, as we don't have access to instantiation.
-  bool HasParamPack = llvm::any_of(Fn->parameters().take_front(I),
-   [](const ParmVarDecl *Parm) { return Parm->isParameterPack(); 
});
+  bool HasParamPack =
+  llvm::any_of(Fn->parameters().take_front(I), [](const ParmVarDecl *Parm) 
{
+return Parm->isParameterPack();
+  });
   if (!isObjectArgument && !HasParamPack)
 ToParamRange = Fn->getParamDecl(I)->getSourceRange();
 

``




https://github.com/llvm/llvm-project/pull/93079
_______
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][Sema] Fix crash when diagnosing candidates with parameter packs (PR #93079)

2024-05-24 Thread kadir çetinkaya via cfe-commits

https://github.com/kadircet updated 
https://github.com/llvm/llvm-project/pull/93079

From f7bdd39714e21ff31b3c5aa6a3a18967cb6fef2c Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya 
Date: Wed, 22 May 2024 19:37:18 +0200
Subject: [PATCH 1/2] [clang][Sema] Fix crash when diagnosing candidates with
 parameter packs

Prevent OOB access.

Fixes https://github.com/llvm/llvm-project/issues/93076
---
 clang/lib/Sema/SemaOverload.cpp  | 5 +++--
 clang/test/SemaCXX/overload-template.cpp | 3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 0c89fca8d38eb..7465d6d96c20f 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -11301,8 +11301,9 @@ static void DiagnoseBadConversion(Sema , 
OverloadCandidate *Cand,
   Expr *FromExpr = Conv.Bad.FromExpr;
   QualType FromTy = Conv.Bad.getFromType();
   QualType ToTy = Conv.Bad.getToType();
-  SourceRange ToParamRange =
-  !isObjectArgument ? Fn->getParamDecl(I)->getSourceRange() : 
SourceRange();
+  SourceRange ToParamRange;
+  if (!isObjectArgument && I < Fn->getNumParams())
+ToParamRange = Fn->getParamDecl(I)->getSourceRange();
 
   if (FromTy == S.Context.OverloadTy) {
 assert(FromExpr && "overload set argument came from implicit argument?");
diff --git a/clang/test/SemaCXX/overload-template.cpp 
b/clang/test/SemaCXX/overload-template.cpp
index 0fe13c479cce2..01cfe87a05831 100644
--- a/clang/test/SemaCXX/overload-template.cpp
+++ b/clang/test/SemaCXX/overload-template.cpp
@@ -58,3 +58,6 @@ namespace overloadCheck{
   }
 }
 #endif
+
+template  int b(a...); // expected-note {{candidate function 
template not viable: no known conversion from 'int ()' to 'int' for 2nd 
argument}}
+int d() { return b(0, d); } // expected-error {{no matching function 
for call to 'b'}}

From 7c5716a726fe0c4a2a3e0ddfe8f992491bd0299d Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya 
Date: Fri, 24 May 2024 10:25:25 +0200
Subject: [PATCH 2/2] add fixme and improve range handling

---
 clang/lib/Sema/SemaOverload.cpp | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 7465d6d96c20f..86e869c7c72ff 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -13,6 +13,7 @@
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTLambda.h"
 #include "clang/AST/CXXInheritance.h"
+#include "clang/AST/Decl.h"
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DependenceFlags.h"
@@ -11302,7 +11303,12 @@ static void DiagnoseBadConversion(Sema , 
OverloadCandidate *Cand,
   QualType FromTy = Conv.Bad.getFromType();
   QualType ToTy = Conv.Bad.getToType();
   SourceRange ToParamRange;
-  if (!isObjectArgument && I < Fn->getNumParams())
+
+  // FIXME: In presence of parameter packs we can't determine parameter range
+  // reliably, as we don't have access to instantiation.
+  bool HasParamPack = llvm::any_of(Fn->parameters().take_front(I),
+   [](const ParmVarDecl *Parm) { return Parm->isParameterPack(); 
});
+  if (!isObjectArgument && !HasParamPack)
 ToParamRange = Fn->getParamDecl(I)->getSourceRange();
 
   if (FromTy == S.Context.OverloadTy) {

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


[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-05-24 Thread Mital Ashok via cfe-commits
:int16_t g(E);
-// until-cxx23-pedantic-warning-re@#cwg2627-g {{narrowing 
non-constant-expression from 'int' bit-field of width 16 to '{{.+}}' is a C++23 
extension}}
-//   until-cxx23-pedantic-note-re@-2 {{in instantiation of function template 
specialization 'cwg2627::g<{{.+}}, cwg2627::E>' requested here}}
-//   until-cxx23-pedantic-note@#cwg2627-g {{insert an explicit cast to silence 
this issue}}
 template std::int16_t g(E);
-// until-cxx23-pedantic-warning-re@#cwg2627-g {{narrowing 
non-constant-expression from 'unsigned int' bit-field of width 15 to '{{.+}}' 
is a C++23 extension}}
-//   until-cxx23-pedantic-note-re@-2 {{in instantiation of function template 
specialization 'cwg2627::g<{{.+}}, cwg2627::E>' requested 
here}}
-//   until-cxx23-pedantic-note@#cwg2627-g {{insert an explicit cast to silence 
this issue}}
 template std::int16_t g(E);
 // since-cxx11-error-re@#cwg2627-g {{non-constant-expression cannot be 
narrowed from type 'unsigned int' to '{{.+}}' in initializer list}}
 //   since-cxx11-note-re@-2 {{in instantiation of function template 
specialization 'cwg2627::g<{{.+}}, cwg2627::E>' requested 
here}}
 //   since-cxx11-note@#cwg2627-g {{insert an explicit cast to silence this 
issue}}
 template std::uint16_t g(E);
-// until-cxx23-pedantic-warning-re@#cwg2627-g {{narrowing 
non-constant-expression from 'unsigned int' bit-field of width 16 to '{{.+}}' 
is a C++23 extension}}
-//   until-cxx23-pedantic-note-re@-2 {{in instantiation of function template 
specialization 'cwg2627::g<{{.+}}, cwg2627::E>' requested 
here}}
-//   until-cxx23-pedantic-note@#cwg2627-g {{insert an explicit cast to silence 
this issue}}
 template std::uint16_t g(E);
 // since-cxx11-error-re@#cwg2627-g {{non-constant-expression cannot be 
narrowed from type 'int' to '{{.+}}' in initializer list}}
 //   since-cxx11-note-re@-2 {{in instantiation of function template 
specialization 'cwg2627::g<{{.+}}, cwg2627::E>' requested here}}
 //   since-cxx11-note@#cwg2627-g {{insert an explicit cast to silence this 
issue}}
 
 template bool g(E);
-// until-cxx23-pedantic-warning@#cwg2627-g {{narrowing non-constant-expression 
from 'unsigned int' bit-field of width 1 to 'bool' is a C++23 extension}}
-//   until-cxx23-pedantic-note@-2 {{in instantiation of function template 
specialization 'cwg2627::g>' requested here}}
-//   until-cxx23-pedantic-note@#cwg2627-g {{insert an explicit cast to silence 
this issue}}
 template bool g(E);
 // since-cxx11-error@#cwg2627-g {{non-constant-expression cannot be narrowed 
from type 'int' to 'bool' in initializer list}}
 //   since-cxx11-note@-2 {{in instantiation of function template 
specialization 'cwg2627::g>' requested here}}
@@ -149,14 +122,22 @@ constexpr decltype(Target{ std::declval().i }, 
false) is_narrowing(int)
 template
 constexpr bool is_narrowing(long) { return true; }
 
-constexpr bool is_cxx23 = __cplusplus >= 202302L;
-static_assert(is_narrowing>(0) == !is_cxx23, "");
-static_assert(is_narrowing>(0) == !is_cxx23, "");
+static_assert(!is_narrowing>(0), "");
+static_assert(!is_narrowing>(0), "");
 static_assert(is_narrowing>(0), "");
-static_assert(is_narrowing>(0) == !is_cxx23, 
"");
+static_assert(!is_narrowing>(0), "");
 static_assert(is_narrowing>(0), "");
-static_assert(is_narrowing>(0) == !is_cxx23, "");
+static_assert(!is_narrowing>(0), "");
 static_assert(is_narrowing>(0), "");
+
+template
+struct F {
+  signed int x : N;
+  decltype(std::int16_t{ x }) dependent_narrowing;
+  decltype(unsigned{ x }) always_narrowing;
+// since-cxx11-error@-1 {{non-constant-expression cannot be narrowed from type 
'int' to 'unsigned int' in initializer list}}
+//   since-cxx11-note@-2 {{insert an explicit cast to silence this issue}}
+};
 #endif
 }
 

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


[clang] [clang][Sema] Fix crash when diagnosing candidates with parameter packs (PR #93079)

2024-05-24 Thread kadir çetinkaya via cfe-commits


@@ -11298,8 +11298,9 @@ static void DiagnoseBadConversion(Sema , 
OverloadCandidate *Cand,
   Expr *FromExpr = Conv.Bad.FromExpr;
   QualType FromTy = Conv.Bad.getFromType();
   QualType ToTy = Conv.Bad.getToType();
-  SourceRange ToParamRange =
-  !isObjectArgument ? Fn->getParamDecl(I)->getSourceRange() : 
SourceRange();
+  SourceRange ToParamRange;
+  if (!isObjectArgument && I < Fn->getNumParams())
+ToParamRange = Fn->getParamDecl(I)->getSourceRange();

kadircet wrote:

> Though I don't think solving this is complicated

sorry I guess I didn't convey full context in my previous message when I just 
said "it requires propagating extra information in the bad conversion about the 
parameter location".  `Fn` in this context is the template decl itself, hence 
the packs in the parameters are dependent. hence we can't simply ask how many 
expansions are there.

https://github.com/llvm/llvm-project/pull/93079
___________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-24 Thread Freddy Ye via cfe-commits


@@ -5418,6 +5418,8 @@ X86:
   operand will get allocated only to RAX -- if two 32-bit operands are needed,
   you're better off splitting it yourself, before passing it to the asm
   statement.
+- ``jR``: An 8, 16, 32, or 64-bit integer EGPR when EGPR feature is on.
+  Otherwise, same as ``R``.

FreddyLeaf wrote:

> `r` is same as `R` for X86 IIUC.

Sorry, wrong conclusion. I did bad experiment before, making me judge clang 
didn't clarify for 'R' and 'r' for X86. 

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


[jenkins-infra/jenkins-infra] d16d80: chore: Bump container agent image jenkins/inbound-...

2024-05-24 Thread 'jenkins-infra-updatecli[bot]' via Jenkins Commits
  Branch: 
refs/heads/updatecli_production_8356aaf9de6395f605e0292563495b2f92d6167c3cfc34d372e0de7ef327514f
  Home:   https://github.com/jenkins-infra/jenkins-infra
  Commit: d16d809ae5b90391667ea34cf9ea0c8c631092bb
  
https://github.com/jenkins-infra/jenkins-infra/commit/d16d809ae5b90391667ea34cf9ea0c8c631092bb
  Author: jenkins-infra-updatecli[bot] 
<101213878+jenkins-infra-updatecli[bot]@users.noreply.github.com>
  Date:   2024-05-24 (Fri, 24 May 2024)

  Changed paths:
M hieradata/common.yaml

  Log Message:
  ---
  chore: Bump container agent image jenkins/inbound-agent (JDK17) (#3445)

Made with ❤️️ by updatecli

Co-authored-by: Jenkins Infra Bot (updatecli) 
<60776566+jenkins-infra-...@users.noreply.github.com>



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkins-infra/jenkins-infra/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkins-infra/jenkins-infra/push/refs/heads/updatecli_production_8356aaf9de6395f605e0292563495b2f92d6167c3cfc34d372e0de7ef327514f/c30653-d16d80%40github.com.


[jenkins-infra/jenkins-infra] d16d80: chore: Bump container agent image jenkins/inbound-...

2024-05-24 Thread 'jenkins-infra-updatecli[bot]' via Jenkins Commits
  Branch: 
refs/heads/updatecli_production_f3523bdf33dc26cfc9fd2d0706db3c7127f3542375bb5a60b752d30e380c2d9d
  Home:   https://github.com/jenkins-infra/jenkins-infra
  Commit: d16d809ae5b90391667ea34cf9ea0c8c631092bb
  
https://github.com/jenkins-infra/jenkins-infra/commit/d16d809ae5b90391667ea34cf9ea0c8c631092bb
  Author: jenkins-infra-updatecli[bot] 
<101213878+jenkins-infra-updatecli[bot]@users.noreply.github.com>
  Date:   2024-05-24 (Fri, 24 May 2024)

  Changed paths:
M hieradata/common.yaml

  Log Message:
  ---
  chore: Bump container agent image jenkins/inbound-agent (JDK17) (#3445)

Made with ❤️️ by updatecli

Co-authored-by: Jenkins Infra Bot (updatecli) 
<60776566+jenkins-infra-...@users.noreply.github.com>



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkins-infra/jenkins-infra/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkins-infra/jenkins-infra/push/refs/heads/updatecli_production_f3523bdf33dc26cfc9fd2d0706db3c7127f3542375bb5a60b752d30e380c2d9d/c30653-d16d80%40github.com.


[jenkinsci/badge-plugin] 45d76d: README.md: fix typo "fot" => "for" (#156)

2024-05-24 Thread 'strangelookingnerd' via Jenkins Commits
  Branch: refs/heads/refactoring_for_new_major_version
  Home:   https://github.com/jenkinsci/badge-plugin
  Commit: 45d76d2a8b3be8e8474ae37b1612911e75595a30
  
https://github.com/jenkinsci/badge-plugin/commit/45d76d2a8b3be8e8474ae37b1612911e75595a30
  Author: Jim Klimov 
  Date:   2024-05-23 (Thu, 23 May 2024)

  Changed paths:
M README.md

  Log Message:
  ---
  README.md: fix typo "fot" => "for" (#156)

Signed-off-by: Evgeny Klimov 


  Commit: 010aaf024145c4c53c2d8dc0509fb262582e005e
  
https://github.com/jenkinsci/badge-plugin/commit/010aaf024145c4c53c2d8dc0509fb262582e005e
  Author: strangelookingnerd 
<49242855+strangelookingn...@users.noreply.github.com>
  Date:   2024-05-24 (Fri, 24 May 2024)

  Changed paths:

  Log Message:
  ---
  Merge branch 'refs/heads/master' into refactoring_for_new_major_version

# Conflicts:
#   README.md


Compare: 
https://github.com/jenkinsci/badge-plugin/compare/deb8b14c917e...010aaf024145

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/badge-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/badge-plugin/push/refs/heads/refactoring_for_new_major_version/deb8b1-010aaf%40github.com.


[jenkins-infra/jenkins-infra]

2024-05-24 Thread 'Damien Duportal' via Jenkins Commits
  Branch: 
refs/heads/updatecli_production_580cfbd862046428ca380ea132418df2909ba6d2e8bbf7d15d4dc22709f9666a
  Home:   https://github.com/jenkins-infra/jenkins-infra

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkins-infra/jenkins-infra/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkins-infra/jenkins-infra/push/refs/heads/updatecli_production_580cfbd862046428ca380ea132418df2909ba6d2e8bbf7d15d4dc22709f9666a/c18268-00%40github.com.


[jenkins-infra/jenkins-infra] d16d80: chore: Bump container agent image jenkins/inbound-...

2024-05-24 Thread 'jenkins-infra-updatecli[bot]' via Jenkins Commits
  Branch: refs/heads/production
  Home:   https://github.com/jenkins-infra/jenkins-infra
  Commit: d16d809ae5b90391667ea34cf9ea0c8c631092bb
  
https://github.com/jenkins-infra/jenkins-infra/commit/d16d809ae5b90391667ea34cf9ea0c8c631092bb
  Author: jenkins-infra-updatecli[bot] 
<101213878+jenkins-infra-updatecli[bot]@users.noreply.github.com>
  Date:   2024-05-24 (Fri, 24 May 2024)

  Changed paths:
M hieradata/common.yaml

  Log Message:
  ---
  chore: Bump container agent image jenkins/inbound-agent (JDK17) (#3445)

Made with ❤️️ by updatecli

Co-authored-by: Jenkins Infra Bot (updatecli) 
<60776566+jenkins-infra-...@users.noreply.github.com>



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkins-infra/jenkins-infra/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkins-infra/jenkins-infra/push/refs/heads/production/c30653-d16d80%40github.com.


[clang] [clang] Add /Zc:__STDC__ flag to clang-cl (PR #68690)

2024-05-24 Thread via cfe-commits

xbjfk wrote:

Hi @MaxEW707 
Yes, I will need someone to commit this for me.
Thanks!

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


[Lldb-commits] [lldb] 77ae18b - [lldb-dap] Send terminated event only once (#93172)

2024-05-24 Thread via lldb-commits

Author: Pavel Labath
Date: 2024-05-24T09:22:42+02:00
New Revision: 77ae18b0d99e1fc29b1e9345ce824dde2436c02c

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

LOG: [lldb-dap] Send terminated event only once (#93172)

This is a regression from #91591. Turns out std::mutex does not prevent
code from running twice. :facepalm:

Added: 


Modified: 
lldb/tools/lldb-dap/DAP.h
lldb/tools/lldb-dap/lldb-dap.cpp

Removed: 




diff  --git a/lldb/tools/lldb-dap/DAP.h b/lldb/tools/lldb-dap/DAP.h
index bbd9d46ba3a04..a88ee3e1dec6b 100644
--- a/lldb/tools/lldb-dap/DAP.h
+++ b/lldb/tools/lldb-dap/DAP.h
@@ -26,6 +26,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/JSON.h"
+#include "llvm/Support/Threading.h"
 #include "llvm/Support/raw_ostream.h"
 
 #include "lldb/API/SBAttachInfo.h"
@@ -169,6 +170,7 @@ struct DAP {
   std::optional last_launch_or_attach_request;
   lldb::tid_t focus_tid;
   bool disconnecting = false;
+  llvm::once_flag terminated_event_flag;
   bool stop_at_entry;
   bool is_attach;
   bool enable_auto_variable_summaries;

diff  --git a/lldb/tools/lldb-dap/lldb-dap.cpp 
b/lldb/tools/lldb-dap/lldb-dap.cpp
index 170fa88f1e8b8..7746afb6cbbf3 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -227,13 +227,12 @@ void SendContinuedEvent() {
 // debugged.
 void SendTerminatedEvent() {
   // Prevent races if the process exits while we're being asked to disconnect.
-  static std::mutex mutex;
-  std::lock_guard locker(mutex);
-
-  g_dap.RunTerminateCommands();
-  // Send a "terminated" event
-  llvm::json::Object event(CreateTerminatedEventObject());
-  g_dap.SendJSON(llvm::json::Value(std::move(event)));
+  llvm::call_once(g_dap.terminated_event_flag, [&] {
+g_dap.RunTerminateCommands();
+// Send a "terminated" event
+llvm::json::Object event(CreateTerminatedEventObject());
+g_dap.SendJSON(llvm::json::Value(std::move(event)));
+  });
 }
 
 // Send a thread stopped event for all threads as long as the process



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


[Lldb-commits] [lldb] [lldb-dap] Send terminated event only once (PR #93172)

2024-05-24 Thread Pavel Labath via lldb-commits

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


[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-24 Thread Shengchen Kan via cfe-commits


@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: not llc -mtriple=x86_64 %s 2>&1 | FileCheck %s --check-prefix=ERR
+; RUN: llc -mtriple=x86_64 -mattr=+egpr < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64 -mattr=+egpr,+inline-asm-use-gpr32 < %s | FileCheck 
%s
+
+; ERR: error: inline assembly requires more registers than available
+
+define void @constraint_jR_test() nounwind "frame-pointer"="all" {

KanRobert wrote:

How does it help? The error should not be related to frame pointer.

https://github.com/llvm/llvm-project/pull/92338
___________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-24 Thread Shengchen Kan via cfe-commits


@@ -5418,6 +5418,8 @@ X86:
   operand will get allocated only to RAX -- if two 32-bit operands are needed,
   you're better off splitting it yourself, before passing it to the asm
   statement.
+- ``jR``: An 8, 16, 32, or 64-bit integer EGPR when EGPR feature is on.
+  Otherwise, same as ``R``.

KanRobert wrote:

I think no
```
- ``r`` or ``l``: An 8, 16, 32, or 64-bit integer register.
- ``R``: An 8, 16, 32, or 64-bit "legacy" integer register -- one which has
  existed since i386, and can be accessed without the REX prefix.
```

`jR` seems weird by the existing conventions. We can change the design before 
we have the real users.

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


[Lldb-commits] [lldb] Read and store gnu build id from loaded core file (PR #92492)

2024-05-24 Thread Pavel Labath via lldb-commits


@@ -983,6 +994,67 @@ llvm::Error 
ProcessElfCore::ParseThreadContextsFromNoteSegment(
   }
 }
 
+UUID ProcessElfCore::FindBuidIdInCoreMemory(lldb::addr_t address) {
+  UUID invalid_uuid;
+  const uint32_t addr_size = GetAddressByteSize();
+  const size_t elf_header_size = addr_size == 4 ? sizeof(llvm::ELF::Elf32_Ehdr)
+: 
sizeof(llvm::ELF::Elf64_Ehdr);
+
+  // 80 bytes buffer is larger enough for the ELF header or program headers
+  unsigned char buf[80];
+  Status error;
+  size_t byte_read = ReadMemory(address, buf, elf_header_size, error);
+  if (byte_read != elf_header_size || !elf::ELFHeader::MagicBytesMatch(buf))
+return invalid_uuid;
+  assert(sizeof(buf) >= elf_header_size);
+  DataExtractor elf_header_data(buf, elf_header_size, GetByteOrder(),
+addr_size);
+  lldb::offset_t offset = 0;
+
+  elf::ELFHeader elf_header;
+  elf_header.Parse(elf_header_data, );
+
+  const lldb::addr_t ph_addr = address + elf_header.e_phoff;
+
+  for (unsigned int i = 0; i < elf_header.e_phnum; ++i) {
+byte_read = ReadMemory(ph_addr + i * elf_header.e_phentsize, buf,
+   elf_header.e_phentsize, error);
+if (byte_read != elf_header.e_phentsize)
+  break;
+assert(sizeof(buf) >= elf_header.e_phentsize);

labath wrote:

This could be a static_assert, but it might even be better to do declare the 
array as something like `char buf[sizeof(Elf64_Ehdr)] and avoid any doubt about 
it being large enough (then you also wouldn't need the comment above the array 
declaration).

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


[Lldb-commits] [lldb] Read and store gnu build id from loaded core file (PR #92492)

2024-05-24 Thread Pavel Labath via lldb-commits

https://github.com/labath commented:

Very close. Just a couple of details.

BTW, I believe the recommended workflow for working with pull requests is to 
put your new changes as additional commits on top and then squash them all 
together after merging. The GitHub UI just works better that way.

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


[Lldb-commits] [lldb] Read and store gnu build id from loaded core file (PR #92492)

2024-05-24 Thread Pavel Labath via lldb-commits


@@ -983,6 +994,67 @@ llvm::Error 
ProcessElfCore::ParseThreadContextsFromNoteSegment(
   }
 }
 
+UUID ProcessElfCore::FindBuidIdInCoreMemory(lldb::addr_t address) {
+  UUID invalid_uuid;
+  const uint32_t addr_size = GetAddressByteSize();
+  const size_t elf_header_size = addr_size == 4 ? sizeof(llvm::ELF::Elf32_Ehdr)
+: 
sizeof(llvm::ELF::Elf64_Ehdr);
+
+  // 80 bytes buffer is larger enough for the ELF header or program headers
+  unsigned char buf[80];
+  Status error;
+  size_t byte_read = ReadMemory(address, buf, elf_header_size, error);
+  if (byte_read != elf_header_size || !elf::ELFHeader::MagicBytesMatch(buf))
+return invalid_uuid;
+  assert(sizeof(buf) >= elf_header_size);
+  DataExtractor elf_header_data(buf, elf_header_size, GetByteOrder(),
+addr_size);
+  lldb::offset_t offset = 0;
+
+  elf::ELFHeader elf_header;
+  elf_header.Parse(elf_header_data, );
+
+  const lldb::addr_t ph_addr = address + elf_header.e_phoff;
+
+  for (unsigned int i = 0; i < elf_header.e_phnum; ++i) {
+byte_read = ReadMemory(ph_addr + i * elf_header.e_phentsize, buf,
+   elf_header.e_phentsize, error);
+if (byte_read != elf_header.e_phentsize)
+  break;
+assert(sizeof(buf) >= elf_header.e_phentsize);
+DataExtractor program_header_data(buf, elf_header.e_phentsize,
+  GetByteOrder(), addr_size);
+offset = 0;
+elf::ELFProgramHeader program_header;
+program_header.Parse(program_header_data, );
+if (program_header.p_type != llvm::ELF::PT_NOTE)
+  continue;
+
+std::vector note_bytes;
+note_bytes.resize(program_header.p_memsz);
+
+byte_read = ReadMemory(program_header.p_vaddr, note_bytes.data(),
+   program_header.p_memsz, error);
+if (byte_read != program_header.p_memsz)
+  continue;
+assert(sizeof(buf) >= program_header.p_memsz);
+DataExtractor segment_data(note_bytes.data(), note_bytes.size(),
+   GetByteOrder(), addr_size);
+auto notes_or_error = parseSegment(segment_data);
+if (!notes_or_error)
+  return invalid_uuid;
+for (const CoreNote  : *notes_or_error) {
+  if (note.info.n_namesz == 4 &&
+  note.info.n_type == llvm::ELF::NT_GNU_BUILD_ID) {
+if ("GNU" == note.info.n_name)
+  return UUID(llvm::ArrayRef(
+  note.data.GetDataStart(), note.info.n_descsz /*byte size*/));

labath wrote:

In case of a corrupted core file, `note.data` can contain less than `n_descsz` 
bytes, and this will create a invalid ArrayRef (and possibly crash lldb). 
Writing this like `return UUID(note.data.GetData())` will ensure that does not 
happen, although it could return a truncated UUID in that case. If you want to 
check that case explicitly, then I'd recommend something like:
```
if(note.data.ValidOffsetForDataOfSize(0, note.info.n_descsz))
  return UUID(note.data.GetData().take_front(note.info.n_descsz);
```

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


[Lldb-commits] [lldb] Read and store gnu build id from loaded core file (PR #92492)

2024-05-24 Thread Pavel Labath via lldb-commits

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


[Lldb-commits] [lldb] Read and store gnu build id from loaded core file (PR #92492)

2024-05-24 Thread Pavel Labath via lldb-commits


@@ -983,6 +994,67 @@ llvm::Error 
ProcessElfCore::ParseThreadContextsFromNoteSegment(
   }
 }
 
+UUID ProcessElfCore::FindBuidIdInCoreMemory(lldb::addr_t address) {
+  UUID invalid_uuid;
+  const uint32_t addr_size = GetAddressByteSize();
+  const size_t elf_header_size = addr_size == 4 ? sizeof(llvm::ELF::Elf32_Ehdr)
+: 
sizeof(llvm::ELF::Elf64_Ehdr);
+
+  // 80 bytes buffer is larger enough for the ELF header or program headers
+  unsigned char buf[80];
+  Status error;
+  size_t byte_read = ReadMemory(address, buf, elf_header_size, error);
+  if (byte_read != elf_header_size || !elf::ELFHeader::MagicBytesMatch(buf))
+return invalid_uuid;
+  assert(sizeof(buf) >= elf_header_size);
+  DataExtractor elf_header_data(buf, elf_header_size, GetByteOrder(),
+addr_size);
+  lldb::offset_t offset = 0;
+
+  elf::ELFHeader elf_header;
+  elf_header.Parse(elf_header_data, );
+
+  const lldb::addr_t ph_addr = address + elf_header.e_phoff;
+
+  for (unsigned int i = 0; i < elf_header.e_phnum; ++i) {
+byte_read = ReadMemory(ph_addr + i * elf_header.e_phentsize, buf,
+   elf_header.e_phentsize, error);
+if (byte_read != elf_header.e_phentsize)
+  break;
+assert(sizeof(buf) >= elf_header.e_phentsize);
+DataExtractor program_header_data(buf, elf_header.e_phentsize,
+  GetByteOrder(), addr_size);
+offset = 0;
+elf::ELFProgramHeader program_header;
+program_header.Parse(program_header_data, );
+if (program_header.p_type != llvm::ELF::PT_NOTE)
+  continue;
+
+std::vector note_bytes;
+note_bytes.resize(program_header.p_memsz);
+
+byte_read = ReadMemory(program_header.p_vaddr, note_bytes.data(),
+   program_header.p_memsz, error);
+if (byte_read != program_header.p_memsz)
+  continue;
+assert(sizeof(buf) >= program_header.p_memsz);

labath wrote:

This looks like an obsolete assertion as the program headers are read into a 
dynamically sized vector now.

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


[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-24 Thread Chen Zheng via cfe-commits

https://github.com/chenzheng1030 edited 
https://github.com/llvm/llvm-project/pull/93267
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-24 Thread Shengchen Kan via cfe-commits


@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: not llc -mtriple=x86_64 < %s 2>&1 | FileCheck %s --check-prefix=ERR
+; RUN: not llc -mtriple=x86_64 -mattr=+egpr < %s 2>&1 | FileCheck %s 
--check-prefix=ERR
+; RUN: llc -mtriple=x86_64 -mattr=+egpr,+inline-asm-use-gpr32 < %s | FileCheck 
%s

KanRobert wrote:

I find you also extend the `l` constraint. Should we have a test for it? And 
how about `q` https://github.com/llvm/llvm-project/pull/73529 ?

I think it should be extended too.

https://github.com/llvm/llvm-project/pull/92338
_______
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-24 Thread Freddy Ye via cfe-commits


@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: not llc -mtriple=x86_64 %s 2>&1 | FileCheck %s --check-prefix=ERR
+; RUN: llc -mtriple=x86_64 -mattr=+egpr < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64 -mattr=+egpr,+inline-asm-use-gpr32 < %s | FileCheck 
%s
+
+; ERR: error: inline assembly requires more registers than available
+
+define void @constraint_jR_test() nounwind "frame-pointer"="all" {

FreddyLeaf wrote:

"frame-pointer"="all" helps throw the error here.

https://github.com/llvm/llvm-project/pull/92338
_______
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-24 Thread Freddy Ye via cfe-commits


@@ -5418,6 +5418,8 @@ X86:
   operand will get allocated only to RAX -- if two 32-bit operands are needed,
   you're better off splitting it yourself, before passing it to the asm
   statement.
+- ``jR``: An 8, 16, 32, or 64-bit integer EGPR when EGPR feature is on.
+  Otherwise, same as ``R``.

FreddyLeaf wrote:

`r` is same as `R` for X86 IIUC. jR is to follow gcc

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


[clang] [alpha.webkit.UncountedLocalVarsChecker] Detect assignments to uncounted local variable and parameters. (PR #92639)

2024-05-24 Thread Ryosuke Niwa via cfe-commits

https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/92639
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] b80d982 - [alpha.webkit.UncountedLocalVarsChecker] Detect assignments to uncounted local variable and parameters. (#92639)

2024-05-24 Thread via cfe-commits
} // namespace

diff  --git a/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp 
b/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
index 632a82eb0d8d1..25776870dd3ae 100644
--- a/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
+++ b/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
@@ -216,3 +216,76 @@ void foo() {
 }
 
 } // namespace conditional_op
+
+namespace local_assignment_basic {
+
+RefCountable *provide_ref_cntbl();
+
+void foo(RefCountable* a) {
+  RefCountable* b = a;
+  // expected-warning@-1{{Local variable 'b' is uncounted and unsafe 
[alpha.webkit.UncountedLocalVarsChecker]}}
+  if (b->trivial())
+b = provide_ref_cntbl();
+}
+
+void bar(RefCountable* a) {
+  RefCountable* b;
+  // expected-warning@-1{{Local variable 'b' is uncounted and unsafe 
[alpha.webkit.UncountedLocalVarsChecker]}}
+  b = provide_ref_cntbl();
+}
+
+void baz() {
+  RefPtr a = provide_ref_cntbl();
+  {
+RefCountable* b = a.get();
+// expected-warning@-1{{Local variable 'b' is uncounted and unsafe 
[alpha.webkit.UncountedLocalVarsChecker]}}
+b = provide_ref_cntbl();
+  }
+}
+
+} // namespace local_assignment_basic
+
+namespace local_assignment_to_parameter {
+
+RefCountable *provide_ref_cntbl();
+void someFunction();
+
+void foo(RefCountable* a) {
+  a = provide_ref_cntbl();
+  // expected-warning@-1{{Assignment to an uncounted parameter 'a' is unsafe 
[alpha.webkit.UncountedLocalVarsChecker]}}
+  someFunction();
+  a->method();
+}
+
+} // namespace local_assignment_to_parameter
+
+namespace local_assignment_to_static_local {
+
+RefCountable *provide_ref_cntbl();
+void someFunction();
+
+void foo() {
+  static RefCountable* a = nullptr;
+  // expected-warning@-1{{Static local variable 'a' is uncounted and unsafe 
[alpha.webkit.UncountedLocalVarsChecker]}}
+  a = provide_ref_cntbl();
+  someFunction();
+  a->method();
+}
+
+} // namespace local_assignment_to_static_local
+
+namespace local_assignment_to_global {
+
+RefCountable *provide_ref_cntbl();
+void someFunction();
+
+RefCountable* g_a = nullptr;
+// expected-warning@-1{{Global variable 'local_assignment_to_global::g_a' is 
uncounted and unsafe [alpha.webkit.UncountedLocalVarsChecker]}}
+
+void foo() {
+  g_a = provide_ref_cntbl();
+  someFunction();
+  g_a->method();
+}
+
+} // namespace local_assignment_to_global



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


[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-24 Thread Shengchen Kan via cfe-commits


@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: not llc -mtriple=x86_64 < %s 2>&1 | FileCheck %s --check-prefix=ERR
+; RUN: not llc -mtriple=x86_64 -mattr=+egpr < %s 2>&1 | FileCheck %s 
--check-prefix=ERR
+; RUN: llc -mtriple=x86_64 -mattr=+egpr,+inline-asm-use-gpr32 < %s | FileCheck 
%s
+
+; ERR: error: inline assembly requires more registers than available
+
+define void @constraint_r_test() nounwind "frame-pointer"="all" {

KanRobert wrote:

ditto

https://github.com/llvm/llvm-project/pull/92338
___________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


<    3   4   5   6   7   8   9   10   11   12   >