[Lldb-commits] [lldb] 10bd5ad - [lldb][API] Add Find(Ranges)InMemory() to Process SB API (#95007)

2024-06-24 Thread via lldb-commits
S_VALID)
+self.assertState(self.process.GetState(), lldb.eStateStopped, 
PROCESS_STOPPED)
+
+addr_ranges = GetHeapRanges(self)
+error = lldb.SBError()
+matches = self.process.FindRangesInMemory(
+"",
+addr_ranges,
+1,
+10,
+error,
+)
+
+self.assertFailure(error)
+self.assertEqual(matches.GetSize(), 0)
+
+def test_find_ranges_in_memory_invalid_max_matches(self):
+"""Make sure the empty buffer is failing"""
+self.assertTrue(self.process, PROCESS_IS_VALID)
+self.assertState(self.process.GetState(), lldb.eStateStopped, 
PROCESS_STOPPED)
+
+addr_ranges = GetHeapRanges(self)
+error = lldb.SBError()
+matches = self.process.FindRangesInMemory(
+DOUBLE_INSTANCE_PATTERN_HEAP,
+addr_ranges,
+1,
+0,
+error,
+)
+
+self.assertFailure(error)
+self.assertEqual(matches.GetSize(), 0)
+
+def test_find_in_memory_unaligned(self):
+"""Make sure the unaligned match exists in the heap memory and is not 
found with alignment 8"""
+self.assertTrue(self.process, PROCESS_IS_VALID)
+self.assertState(self.process.GetState(), lldb.eStateStopped, 
PROCESS_STOPPED)
+
+addr_ranges = lldb.SBAddressRangeList()
+addr_ranges.Append(GetAlignedRange(self))
+error = lldb.SBError()
+
+matches = self.process.FindRangesInMemory(
+UNALIGNED_INSTANCE_PATTERN_HEAP,
+addr_ranges,
+1,
+10,
+error,
+)
+self.assertSuccess(error)
+self.assertEqual(matches.GetSize(), 1)
+
+matches = self.process.FindRangesInMemory(
+UNALIGNED_INSTANCE_PATTERN_HEAP,
+addr_ranges,
+8,
+10,
+error,
+)
+self.assertSuccess(error)
+self.assertEqual(matches.GetSize(), 0)

diff  --git a/lldb/test/API/python_api/find_in_memory/address_ranges_helper.py 
b/lldb/test/API/python_api/find_in_memory/address_ranges_helper.py
new file mode 100644
index 0..0544100f97b29
--- /dev/null
+++ b/lldb/test/API/python_api/find_in_memory/address_ranges_helper.py
@@ -0,0 +1,73 @@
+import lldb
+
+SINGLE_INSTANCE_PATTERN_STACK = "stack_there_is_only_one_of_me"
+DOUBLE_INSTANCE_PATTERN_HEAP = "heap_there_is_exactly_two_of_me"
+ALIGNED_INSTANCE_PATTERN_HEAP = "i_am_unaligned_string_on_the_heap"
+UNALIGNED_INSTANCE_PATTERN_HEAP = ALIGNED_INSTANCE_PATTERN_HEAP[1:]
+
+
+def GetAlignedRange(test_base):
+frame = test_base.thread.GetSelectedFrame()
+ex = frame.EvaluateExpression("aligned_string_ptr")
+test_base.assertTrue(ex.IsValid())
+return GetRangeFromAddrValue(test_base, ex)
+
+
+def GetStackRange(test_base):
+frame = test_base.thread.GetSelectedFrame()
+ex = frame.EvaluateExpression("stack_pointer")
+test_base.assertTrue(ex.IsValid())
+return GetRangeFromAddrValue(test_base, ex)
+
+
+def GetStackRanges(test_base):
+addr_ranges = lldb.SBAddressRangeList()
+addr_ranges.Append(GetStackRange(test_base))
+return addr_ranges
+
+
+def GetRangeFromAddrValue(test_base, addr):
+region = lldb.SBMemoryRegionInfo()
+test_base.assertTrue(
+test_base.process.GetMemoryRegionInfo(
+addr.GetValueAsUnsigned(), region
+).Success(),
+)
+
+test_base.assertTrue(region.IsReadable())
+test_base.assertFalse(region.IsExecutable())
+
+address_start = lldb.SBAddress(region.GetRegionBase(), test_base.target)
+stack_size = region.GetRegionEnd() - region.GetRegionBase()
+return lldb.SBAddressRange(address_start, stack_size)
+
+
+def IsWithinRange(addr, range, target):
+start_addr = range.GetBaseAddress().GetLoadAddress(target)
+end_addr = start_addr + range.GetByteSize()
+addr = addr.GetValueAsUnsigned()
+return addr >= start_addr and addr < end_addr
+
+
+def GetHeapRanges(test_base):
+frame = test_base.thread.GetSelectedFrame()
+
+ex = frame.EvaluateExpression("heap_pointer1")
+test_base.assertTrue(ex.IsValid())
+range = GetRangeFromAddrValue(test_base, ex)
+addr_ranges = lldb.SBAddressRangeList()
+addr_ranges.Append(range)
+
+ex = frame.EvaluateExpression("heap_pointer2")
+test_base.assertTrue(ex.IsValid())
+if not IsWithinRange(ex, addr_ranges[0], test_base.target):
+addr_ranges.Append(GetRangeFromAddrValue(test_base, ex))
+
+return addr_ranges
+
+
+def GetRanges(test_base):
+ranges = GetHeapRanges(test_base)
+ranges.Append(GetStackRanges(test_base))
+
+return ranges

diff  --git a/lldb/test/API/python_api/find_in_memory/main.cpp 
b/lldb/test/API/python_api/find_in_memory/main.cpp
new file mode 100644
index 0..98d378cb48b84
--- /dev/null
+++ b/lldb/test/API/python_api/find_in_memory/main.cpp
@@ -0,0 +1,27 @@
+#include 
+#include 
+#include 
+
+int main() {
+  // Stack
+  const char *stack_pointer = "stack_there_is_only_one_of_me";
+
+  // Heap
+  const std::string heap_string1("heap_there_is_exactly_two_of_me");
+  const std::string heap_string2("heap_there_is_exactly_two_of_me");
+  const char *heap_pointer1 = heap_string1.data();
+  const char *heap_pointer2 = heap_string2.data();
+
+  // Aligned Heap
+  constexpr char aligned_string[] = "i_am_unaligned_string_on_the_heap";
+  constexpr size_t len = sizeof(aligned_string) + 1;
+  // Allocate memory aligned to 8-byte boundary
+  void *aligned_string_ptr = aligned_alloc(8, len);
+  memcpy(aligned_string_ptr, aligned_string, len);
+
+  (void)stack_pointer;
+  (void)heap_pointer1;
+  (void)heap_pointer2;
+  (void)aligned_string_ptr; // break here
+  return 0;
+}



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


[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread Nikita Popov via cfe-commits

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


[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-24 Thread Ilya Biryukov via cfe-commits

ilya-biryukov wrote:

@hokein could you please split this into two PRs, one with an NFC change and 
another one with adding assignment support?
GitHub is not great at providing the UI to review individual commits and we 
won't be able to merge as 2 separate commits with the green button (which seems 
like a desirable end state for the readability of the commit history).

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


[jenkinsci/naginator-plugin] 1dcf1b: Bump io.jenkins.tools.bom:bom-2.426.x

2024-06-24 Thread 'dependabot[bot]' via Jenkins Commits
  Branch: 
refs/heads/dependabot/maven/io.jenkins.tools.bom-bom-2.426.x-3143.v347db_7c6db_6e
  Home:   https://github.com/jenkinsci/naginator-plugin
  Commit: 1dcf1b6bc4b5b081bf602e37997594a260272bb7
  
https://github.com/jenkinsci/naginator-plugin/commit/1dcf1b6bc4b5b081bf602e37997594a260272bb7
  Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Bump io.jenkins.tools.bom:bom-2.426.x

Bumps [io.jenkins.tools.bom:bom-2.426.x](https://github.com/jenkinsci/bom) from 
3135.v6d6c1f6b_3572 to 3143.v347db_7c6db_6e.
- [Release notes](https://github.com/jenkinsci/bom/releases)
- [Commits](https://github.com/jenkinsci/bom/commits)

---
updated-dependencies:
- dependency-name: io.jenkins.tools.bom:bom-2.426.x
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] 



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/naginator-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/naginator-plugin/push/refs/heads/dependabot/maven/io.jenkins.tools.bom-bom-2.426.x-3143.v347db_7c6db_6e/00-1dcf1b%40github.com.


[clang] [Serialization] Storing DeclID separately (PR #95897)

2024-06-24 Thread Ilya Biryukov via cfe-commits

ilya-biryukov wrote:

Sorry for not getting to it today, I'll send a review tomorrow.

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


[clang] [Serialization] Don't read all declaration id eagerly when merge the tables (PR #95506)

2024-06-24 Thread Ilya Biryukov via cfe-commits

ilya-biryukov wrote:

I feel the increased complexity does not seem like a good trade-off if it does 
not significantly improve performance.
However I don't feel too strongly about it, so I suggest you get a second 
opinion if you feel strongly that we should land this.

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


[jenkinsci/pipeline-utility-steps-plugin] 747304: Bump org.jenkins-ci.plugins:plugin from 4.77 to 4.82

2024-06-24 Thread 'Robert Sandell' via Jenkins Commits
  Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/pipeline-utility-steps-plugin
  Commit: 7473049ef1c0112316d66132fb61d2867e0325db
  
https://github.com/jenkinsci/pipeline-utility-steps-plugin/commit/7473049ef1c0112316d66132fb61d2867e0325db
  Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  Date:   2024-05-06 (Mon, 06 May 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Bump org.jenkins-ci.plugins:plugin from 4.77 to 4.82

Bumps [org.jenkins-ci.plugins:plugin](https://github.com/jenkinsci/plugin-pom) 
from 4.77 to 4.82.
- [Release notes](https://github.com/jenkinsci/plugin-pom/releases)
- [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md)
- 
[Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.77...plugin-4.82)

---
updated-dependencies:
- dependency-name: org.jenkins-ci.plugins:plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] 


  Commit: bd32f56f1a753df85f9ed6b46cf8ecff9a14c16c
  
https://github.com/jenkinsci/pipeline-utility-steps-plugin/commit/bd32f56f1a753df85f9ed6b46cf8ecff9a14c16c
  Author: Robert Sandell 
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Merge pull request #258 from 
jenkinsci/dependabot/maven/org.jenkins-ci.plugins-plugin-4.82

Bump org.jenkins-ci.plugins:plugin from 4.77 to 4.82


Compare: 
https://github.com/jenkinsci/pipeline-utility-steps-plugin/compare/264ed0254607...bd32f56f1a75

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/pipeline-utility-steps-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/pipeline-utility-steps-plugin/push/refs/heads/master/264ed0-bd32f5%40github.com.


[clang] [clang][analyzer] Improve PointerSubChecker (PR #96501)

2024-06-24 Thread via cfe-commits

llvmbot wrote:



@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Balázs Kéri (balazske)


Changes

The checker could report false positives if pointer arithmetic was done on 
pointers to non-array data before pointer subtraction. Another problem is fixed 
that could cause false positive if members of the same structure but in 
different memory objects are subtracted.

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


2 Files Affected:

- (modified) clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp (+19-3) 
- (modified) clang/test/Analysis/pointer-sub.c (+20-9) 


``diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp 
b/clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp
index eea93a41f1384..63ed4df67d6d5 100644
--- a/clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp
@@ -49,12 +49,28 @@ class PointerSubChecker
 };
 }
 
+static bool isArrayVar(const MemRegion *R) {
+  while (R) {
+if (isa(R))
+  return true;
+if (const auto *ER = dyn_cast(R))
+  R = ER->getSuperRegion();
+else
+  return false;
+  }
+  return false;
+}
+
 bool PointerSubChecker::checkArrayBounds(CheckerContext , const Expr *E,
  const ElementRegion *ElemReg,
  const MemRegion *Reg) const {
   if (!ElemReg)
 return true;
 
+  const MemRegion *SuperReg = ElemReg->getSuperRegion();
+  if (!isArrayVar(SuperReg))
+return true;
+
   auto ReportBug = [&](const llvm::StringLiteral ) {
 if (ExplodedNode *N = C.generateNonFatalErrorNode()) {
   auto R = std::make_unique(BT, Msg, N);
@@ -64,7 +80,6 @@ bool PointerSubChecker::checkArrayBounds(CheckerContext , 
const Expr *E,
   };
 
   ProgramStateRef State = C.getState();
-  const MemRegion *SuperReg = ElemReg->getSuperRegion();
   SValBuilder  = C.getSValBuilder();
 
   if (SuperReg == Reg) {
@@ -121,8 +136,9 @@ void PointerSubChecker::checkPreStmt(const BinaryOperator 
*B,
   if (LR == RR)
 return;
 
-  // No warning if one operand is unknown.
-  if (isa(LR) || isa(RR))
+  // No warning if one operand is unknown or resides in a region that could be
+  // equal to the other.
+  if (LR->getSymbolicBase() || RR->getSymbolicBase())
 return;
 
   const auto *ElemLR = dyn_cast(LR);
diff --git a/clang/test/Analysis/pointer-sub.c 
b/clang/test/Analysis/pointer-sub.c
index 88e6dec2d172f..404b8530b89c0 100644
--- a/clang/test/Analysis/pointer-sub.c
+++ b/clang/test/Analysis/pointer-sub.c
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.PointerSub -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core.PointerSub 
-analyzer-output=text-minimal -verify %s
 
 void f1(void) {
   int x, y, z[10];
@@ -73,15 +73,15 @@ void f4(void) {
   d = a[2] - a[1]; // expected-warning{{Subtraction of two pointers that}}
 }
 
-typedef struct {
+struct S {
   int a;
   int b;
   int c[10]; // expected-note2{{Array at the right-hand side of subtraction}}
   int d[10]; // expected-note2{{Array at the left-hand side of subtraction}}
-} S;
+};
 
 void f5(void) {
-  S s;
+  struct S s;
   int y;
   int d;
 
@@ -92,18 +92,18 @@ void f5(void) {
   d = [3] - [2]; // expected-warning{{Subtraction of two pointers 
that}}
   d = s.d - s.c; // expected-warning{{Subtraction of two pointers that}}
 
-  S sa[10];
+  struct S sa[10];
   d = [2] - [1];
   d = [2].a - [1].b; // expected-warning{{Subtraction of two pointers 
that}}
 }
 
 void f6(void) {
-  long long l;
+  long long l = 2;
   char *a1 = (char *)
   int d = a1[3] - l;
 
-  long long la1[3]; // expected-note{{Array at the right-hand side of 
subtraction}}
-  long long la2[3]; // expected-note{{Array at the left-hand side of 
subtraction}}
+  long long la1[3] = {1}; // expected-note{{Array at the right-hand side of 
subtraction}}
+  long long la2[3] = {1}; // expected-note{{Array at the left-hand side of 
subtraction}}
   char *pla1 = (char *)la1;
   char *pla2 = (char *)la2;
   d = pla1[1] - pla1[0];
@@ -117,6 +117,17 @@ void f7(int *p) {
 }
 
 void f8(int n) {
-  int a[10];
+  int a[10] = {1};
   int d = a[n] - a[0];
 }
+
+int f9(const char *p1) {
+  const char *p2 = p1;
+  --p1;
+  ++p2;
+  return p1 - p2; // no-warning
+}
+
+int f10(struct S *p1, struct S *p2) {
+  return >c[5] - >c[5]; // no-warning
+}

``




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


[jenkinsci/pipeline-utility-steps-plugin]

2024-06-24 Thread 'dependabot[bot]' via Jenkins Commits
  Branch: 
refs/heads/dependabot/maven/io.jenkins.tools.incrementals-git-changelist-maven-extension-1.8
  Home:   https://github.com/jenkinsci/pipeline-utility-steps-plugin

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/pipeline-utility-steps-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/pipeline-utility-steps-plugin/push/refs/heads/dependabot/maven/io.jenkins.tools.incrementals-git-changelist-maven-extension-1.8/f81341-00%40github.com.


[jenkinsci/pipeline-utility-steps-plugin] f81341: Bump io.jenkins.tools.incrementals:git-changelist-...

2024-06-24 Thread 'Robert Sandell' via Jenkins Commits
  Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/pipeline-utility-steps-plugin
  Commit: f813416ce33373ab0c9c4a0cc1072f5253b2d23c
  
https://github.com/jenkinsci/pipeline-utility-steps-plugin/commit/f813416ce33373ab0c9c4a0cc1072f5253b2d23c
  Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  Date:   2024-04-15 (Mon, 15 Apr 2024)

  Changed paths:
M .mvn/extensions.xml

  Log Message:
  ---
  Bump io.jenkins.tools.incrementals:git-changelist-maven-extension

Bumps 
[io.jenkins.tools.incrementals:git-changelist-maven-extension](https://github.com/jenkinsci/incrementals-tools)
 from 1.7 to 1.8.
- [Release notes](https://github.com/jenkinsci/incrementals-tools/releases)
- 
[Commits](https://github.com/jenkinsci/incrementals-tools/compare/parent-1.7...parent-1.8)

---
updated-dependencies:
- dependency-name: io.jenkins.tools.incrementals:git-changelist-maven-extension
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] 


  Commit: 264ed025460794f09f7945a4f07241b100befbc4
  
https://github.com/jenkinsci/pipeline-utility-steps-plugin/commit/264ed025460794f09f7945a4f07241b100befbc4
  Author: Robert Sandell 
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
M .mvn/extensions.xml

  Log Message:
  ---
  Merge pull request #253 from 
jenkinsci/dependabot/maven/io.jenkins.tools.incrementals-git-changelist-maven-extension-1.8

Bump io.jenkins.tools.incrementals:git-changelist-maven-extension from 1.7 to 
1.8


Compare: 
https://github.com/jenkinsci/pipeline-utility-steps-plugin/compare/12a1522ef5be...264ed0254607

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/pipeline-utility-steps-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/pipeline-utility-steps-plugin/push/refs/heads/master/12a152-264ed0%40github.com.


[libunwind] [llvm] [runtimes] remove workaround for old CMake when setting `--unwindlib=none` (PR #93429)

2024-06-24 Thread antoine moynault via cfe-commits

antmox wrote:

I may be missing something, but it looks like the armv7m-picolibc-no-exceptions 
issue is still related to https://gitlab.kitware.com/cmake/cmake/-/issues/23454

I notice that once the `--unwindlib=none` flag is added to 
`CMAKE_REQUIRED_LINK_OPTIONS`, it is also added to ar commands during the next 
cmake tests (starting with `CXX_SUPPORTS_NOSTDLIBXX_FLAG`).
Failing these tests will result in `fno-exceptions` not being used later

This is probably due to the fact that for Armv7M-picolibc, 
`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to `STATIC_LIBRARY` here: 
https://github.com/llvm/llvm-project/blob/main/libcxx/cmake/caches/Armv7M-picolibc.cmake#L7C35-L7C49


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


[clang] [clang][analyzer] Improve PointerSubChecker (PR #96501)

2024-06-24 Thread Balázs Kéri via cfe-commits

https://github.com/balazske created 
https://github.com/llvm/llvm-project/pull/96501

The checker could report false positives if pointer arithmetic was done on 
pointers to non-array data before pointer subtraction. Another problem is fixed 
that could cause false positive if members of the same structure but in 
different memory objects are subtracted.

From b431151f83fa2980e4a132191ccf5713ab69806b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= 
Date: Mon, 24 Jun 2024 16:48:54 +0200
Subject: [PATCH] [clang][analyzer] Improve PointerSubChecker

The checker could report false positives if pointer arithmetic was
done on pointers to non-array data before pointer subtraction.
Another problem is fixed that could cause false positive if members
of the same structure but in different memory objects are subtracted.
---
 .../Checkers/PointerSubChecker.cpp| 22 --
 clang/test/Analysis/pointer-sub.c | 29 +--
 2 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp 
b/clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp
index eea93a41f1384..63ed4df67d6d5 100644
--- a/clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp
@@ -49,12 +49,28 @@ class PointerSubChecker
 };
 }
 
+static bool isArrayVar(const MemRegion *R) {
+  while (R) {
+if (isa(R))
+  return true;
+if (const auto *ER = dyn_cast(R))
+  R = ER->getSuperRegion();
+else
+  return false;
+  }
+  return false;
+}
+
 bool PointerSubChecker::checkArrayBounds(CheckerContext , const Expr *E,
  const ElementRegion *ElemReg,
  const MemRegion *Reg) const {
   if (!ElemReg)
 return true;
 
+  const MemRegion *SuperReg = ElemReg->getSuperRegion();
+  if (!isArrayVar(SuperReg))
+return true;
+
   auto ReportBug = [&](const llvm::StringLiteral ) {
 if (ExplodedNode *N = C.generateNonFatalErrorNode()) {
   auto R = std::make_unique(BT, Msg, N);
@@ -64,7 +80,6 @@ bool PointerSubChecker::checkArrayBounds(CheckerContext , 
const Expr *E,
   };
 
   ProgramStateRef State = C.getState();
-  const MemRegion *SuperReg = ElemReg->getSuperRegion();
   SValBuilder  = C.getSValBuilder();
 
   if (SuperReg == Reg) {
@@ -121,8 +136,9 @@ void PointerSubChecker::checkPreStmt(const BinaryOperator 
*B,
   if (LR == RR)
 return;
 
-  // No warning if one operand is unknown.
-  if (isa(LR) || isa(RR))
+  // No warning if one operand is unknown or resides in a region that could be
+  // equal to the other.
+  if (LR->getSymbolicBase() || RR->getSymbolicBase())
 return;
 
   const auto *ElemLR = dyn_cast(LR);
diff --git a/clang/test/Analysis/pointer-sub.c 
b/clang/test/Analysis/pointer-sub.c
index 88e6dec2d172f..404b8530b89c0 100644
--- a/clang/test/Analysis/pointer-sub.c
+++ b/clang/test/Analysis/pointer-sub.c
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.PointerSub -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core.PointerSub 
-analyzer-output=text-minimal -verify %s
 
 void f1(void) {
   int x, y, z[10];
@@ -73,15 +73,15 @@ void f4(void) {
   d = a[2] - a[1]; // expected-warning{{Subtraction of two pointers that}}
 }
 
-typedef struct {
+struct S {
   int a;
   int b;
   int c[10]; // expected-note2{{Array at the right-hand side of subtraction}}
   int d[10]; // expected-note2{{Array at the left-hand side of subtraction}}
-} S;
+};
 
 void f5(void) {
-  S s;
+  struct S s;
   int y;
   int d;
 
@@ -92,18 +92,18 @@ void f5(void) {
   d = [3] - [2]; // expected-warning{{Subtraction of two pointers 
that}}
   d = s.d - s.c; // expected-warning{{Subtraction of two pointers that}}
 
-  S sa[10];
+  struct S sa[10];
   d = [2] - [1];
   d = [2].a - [1].b; // expected-warning{{Subtraction of two pointers 
that}}
 }
 
 void f6(void) {
-  long long l;
+  long long l = 2;
   char *a1 = (char *)
   int d = a1[3] - l;
 
-  long long la1[3]; // expected-note{{Array at the right-hand side of 
subtraction}}
-  long long la2[3]; // expected-note{{Array at the left-hand side of 
subtraction}}
+  long long la1[3] = {1}; // expected-note{{Array at the right-hand side of 
subtraction}}
+  long long la2[3] = {1}; // expected-note{{Array at the left-hand side of 
subtraction}}
   char *pla1 = (char *)la1;
   char *pla2 = (char *)la2;
   d = pla1[1] - pla1[0];
@@ -117,6 +117,17 @@ void f7(int *p) {
 }
 
 void f8(int n) {
-  int a[10];
+  int a[10] = {1};
   int d = a[n] - a[0];
 }
+
+int f9(const char *p1) {
+  const char *p2 = p1;
+  --p1;
+  ++p2;
+  return p1 - p2; // no-warning
+}
+
+int f10(struct S *p1, struct S *p2) {
+  return >c[5] - >c[5]; // no-warning
+}

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Jon Roelofs via cfe-commits


@@ -1130,7 +1130,8 @@ INSTANTIATE_TEST_SUITE_P(
  AArch64::AEK_MTE, AArch64::AEK_SSBS,
  AArch64::AEK_FP16,AArch64::AEK_FP16FML,
  AArch64::AEK_SB,  AArch64::AEK_JSCVT,
- AArch64::AEK_FCMA,AArch64::AEK_PERFMON}),
+ AArch64::AEK_FCMA,AArch64::AEK_PERFMON,
+ AArch64::AEK_ETE, AArch64::AEK_AM}),

jroelofs wrote:

OMG that would be amazing. Dealing with downstream diff there is really 
painful. It would be fantastic to have each one on their own line so that any 
downstream changes are purely `+ lines`.

If you do that, please make sure it's in its own commit, and as NFC as you can 
make it, so it's much easier to "audit" when merging.

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


[jenkinsci/pipeline-utility-steps-plugin] ebd323: Bump org.apache.commons:commons-configuration2 fro...

2024-06-24 Thread 'dependabot[bot]' via Jenkins Commits
  Branch: 
refs/heads/dependabot/maven/org.apache.commons-commons-configuration2-2.10.1
  Home:   https://github.com/jenkinsci/pipeline-utility-steps-plugin
  Commit: ebd323d87d27c2d0793740cc21227db778788ca3
  
https://github.com/jenkinsci/pipeline-utility-steps-plugin/commit/ebd323d87d27c2d0793740cc21227db778788ca3
  Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Bump org.apache.commons:commons-configuration2 from 2.9.0 to 2.10.1

Bumps org.apache.commons:commons-configuration2 from 2.9.0 to 2.10.1.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-configuration2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] 



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/pipeline-utility-steps-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/pipeline-utility-steps-plugin/push/refs/heads/dependabot/maven/org.apache.commons-commons-configuration2-2.10.1/431ad6-ebd323%40github.com.


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Lucas Duarte Prates via cfe-commits


@@ -161,6 +162,39 @@ static int PrintSupportedExtensions(std::string TargetStr) 
{
   return 0;
 }
 
+static int PrintEnabledExtensions(const TargetOptions& TargetOpts) {
+  std::string Error;
+  const llvm::Target *TheTarget =
+  llvm::TargetRegistry::lookupTarget(TargetOpts.Triple, Error);
+  if (!TheTarget) {
+llvm::errs() << Error;
+return 1;
+  }
+
+  llvm::TargetOptions BackendOptions;

pratlucas wrote:

`TargetOpts` captures the frontend options as a `clang::TargetOptions` 
instance. The target machine takes an instance of `llvm::TargetOptions` 
instead. It's confusing that the same class name was chosen for both.

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


[clang] [Doc] Update documentation for no-transitive-change (PR #96453)

2024-06-24 Thread Ilya Biryukov via cfe-commits

ilya-biryukov wrote:

I really like the idea of documenting this, hopefully this create some fruitful 
discussions with the build system developers and other compiler users.

After trying to put myself into the shoes of the compiler users reading this, I 
can't help but think that the "no transitive changes"  is slightly confusing 
and hard to grasp. The example does help quite a bit, but I also feel there 
should be a way to document this in shorter form. (E.g. we can double-down on 
the "this is a build optimization" angle and being explicit that we want people 
to try this and let them know how to report bugs about it?)

I wanted to take a little bit of time to think how to do it before providing 
concrete suggestions, but still wanted to mention this.

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


[jenkinsci/pipeline-utility-steps-plugin] 47713f: Add dependency on Commons Compress library plugin

2024-06-24 Thread 'Robert Sandell' via Jenkins Commits
  Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/pipeline-utility-steps-plugin
  Commit: 47713f1ffde9bb17872c7b8cf096a708b6976116
  
https://github.com/jenkinsci/pipeline-utility-steps-plugin/commit/47713f1ffde9bb17872c7b8cf096a708b6976116
  Author: Basil Crow 
  Date:   2024-05-29 (Wed, 29 May 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Add dependency on Commons Compress library plugin


  Commit: 73c3b8f5fb57690574d90affaf39cedcd67c20cd
  
https://github.com/jenkinsci/pipeline-utility-steps-plugin/commit/73c3b8f5fb57690574d90affaf39cedcd67c20cd
  Author: Robert Sandell 
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Merge pull request #259 from basil/commons-compress

Add dependency on Commons Compress library plugin


Compare: 
https://github.com/jenkinsci/pipeline-utility-steps-plugin/compare/ef147c4c1cd7...73c3b8f5fb57

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/pipeline-utility-steps-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/pipeline-utility-steps-plugin/push/refs/heads/master/ef147c-73c3b8%40github.com.


[clang] b012ab0 - [C23] Claim conformance to WG14 N3033

2024-06-24 Thread Aaron Ballman via cfe-commits

Author: Aaron Ballman
Date: 2024-06-24T10:52:17-04:00
New Revision: b012ab01cb39e440a38dad5d7dd71b419480264b

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

LOG: [C23] Claim conformance to WG14 N3033

Clang has implemented __VA_OPT__ since Clang 12.

Added: 
clang/test/C/C2x/n3033.c
clang/test/C/C2x/n3033_2.c

Modified: 
clang/www/c_status.html

Removed: 




diff  --git a/clang/test/C/C2x/n3033.c b/clang/test/C/C2x/n3033.c
new file mode 100644
index 0..bf249a37facb3
--- /dev/null
+++ b/clang/test/C/C2x/n3033.c
@@ -0,0 +1,50 @@
+// RUN: %clang_cc1 -std=c23 -E %s | FileCheck %s
+
+/* WG14 N3033: Clang 12
+ * Comma ommission and deletion (__VA_OPT__)
+ */
+
+#define F(...)   f(0 __VA_OPT__(,) __VA_ARGS__)
+#define G(X, ...)f(0, X __VA_OPT__(,) __VA_ARGS__)
+#define SDEF(sname, ...) S sname __VA_OPT__(= { __VA_ARGS__ })
+#define EMP
+
+F(a, b, c)// replaced by f(0, a, b, c)
+// CHECK: f(0 , a, b, c)
+F()   // replaced by f(0)
+// CHECK: f(0 )
+F(EMP)// replaced by f(0)
+// CHECK: f(0 )
+
+G(a, b, c)// replaced by f(0, a, b, c)
+// CHECK: f(0, a , b, c)
+G(a, )// replaced by f(0, a)
+// CHECK: f(0, a )
+G(a)  // replaced by f(0, a)
+// CHECK: f(0, a )
+
+SDEF(foo);// replaced by S foo;
+// CHECK: S foo ;
+SDEF(bar, 1, 2);  // replaced by S bar = { 1, 2 };
+// CHECK: S bar = { 1, 2 };
+
+//#define H1(X, ...)   X __VA_OPT__(##) __VA_ARGS__  // error: ## may not 
appear at the beginning of a replacement list (6.10.3.3)
+
+#define H2(X, Y, ...)__VA_OPT__(X ## Y,) __VA_ARGS__
+H2(a, b, c, d)// replaced by ab, c, d
+// CHECK: ab, c, d
+
+#define H3(X, ...)   #__VA_OPT__(X##X X##X)
+H3(, 0)   // replaced by ""
+// CHECK: ""
+
+#define H4(X, ...)   __VA_OPT__(a X ## X) ## b
+H4(, 1)   // replaced by a b
+// CHECK: a b
+
+#define H5A(...) __VA_OPT__()/**/__VA_OPT__()
+#define H5B(X)   a ## X ## b
+#define H5C(X)   H5B(X)
+H5C(H5A())// replaced by ab
+// CHECK: ab
+

diff  --git a/clang/test/C/C2x/n3033_2.c b/clang/test/C/C2x/n3033_2.c
new file mode 100644
index 0..5da206658690c
--- /dev/null
+++ b/clang/test/C/C2x/n3033_2.c
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c23 -verify %s
+
+#define H1(X, ...)   X __VA_OPT__(##) __VA_ARGS__ // expected-error {{'##' 
cannot appear at start of __VA_OPT__ argument}}
+

diff  --git a/clang/www/c_status.html b/clang/www/c_status.html
index 6b375a6b7999d..f6a92d94874a5 100644
--- a/clang/www/c_status.html
+++ b/clang/www/c_status.html
@@ -1184,7 +1184,7 @@ C23 implementation status
 
   Comma ommission and deletion (__VA_OPT__)
   https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3033.htm;>N3033
-  Unknown
+  Clang 12
 
 
   Underspecified object definitions



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


[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread via cfe-commits
/ Create a new base.
   Value *BaseIndex = ConstantInt::get(PtrIdxTy, BaseOffset);
   NewBaseGEP = OldBase;
diff --git a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp 
b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
index 11f123aa5bed8..2c05f01726770 100644
--- a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
+++ b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
@@ -212,7 +212,7 @@ static void expandFPToI(Instruction *FPToI) {
   Builder.CreateBr(End);
 
   // cleanup:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(FPToI->getType(), 4);
 
   Retval0->addIncoming(Cond8, IfThen5);
@@ -560,7 +560,7 @@ static void expandIToFP(Instruction *IToFP) {
   Builder.CreateBr(End);
 
   // return:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(IToFP->getType(), 2);
   Retval0->addIncoming(A4, IfEnd26);
   Retval0->addIncoming(ConstantFP::getZero(IToFP->getType(), false), Entry);
diff --git a/llvm/lib/CodeGen/ExpandMemCmp.cpp 
b/llvm/lib/CodeGen/ExpandMemCmp.cpp
index bb84813569f4d..3e59834e4f1c8 100644
--- a/llvm/lib/CodeGen/ExpandMemCmp.cpp
+++ b/llvm/lib/CodeGen/ExpandMemCmp.cpp
@@ -574,7 +574,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
   // need to be calculated and can simply return 1.
   if (IsUsedForZeroCmp) {
 BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+Builder.SetInsertPoint(InsertPt);
 Value *Res = ConstantInt::get(Type::getInt32Ty(CI->getContext()), 1);
 PhiRes->addIncoming(Res, ResBlock.BB);
 BranchInst *NewBr = BranchInst::Create(EndBlock);
@@ -584,7 +584,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
 return;
   }
   BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-  Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+  Builder.SetInsertPoint(InsertPt);
 
   Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_ULT, ResBlock.PhiSrc1,
   ResBlock.PhiSrc2);
@@ -611,7 +611,7 @@ void MemCmpExpansion::setupResultBlockPHINodes() {
 }
 
 void MemCmpExpansion::setupEndBlockPHINodes() {
-  Builder.SetInsertPoint(EndBlock, EndBlock->begin());
+  Builder.SetInsertPoint(EndBlock->begin());
   PhiRes = Builder.CreatePHI(Type::getInt32Ty(CI->getContext()), 2, "phi.res");
 }
 
diff --git a/llvm/lib/CodeGen/ExpandVectorPredication.cpp 
b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
index dc35f33a3a059..a63a8681f5140 100644
--- a/llvm/lib/CodeGen/ExpandVectorPredication.cpp
+++ b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
@@ -667,7 +667,7 @@ void CachingVPExpander::discardEVLParameter(VPIntrinsic 
) {
 auto *M = VPI.getModule();
 Function *VScaleFunc =
 Intrinsic::getDeclaration(M, Intrinsic::vscale, Int32Ty);
-IRBuilder<> Builder(VPI.getParent(), VPI.getIterator());
+IRBuilder<> Builder(VPI.getIterator());
 Value *FactorConst = Builder.getInt32(StaticElemCount.getKnownMinVa...
[truncated]

``




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


[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread via cfe-commits
sertPt);
   // Create a new base.
   Value *BaseIndex = ConstantInt::get(PtrIdxTy, BaseOffset);
   NewBaseGEP = OldBase;
diff --git a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp 
b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
index 11f123aa5bed8..2c05f01726770 100644
--- a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
+++ b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
@@ -212,7 +212,7 @@ static void expandFPToI(Instruction *FPToI) {
   Builder.CreateBr(End);
 
   // cleanup:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(FPToI->getType(), 4);
 
   Retval0->addIncoming(Cond8, IfThen5);
@@ -560,7 +560,7 @@ static void expandIToFP(Instruction *IToFP) {
   Builder.CreateBr(End);
 
   // return:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(IToFP->getType(), 2);
   Retval0->addIncoming(A4, IfEnd26);
   Retval0->addIncoming(ConstantFP::getZero(IToFP->getType(), false), Entry);
diff --git a/llvm/lib/CodeGen/ExpandMemCmp.cpp 
b/llvm/lib/CodeGen/ExpandMemCmp.cpp
index bb84813569f4d..3e59834e4f1c8 100644
--- a/llvm/lib/CodeGen/ExpandMemCmp.cpp
+++ b/llvm/lib/CodeGen/ExpandMemCmp.cpp
@@ -574,7 +574,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
   // need to be calculated and can simply return 1.
   if (IsUsedForZeroCmp) {
 BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+Builder.SetInsertPoint(InsertPt);
 Value *Res = ConstantInt::get(Type::getInt32Ty(CI->getContext()), 1);
 PhiRes->addIncoming(Res, ResBlock.BB);
 BranchInst *NewBr = BranchInst::Create(EndBlock);
@@ -584,7 +584,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
 return;
   }
   BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-  Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+  Builder.SetInsertPoint(InsertPt);
 
   Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_ULT, ResBlock.PhiSrc1,
   ResBlock.PhiSrc2);
@@ -611,7 +611,7 @@ void MemCmpExpansion::setupResultBlockPHINodes() {
 }
 
 void MemCmpExpansion::setupEndBlockPHINodes() {
-  Builder.SetInsertPoint(EndBlock, EndBlock->begin());
+  Builder.SetInsertPoint(EndBlock->begin());
   PhiRes = Builder.CreatePHI(Type::getInt32Ty(CI->getContext()), 2, "phi.res");
 }
 
diff --git a/llvm/lib/CodeGen/ExpandVectorPredication.cpp 
b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
index dc35f33a3a059..a63a8681f5140 100644
--- a/llvm/lib/CodeGen/ExpandVectorPredication.cpp
+++ b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
@@ -667,7 +667,7 @@ void CachingVPExpander::discardEVLParameter(VPIntrinsic 
) {
 auto *M = VPI.getModule();
 Function *VScaleFunc =
 Intrinsic::getDeclaration(M, Intrinsic::vscale, Int32Ty);
-IRBuilder<> Builder(VPI.getParent(), VPI.getIterator());
+IRBuilder<> Builder(VPI.getIterator());
 Value *FactorConst = Builder.getInt32(StaticElemCount.getKnownMinVa...
[truncated]

``




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


[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread via cfe-commits
  // Create a new base.
   Value *BaseIndex = ConstantInt::get(PtrIdxTy, BaseOffset);
   NewBaseGEP = OldBase;
diff --git a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp 
b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
index 11f123aa5bed8..2c05f01726770 100644
--- a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
+++ b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
@@ -212,7 +212,7 @@ static void expandFPToI(Instruction *FPToI) {
   Builder.CreateBr(End);
 
   // cleanup:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(FPToI->getType(), 4);
 
   Retval0->addIncoming(Cond8, IfThen5);
@@ -560,7 +560,7 @@ static void expandIToFP(Instruction *IToFP) {
   Builder.CreateBr(End);
 
   // return:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(IToFP->getType(), 2);
   Retval0->addIncoming(A4, IfEnd26);
   Retval0->addIncoming(ConstantFP::getZero(IToFP->getType(), false), Entry);
diff --git a/llvm/lib/CodeGen/ExpandMemCmp.cpp 
b/llvm/lib/CodeGen/ExpandMemCmp.cpp
index bb84813569f4d..3e59834e4f1c8 100644
--- a/llvm/lib/CodeGen/ExpandMemCmp.cpp
+++ b/llvm/lib/CodeGen/ExpandMemCmp.cpp
@@ -574,7 +574,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
   // need to be calculated and can simply return 1.
   if (IsUsedForZeroCmp) {
 BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+Builder.SetInsertPoint(InsertPt);
 Value *Res = ConstantInt::get(Type::getInt32Ty(CI->getContext()), 1);
 PhiRes->addIncoming(Res, ResBlock.BB);
 BranchInst *NewBr = BranchInst::Create(EndBlock);
@@ -584,7 +584,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
 return;
   }
   BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-  Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+  Builder.SetInsertPoint(InsertPt);
 
   Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_ULT, ResBlock.PhiSrc1,
   ResBlock.PhiSrc2);
@@ -611,7 +611,7 @@ void MemCmpExpansion::setupResultBlockPHINodes() {
 }
 
 void MemCmpExpansion::setupEndBlockPHINodes() {
-  Builder.SetInsertPoint(EndBlock, EndBlock->begin());
+  Builder.SetInsertPoint(EndBlock->begin());
   PhiRes = Builder.CreatePHI(Type::getInt32Ty(CI->getContext()), 2, "phi.res");
 }
 
diff --git a/llvm/lib/CodeGen/ExpandVectorPredication.cpp 
b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
index dc35f33a3a059..a63a8681f5140 100644
--- a/llvm/lib/CodeGen/ExpandVectorPredication.cpp
+++ b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
@@ -667,7 +667,7 @@ void CachingVPExpander::discardEVLParameter(VPIntrinsic 
) {
 auto *M = VPI.getModule();
 Function *VScaleFunc =
 Intrinsic::getDeclaration(M, Intrinsic::vscale, Int32Ty);
-IRBuilder<> Builder(VPI.getParent(), VPI.getIterator());
+IRBuilder<> Builder(VPI.getIterator());
 Value *FactorConst = Builder.getInt32(StaticElemCount.getKnownMinVa...
[truncated]

``




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


[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread via cfe-commits
rtBB, NewBaseInsertPt);
+  IRBuilder<> NewBaseBuilder(NewBaseInsertPt);
   // Create a new base.
   Value *BaseIndex = ConstantInt::get(PtrIdxTy, BaseOffset);
   NewBaseGEP = OldBase;
diff --git a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp 
b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
index 11f123aa5bed8..2c05f01726770 100644
--- a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
+++ b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
@@ -212,7 +212,7 @@ static void expandFPToI(Instruction *FPToI) {
   Builder.CreateBr(End);
 
   // cleanup:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(FPToI->getType(), 4);
 
   Retval0->addIncoming(Cond8, IfThen5);
@@ -560,7 +560,7 @@ static void expandIToFP(Instruction *IToFP) {
   Builder.CreateBr(End);
 
   // return:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(IToFP->getType(), 2);
   Retval0->addIncoming(A4, IfEnd26);
   Retval0->addIncoming(ConstantFP::getZero(IToFP->getType(), false), Entry);
diff --git a/llvm/lib/CodeGen/ExpandMemCmp.cpp 
b/llvm/lib/CodeGen/ExpandMemCmp.cpp
index bb84813569f4d..3e59834e4f1c8 100644
--- a/llvm/lib/CodeGen/ExpandMemCmp.cpp
+++ b/llvm/lib/CodeGen/ExpandMemCmp.cpp
@@ -574,7 +574,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
   // need to be calculated and can simply return 1.
   if (IsUsedForZeroCmp) {
 BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+Builder.SetInsertPoint(InsertPt);
 Value *Res = ConstantInt::get(Type::getInt32Ty(CI->getContext()), 1);
 PhiRes->addIncoming(Res, ResBlock.BB);
 BranchInst *NewBr = BranchInst::Create(EndBlock);
@@ -584,7 +584,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
 return;
   }
   BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-  Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+  Builder.SetInsertPoint(InsertPt);
 
   Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_ULT, ResBlock.PhiSrc1,
   ResBlock.PhiSrc2);
@@ -611,7 +611,7 @@ void MemCmpExpansion::setupResultBlockPHINodes() {
 }
 
 void MemCmpExpansion::setupEndBlockPHINodes() {
-  Builder.SetInsertPoint(EndBlock, EndBlock->begin());
+  Builder.SetInsertPoint(EndBlock->begin());
   PhiRes = Builder.CreatePHI(Type::getInt32Ty(CI->getContext()), 2, "phi.res");
 }
 
diff --git a/llvm/lib/CodeGen/ExpandVectorPredication.cpp 
b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
index dc35f33a3a059..a63a8681f5140 100644
--- a/llvm/lib/CodeGen/ExpandVectorPredication.cpp
+++ b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
@@ -667,7 +667,7 @@ void CachingVPExpander::discardEVLParameter(VPIntrinsic 
) {
 auto *M = VPI.getModule();
 Function *VScaleFunc =
 Intrinsic::getDeclaration(M, Intrinsic::vscale, Int32Ty);
-IRBuilder<> Builder(VPI.getParent(), VPI.getIterator());
+IRBuilder<> Builder(VPI.getIterator());
 Value *FactorConst = Builder.getInt32(StaticElemCount.getKnownMinVa...
[truncated]

``




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


[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread via cfe-commits
sertPt);
   // Create a new base.
   Value *BaseIndex = ConstantInt::get(PtrIdxTy, BaseOffset);
   NewBaseGEP = OldBase;
diff --git a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp 
b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
index 11f123aa5bed8..2c05f01726770 100644
--- a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
+++ b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
@@ -212,7 +212,7 @@ static void expandFPToI(Instruction *FPToI) {
   Builder.CreateBr(End);
 
   // cleanup:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(FPToI->getType(), 4);
 
   Retval0->addIncoming(Cond8, IfThen5);
@@ -560,7 +560,7 @@ static void expandIToFP(Instruction *IToFP) {
   Builder.CreateBr(End);
 
   // return:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(IToFP->getType(), 2);
   Retval0->addIncoming(A4, IfEnd26);
   Retval0->addIncoming(ConstantFP::getZero(IToFP->getType(), false), Entry);
diff --git a/llvm/lib/CodeGen/ExpandMemCmp.cpp 
b/llvm/lib/CodeGen/ExpandMemCmp.cpp
index bb84813569f4d..3e59834e4f1c8 100644
--- a/llvm/lib/CodeGen/ExpandMemCmp.cpp
+++ b/llvm/lib/CodeGen/ExpandMemCmp.cpp
@@ -574,7 +574,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
   // need to be calculated and can simply return 1.
   if (IsUsedForZeroCmp) {
 BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+Builder.SetInsertPoint(InsertPt);
 Value *Res = ConstantInt::get(Type::getInt32Ty(CI->getContext()), 1);
 PhiRes->addIncoming(Res, ResBlock.BB);
 BranchInst *NewBr = BranchInst::Create(EndBlock);
@@ -584,7 +584,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
 return;
   }
   BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-  Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+  Builder.SetInsertPoint(InsertPt);
 
   Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_ULT, ResBlock.PhiSrc1,
   ResBlock.PhiSrc2);
@@ -611,7 +611,7 @@ void MemCmpExpansion::setupResultBlockPHINodes() {
 }
 
 void MemCmpExpansion::setupEndBlockPHINodes() {
-  Builder.SetInsertPoint(EndBlock, EndBlock->begin());
+  Builder.SetInsertPoint(EndBlock->begin());
   PhiRes = Builder.CreatePHI(Type::getInt32Ty(CI->getContext()), 2, "phi.res");
 }
 
diff --git a/llvm/lib/CodeGen/ExpandVectorPredication.cpp 
b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
index dc35f33a3a059..a63a8681f5140 100644
--- a/llvm/lib/CodeGen/ExpandVectorPredication.cpp
+++ b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
@@ -667,7 +667,7 @@ void CachingVPExpander::discardEVLParameter(VPIntrinsic 
) {
 auto *M = VPI.getModule();
 Function *VScaleFunc =
 Intrinsic::getDeclaration(M, Intrinsic::vscale, Int32Ty);
-IRBuilder<> Builder(VPI.getParent(), VPI.getIterator());
+IRBuilder<> Builder(VPI.getIterator());
 Value *FactorConst = Builder.getInt32(StaticElemCount.getKnownMinVa...
[truncated]

``




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


[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread via cfe-commits
sertPt);
   // Create a new base.
   Value *BaseIndex = ConstantInt::get(PtrIdxTy, BaseOffset);
   NewBaseGEP = OldBase;
diff --git a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp 
b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
index 11f123aa5bed8..2c05f01726770 100644
--- a/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
+++ b/llvm/lib/CodeGen/ExpandLargeFpConvert.cpp
@@ -212,7 +212,7 @@ static void expandFPToI(Instruction *FPToI) {
   Builder.CreateBr(End);
 
   // cleanup:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(FPToI->getType(), 4);
 
   Retval0->addIncoming(Cond8, IfThen5);
@@ -560,7 +560,7 @@ static void expandIToFP(Instruction *IToFP) {
   Builder.CreateBr(End);
 
   // return:
-  Builder.SetInsertPoint(End, End->begin());
+  Builder.SetInsertPoint(End->begin());
   PHINode *Retval0 = Builder.CreatePHI(IToFP->getType(), 2);
   Retval0->addIncoming(A4, IfEnd26);
   Retval0->addIncoming(ConstantFP::getZero(IToFP->getType(), false), Entry);
diff --git a/llvm/lib/CodeGen/ExpandMemCmp.cpp 
b/llvm/lib/CodeGen/ExpandMemCmp.cpp
index bb84813569f4d..3e59834e4f1c8 100644
--- a/llvm/lib/CodeGen/ExpandMemCmp.cpp
+++ b/llvm/lib/CodeGen/ExpandMemCmp.cpp
@@ -574,7 +574,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
   // need to be calculated and can simply return 1.
   if (IsUsedForZeroCmp) {
 BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+Builder.SetInsertPoint(InsertPt);
 Value *Res = ConstantInt::get(Type::getInt32Ty(CI->getContext()), 1);
 PhiRes->addIncoming(Res, ResBlock.BB);
 BranchInst *NewBr = BranchInst::Create(EndBlock);
@@ -584,7 +584,7 @@ void MemCmpExpansion::emitMemCmpResultBlock() {
 return;
   }
   BasicBlock::iterator InsertPt = ResBlock.BB->getFirstInsertionPt();
-  Builder.SetInsertPoint(ResBlock.BB, InsertPt);
+  Builder.SetInsertPoint(InsertPt);
 
   Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_ULT, ResBlock.PhiSrc1,
   ResBlock.PhiSrc2);
@@ -611,7 +611,7 @@ void MemCmpExpansion::setupResultBlockPHINodes() {
 }
 
 void MemCmpExpansion::setupEndBlockPHINodes() {
-  Builder.SetInsertPoint(EndBlock, EndBlock->begin());
+  Builder.SetInsertPoint(EndBlock->begin());
   PhiRes = Builder.CreatePHI(Type::getInt32Ty(CI->getContext()), 2, "phi.res");
 }
 
diff --git a/llvm/lib/CodeGen/ExpandVectorPredication.cpp 
b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
index dc35f33a3a059..a63a8681f5140 100644
--- a/llvm/lib/CodeGen/ExpandVectorPredication.cpp
+++ b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
@@ -667,7 +667,7 @@ void CachingVPExpander::discardEVLParameter(VPIntrinsic 
) {
 auto *M = VPI.getModule();
 Function *VScaleFunc =
 Intrinsic::getDeclaration(M, Intrinsic::vscale, Int32Ty);
-IRBuilder<> Builder(VPI.getParent(), VPI.getIterator());
+IRBuilder<> Builder(VPI.getIterator());
 Value *FactorConst = Builder.getInt32(StaticElemCount.getKnownMinVa...
[truncated]

``




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


[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread Stephen Tozer via cfe-commits

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


[clang] [Clang][SveEmitter] Split up TargetGuard into SVE and SME component. (PR #96482)

2024-06-24 Thread Paul Walker via cfe-commits

https://github.com/paulwalker-arm approved this pull request.

This is certainly a step in the right direction.

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Lucas Duarte Prates via cfe-commits


@@ -161,6 +162,39 @@ static int PrintSupportedExtensions(std::string TargetStr) 
{
   return 0;
 }
 
+static int PrintEnabledExtensions(const TargetOptions& TargetOpts) {
+  std::string Error;
+  const llvm::Target *TheTarget =
+  llvm::TargetRegistry::lookupTarget(TargetOpts.Triple, Error);
+  if (!TheTarget) {
+llvm::errs() << Error;
+return 1;
+  }
+
+  llvm::TargetOptions BackendOptions;
+  std::string FeaturesStr = llvm::join(TargetOpts.FeaturesAsWritten, ",");
+  std::unique_ptr TheTargetMachine(
+  TheTarget->createTargetMachine(TargetOpts.Triple, TargetOpts.CPU, 
FeaturesStr, BackendOptions, std::nullopt));
+  const llvm::Triple  = TheTargetMachine->getTargetTriple();
+  const llvm::MCSubtargetInfo *MCInfo = TheTargetMachine->getMCSubtargetInfo();
+  const std::vector Features =
+MCInfo->getEnabledProcessorFeatures();
+
+  std::vector EnabledFeatureNames;
+  for (const llvm::SubtargetFeatureKV  : Features)
+EnabledFeatureNames.push_back(feature.Key);

pratlucas wrote:

Unfortunately `llvm::SubtargetFeatureKV` doesn't hold a lot of information and 
semantics of its contents is even less clear the what's capture here. I'll add 
a comment to this block clarifying what's being captured. 

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


[clang] [clang][ThreadSafety] Fix code block syntax in ThreadSafetyAnalysis.rst (PR #96494)

2024-06-24 Thread Aaron Ballman via cfe-commits

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


[clang] 3402620 - [clang][ThreadSafety] Fix code block syntax in ThreadSafetyAnalysis.rst (#96494)

2024-06-24 Thread via cfe-commits

Author: Dan McArdle
Date: 2024-06-24T10:48:51-04:00
New Revision: 34026207c87116bd8e7fb0a464ea8db947f8239a

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

LOG: [clang][ThreadSafety] Fix code block syntax in ThreadSafetyAnalysis.rst 
(#96494)

Without a newline, documentation was failing to build with this error:

Warning, treated as error:

/home/runner/work/llvm-project/llvm-project/clang-build/tools/clang/docs/ThreadSafetyAnalysis.rst:466:Error
in "code-block" directive:
maximum 1 argument(s) allowed, 10 supplied.

Issue #92408

Added: 


Modified: 
clang/docs/ThreadSafetyAnalysis.rst

Removed: 




diff  --git a/clang/docs/ThreadSafetyAnalysis.rst 
b/clang/docs/ThreadSafetyAnalysis.rst
index 0ecbebe7a692f..1513719caa464 100644
--- a/clang/docs/ThreadSafetyAnalysis.rst
+++ b/clang/docs/ThreadSafetyAnalysis.rst
@@ -464,6 +464,7 @@ on success and ``LockNotAcquired`` on failure, the analysis 
may fail to detect
 access to guarded data without holding the mutex because they are both 
non-zero.
 
 .. code-block:: c++
+
   // *** Beware: this code demonstrates incorrect usage. ***
 
   enum TrylockResult { LockAcquired = 1, LockNotAcquired = 2 };



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


[clang] [clang][ThreadSafety] Fix code block syntax in ThreadSafetyAnalysis.rst (PR #96494)

2024-06-24 Thread Aaron Ballman via cfe-commits

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

LGTM, thanks for the quick fix!

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


[clang-tools-extra] [clang-tidy] add fixhint for misc-use-internal-linkage (PR #96203)

2024-06-24 Thread Congcong Cai via cfe-commits
44b 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-var.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-var.cpp
@@ -1,4 +1,6 @@
 // RUN: %check_clang_tidy %s misc-use-internal-linkage %t -- -- 
-I%S/Inputs/use-internal-linkage
+// RUN: %check_clang_tidy %s misc-use-internal-linkage %t -- \
+// RUN:   -config="{CheckOptions: {misc-use-internal-linkage.FixMode: 
'UseStatic'}}"  -- -I%S/Inputs/use-internal-linkage
 
 #include "var.h"
 

>From 1dbad4a128660f85dfd1b3189a373a79c0087df4 Mon Sep 17 00:00:00 2001
From: Congcong Cai 
Date: Mon, 24 Jun 2024 22:31:59 +0800
Subject: [PATCH 3/3] add more check

---
 .../test/clang-tidy/checkers/misc/use-internal-linkage-func.cpp | 2 ++
 .../test/clang-tidy/checkers/misc/use-internal-linkage-var.cpp  | 1 +
 2 files changed, 3 insertions(+)

diff --git 
a/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-func.cpp 
b/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-func.cpp
index 1cdb655ee4454..9c91389542b03 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-func.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-func.cpp
@@ -11,9 +11,11 @@ void func() {}
 template
 void func_template() {}
 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func_template'
+// CHECK-FIXES: static void func_template() {}
 
 void func_cpp_inc();
 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func_cpp_inc'
+// CHECK-FIXES: static void func_cpp_inc();
 
 #include "func_cpp.inc"
 
diff --git 
a/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-var.cpp 
b/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-var.cpp
index 4a4d9c787d44b..01b8d28e61230 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-var.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-var.cpp
@@ -11,6 +11,7 @@ int global;
 template
 T global_template;
 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: variable 'global_template'
+// CHECK-FIXES: static T global_template;
 
 int gloabl_header;
 

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


[clang] [clang][ThreadSafety] Fix code block syntax in ThreadSafetyAnalysis.rst (PR #96494)

2024-06-24 Thread Dan McArdle via cfe-commits

dmcardle wrote:

@AaronBallman PTAL — looks like #95290 broke the documentation.

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


[clang] [clang][ThreadSafety] Fix code block syntax in ThreadSafetyAnalysis.rst (PR #96494)

2024-06-24 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Dan McArdle (dmcardle)


Changes

Without a newline, documentation was failing to build with this error:

Warning, treated as error:

/home/runner/work/llvm-project/llvm-project/clang-build/tools/clang/docs/ThreadSafetyAnalysis.rst:466:Error
 in "code-block" directive:
maximum 1 argument(s) allowed, 10 supplied.

Issue #92408

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


1 Files Affected:

- (modified) clang/docs/ThreadSafetyAnalysis.rst (+1) 


``diff
diff --git a/clang/docs/ThreadSafetyAnalysis.rst 
b/clang/docs/ThreadSafetyAnalysis.rst
index 0ecbebe7a692f..1513719caa464 100644
--- a/clang/docs/ThreadSafetyAnalysis.rst
+++ b/clang/docs/ThreadSafetyAnalysis.rst
@@ -464,6 +464,7 @@ on success and ``LockNotAcquired`` on failure, the analysis 
may fail to detect
 access to guarded data without holding the mutex because they are both 
non-zero.
 
 .. code-block:: c++
+
   // *** Beware: this code demonstrates incorrect usage. ***
 
   enum TrylockResult { LockAcquired = 1, LockNotAcquired = 2 };

``




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


[clang] [clang][ThreadSafety] Fix code block syntax in ThreadSafetyAnalysis.rst (PR #96494)

2024-06-24 Thread Dan McArdle via cfe-commits

https://github.com/dmcardle created 
https://github.com/llvm/llvm-project/pull/96494

Without a newline, documentation was failing to build with this error:

Warning, treated as error:

/home/runner/work/llvm-project/llvm-project/clang-build/tools/clang/docs/ThreadSafetyAnalysis.rst:466:Error
 in "code-block" directive:
maximum 1 argument(s) allowed, 10 supplied.

Issue #92408

>From 3bd8ad70da4c3ab7a89969dd31b728dcf301d7ab Mon Sep 17 00:00:00 2001
From: Dan McArdle 
Date: Mon, 24 Jun 2024 10:39:58 -0400
Subject: [PATCH] [clang][ThreadSafety] Fix code block syntax in
 ThreadSafetyAnalysis.rst

Without a newline, documentation was failing to build with this error:

Warning, treated as error:

/home/runner/work/llvm-project/llvm-project/clang-build/tools/clang/docs/ThreadSafetyAnalysis.rst:466:Error
 in "code-block" directive:
maximum 1 argument(s) allowed, 10 supplied.

Issue #92408
---
 clang/docs/ThreadSafetyAnalysis.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/docs/ThreadSafetyAnalysis.rst 
b/clang/docs/ThreadSafetyAnalysis.rst
index 0ecbebe7a692f..1513719caa464 100644
--- a/clang/docs/ThreadSafetyAnalysis.rst
+++ b/clang/docs/ThreadSafetyAnalysis.rst
@@ -464,6 +464,7 @@ on success and ``LockNotAcquired`` on failure, the analysis 
may fail to detect
 access to guarded data without holding the mutex because they are both 
non-zero.
 
 .. code-block:: c++
+
   // *** Beware: this code demonstrates incorrect usage. ***
 
   enum TrylockResult { LockAcquired = 1, LockNotAcquired = 2 };

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


[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-06-24 Thread Bill Wendling via cfe-commits

https://github.com/bwendling updated 
https://github.com/llvm/llvm-project/pull/86858

>From 31af119d614ef2108b5404f9c9387ec45aa1bfef Mon Sep 17 00:00:00 2001
From: Bill Wendling 
Date: Thu, 21 Mar 2024 15:07:31 -0700
Subject: [PATCH 1/7] [Clang][objectsize] Generate object size calculation for
 sub-objects

The second argument of __builtin_dynamic_object_size controls whether it
returns the size of the whole object or the closest surrounding object.
For this struct:

  struct s {
int  foo;
char bar[2][40];
int  baz;
int  qux;
  };

  int main(int argc, char **argv) {
struct s f;

  #define report(x) printf(#x ": %zu\n", x)

argc = 1;
report(__builtin_dynamic_object_size(f.bar[argc], 0));
report(__builtin_dynamic_object_size(f.bar[argc], 1));
return 0;
  }

should return:

  __builtin_dynamic_object_size(f.bar[argc], 0): 48
  __builtin_dynamic_object_size(f.bar[argc], 1): 40

determined by the least significant bit of the TYPE.

The LLVM IR isn't sufficient to determine what could be considered a
"sub-object". However, the front-end does have enough information to
determine the size of a sub-object and the offset into that sub-object.

We try therefore to convert the intrinsic into a calculation in the
front-end so that we can avoid the information issue..
---
 clang/lib/CodeGen/CGBuiltin.cpp | 138 +-
 clang/lib/CodeGen/CodeGenFunction.h |   6 +
 clang/test/CodeGen/object-size-sub-object.c | 280 
 3 files changed, 418 insertions(+), 6 deletions(-)
 create mode 100644 clang/test/CodeGen/object-size-sub-object.c

diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 2eaceeba61770..be055f34c4492 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -26,6 +26,7 @@
 #include "clang/AST/Decl.h"
 #include "clang/AST/OSLog.h"
 #include "clang/AST/OperationKinds.h"
+#include "clang/AST/StmtVisitor.h"
 #include "clang/Basic/TargetBuiltins.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetOptions.h"
@@ -1052,6 +1053,128 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr 
*E, unsigned Type,
   return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, 
IsSigned));
 }
 
+namespace {
+
+struct ObjectSizeVisitor
+: public ConstStmtVisitor {
+  const Expr *Visit(const Expr *E) {
+return ConstStmtVisitor::Visit(E);
+  }
+
+  const Expr *VisitStmt(const Stmt *S) { return nullptr; }
+
+  const Expr *VisitDeclRefExpr(const DeclRefExpr *E) { return E; }
+  const Expr *VisitMemberExpr(const MemberExpr *E) { return E; }
+  const Expr *VisitArraySubscriptExpr(const ArraySubscriptExpr *E) { return E; 
}
+
+  const Expr *VisitCastExpr(const CastExpr *E) {
+return Visit(E->getSubExpr());
+  }
+  const Expr *VisitParenExpr(const ParenExpr *E) {
+return Visit(E->getSubExpr());
+  }
+  const Expr *VisitUnaryAddrOf(const clang::UnaryOperator *E) {
+return Visit(E->getSubExpr());
+  }
+  const Expr *VisitUnaryDeref(const clang::UnaryOperator *E) {
+return Visit(E->getSubExpr());
+  }
+};
+
+} // end anonymous namespace
+
+/// tryToCalculateSubObjectSize - It may be possible to calculate the
+/// sub-object size of an array and skip the generation of the llvm.objectsize
+/// intrinsic. This avoids the complication in conveying the sub-object's
+/// information to the backend. This calculation works for an N-dimentional
+/// array.
+///
+/// Note that this function supports only Row-Major arrays. The generalized
+/// calculation of the offset of an element in Row-Major form:
+///
+/// .-  -.
+///   d |d   |
+///  ---|  - |
+/// offset = \  |   | |  |
+///  /  |   | |  N_j |  m_i
+///  ---|   | |  |
+/// i = 1   | j = i + 1  |
+/// `-  -'
+///
+/// where d is the number of dimensions; m_i is the index of an element in
+/// dimension i; and N_i is the size of dimention i.
+///
+/// Examples:
+/// 2D: offset = m_2 + (N_2 * m_1)
+/// 3D: offset = m_3 + (N_3 * m_2) + (N_3 * N_2 * m_1)
+llvm::Value *
+CodeGenFunction::tryToCalculateSubObjectSize(const Expr *E, unsigned Type,
+ llvm::IntegerType *ResType) {
+  if ((Type & 0x01) != 1)
+// Only support sub-object calculation.
+return nullptr;
+
+  const Expr *ObjectBase = ObjectSizeVisitor().Visit(E);
+  if (!ObjectBase)
+return nullptr;
+
+  // Collect the sizes and indices from the array.
+  ASTContext  = getContext();
+  SmallVector, 4> Dims;
+  while (const auto *ASE = dyn_cast(ObjectBase)) {
+const Expr *Base = ASE;
+const Expr *Idx = ASE->getIdx();
+
+if (Idx->HasSideEffects(Ctx))
+  return nullptr;
+
+uint64_t BaseSize = Ctx.getTypeSizeInChars(Base->getType()).getQuantity();
+Value *IdxSize = EmitScalarExpr(Idx);
+
+

[clang] b644726 - [PPC][InlineASM] Don't write to source directory in test

2024-06-24 Thread Benjamin Kramer via cfe-commits

Author: Benjamin Kramer
Date: 2024-06-24T16:35:07+02:00
New Revision: b6447260748086c0df484ec6609f126ae90e91ea

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

LOG: [PPC][InlineASM] Don't write to source directory in test

Added: 


Modified: 
clang/test/CodeGen/PowerPC/inline-asm-constraints-error.c

Removed: 




diff  --git a/clang/test/CodeGen/PowerPC/inline-asm-constraints-error.c 
b/clang/test/CodeGen/PowerPC/inline-asm-constraints-error.c
index eb443eee40e55..2f35e52fc0b77 100644
--- a/clang/test/CodeGen/PowerPC/inline-asm-constraints-error.c
+++ b/clang/test/CodeGen/PowerPC/inline-asm-constraints-error.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm -triple powerpc64-ibm-aix-xcoff -verify %s
-// RUN: %clang_cc1 -emit-llvm -triple powerpc-ibm-aix-xcoff -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple powerpc64-ibm-aix-xcoff -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple powerpc-ibm-aix-xcoff -verify %s
 // This test case exist to test marking the 'a' inline assembly constraint as
 // unsupported because powerpc previously marked it as supported.
 int foo(int arg){



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


[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-24 Thread Kristóf Umann via cfe-commits

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


[clang] fc4b09d - [analyzer] Add an ownership change visitor to StreamChecker (#94957)

2024-06-24 Thread via cfe-commits
bject or storing it for 
later release}}
+
+void foo() {
+  FILE *f = fopen("input.txt", "w"); // expected-note{{Stream opened here}}
+  if (!f) // expected-note{{'f' is non-null}}
+  // expected-note@-1{{Taking false branch}}
+return;
+  sink(f); // expected-note {{Calling 'sink'}}
+   // expected-note@-1 {{Returning from 'sink'}}
+} // expected-warning{{Opened stream never closed. Potential resource leak 
[unix.Stream]}}
+// expected-note@-1{{Opened stream never closed. Potential resource leak}}
+
+} // namespace stream_shared_with_ptr_of_shorter_lifetime
+
+//===--===//
+// Report for which we *do not* expect NoOwnershipChangeVisitor add a new note,
+// nor do we want it to.
+//===--===//
+
+namespace stream_not_passed_to_fn_call {
+
+void expectedClose(FILE *f) {
+  if (char *log = logDump()) {
+printf("%s", log);
+fclose(f);
+  }
+}
+
+void f(FILE *p) {
+  FILE *f = fopen("input.txt", "w"); // expected-note{{Stream opened here}}
+  if (!f) // expected-note{{'f' is non-null}}
+  // expected-note@-1{{Taking false branch}}
+return;
+  expectedClose(p); // expected-warning{{Opened stream never closed. Potential 
resource leak [unix.Stream]}}
+// expected-note@-1{{Opened stream never closed. Potential 
resource leak}}
+}
+} // namespace stream_not_passed_to_fn_call
+
+namespace stream_shared_with_ptr_of_same_lifetime {
+
+void expectedClose(FILE *f, FILE **p) {
+  // NOTE: Not a job of NoOwnershipChangeVisitor, but maybe this could be
+  // highlighted still?
+  *p = f;
+}
+
+void f() {
+  FILE *f = fopen("input.txt", "w"); // expected-note{{Stream opened here}}
+  FILE *p = NULL;
+  if (!f) // expected-note{{'f' is non-null}}
+  // expected-note@-1{{Taking false branch}}
+return;
+  expectedClose(f, );
+} // expected-warning{{Opened stream never closed. Potential resource leak 
[unix.Stream]}}
+  // expected-note@-1{{Opened stream never closed. Potential resource leak}}
+} // namespace stream_shared_with_ptr_of_same_lifetime
+
+namespace stream_passed_into_fn_that_doesnt_intend_to_free {
+void expectedClose(FILE *f) {
+}
+
+void f() {
+  FILE *f = fopen("input.txt", "w"); // expected-note{{Stream opened here}}
+  if (!f) // expected-note{{'f' is non-null}}
+  // expected-note@-1{{Taking false branch}}
+return;
+  expectedClose(f);
+
+} // expected-warning{{Opened stream never closed. Potential resource leak 
[unix.Stream]}}
+  // expected-note@-1{{Opened stream never closed. Potential resource leak}}
+} // namespace stream_passed_into_fn_that_doesnt_intend_to_free
+
+namespace stream_passed_into_fn_that_doesnt_intend_to_free2 {
+void bar();
+
+void expectedClose(FILE *f) {
+  // Correctly realize that calling bar() doesn't mean that this function would
+  // like to deallocate anything.
+  bar();
+}
+
+void f() {
+  FILE *f = fopen("input.txt", "w"); // expected-note{{Stream opened here}}
+  if (!f) // expected-note{{'f' is non-null}}
+  // expected-note@-1{{Taking false branch}}
+return;
+  expectedClose(f);
+
+} // expected-warning{{Opened stream never closed. Potential resource leak 
[unix.Stream]}}
+  // expected-note@-1{{Opened stream never closed. Potential resource leak}}
+} // namespace stream_passed_into_fn_that_doesnt_intend_to_free2
+
+namespace streamstate_from_closed_to_open {
+
+// StreamState of the symbol changed from nothing to Allocated. We don't want 
to
+// emit notes when the RefKind changes in the stack frame.
+static FILE *fopenWrapper() {
+  FILE *f = fopen("input.txt", "w"); // expected-note{{Stream opened here}}
+  assert(f);
+  return f;
+}
+void use_ret() {
+  FILE *v;
+  v = fopenWrapper(); // expected-note {{Calling 'fopenWrapper'}}
+  // expected-note@-1{{Returning from 'fopenWrapper'}}
+
+} // expected-warning{{Opened stream never closed. Potential resource leak 
[unix.Stream]}}
+  // expected-note@-1{{Opened stream never closed. Potential resource leak}}
+
+} // namespace streamstate_from_closed_to_open



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


[clang] 6ecb9fd - [C11] Remove WG14 N1382 from the list of papers to track

2024-06-24 Thread Aaron Ballman via cfe-commits

Author: Aaron Ballman
Date: 2024-06-24T10:34:11-04:00
New Revision: 6ecb9fd83d6015b19be8db554328645ae15e63e9

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

LOG: [C11] Remove WG14 N1382 from the list of papers to track

This paper proposes only changes to a footnote that had problematic
implications for ABI; the changes were purely editorial.

Added: 


Modified: 
clang/www/c_status.html

Removed: 




diff  --git a/clang/www/c_status.html b/clang/www/c_status.html
index 4cbb51ea02468..6b375a6b7999d 100644
--- a/clang/www/c_status.html
+++ b/clang/www/c_status.html
@@ -488,11 +488,6 @@ C11 implementation status
   https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1367.htm;>N1367
   Unknown
 
-
-  FLT_EVAL_METHOD and return
-  https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1382.htm;>N1382
-  Unknown
-
 
   Floating-point to int/_Bool conversions
   https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1391.htm;>N1391



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


[clang] 29e0f04 - [C11] Remove WG14 N1353 from the list of papers to track

2024-06-24 Thread Aaron Ballman via cfe-commits

Author: Aaron Ballman
Date: 2024-06-24T10:29:15-04:00
New Revision: 29e0f046735010540fbdba4371dcd26f9e437650

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

LOG: [C11] Remove WG14 N1353 from the list of papers to track

Only the first proposed changes in the paper were adopted, and that
wording was changing "operations" into "operators", which is purely an
editorial change.

Added: 


Modified: 
clang/www/c_status.html

Removed: 




diff  --git a/clang/www/c_status.html b/clang/www/c_status.html
index 922a84ca34312..4cbb51ea02468 100644
--- a/clang/www/c_status.html
+++ b/clang/www/c_status.html
@@ -457,11 +457,6 @@ C11 implementation status
   https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1349.htm;>N1349
   Unknown
 
-
-  FLT_EVAL_METHOD issues (first change only)
-  https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1353.pdf;>N1353
-  Unknown
-
 
   _Bool bit-fields
   https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1356.htm;>N1356



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


[Lldb-commits] [lldb] [lldb/DWARF] Remove parsing recursion when searching for definition DIEs (PR #96484)

2024-06-24 Thread Michael Buch via lldb-commits

Michael137 wrote:

Latest update LGTM

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


[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-06-24 Thread Doug Wyatt via cfe-commits

dougsonos wrote:

> I’m probably just stating the obvious here, but seeing as existing code 
> obviously does not make use of effects, for compiling it to become slower, 
> that means that we’re probably unconditionally executing code somewhere 
> irrespective of whether effects are present or not, so what I’m saying is we 
> should probably investigate any places where this pr checks for the presence 
> of effects and does something based on that and move the checks for whether a 
> function even has effects attached to it as far up as possible and try and 
> also optimise that check (is the function that checks for that defined in a 
> header? If not, we should maybe move the definition there so it can be 
> inlined).

That makes sense. I remember thinking a couple of times that I was working on a 
function that might be better inlined, but changing Type.h triggered long 
rebuilds.

> The only other option I can think of is that this adds some more data to 
> `FunctionProtoType`s, which means we allocate more etc. but that alone 
> shouldn’t have this big of an impact I’m assuming?

Well, it adds two more types of trailing objects so nothing more gets allocated 
in the case of no effects. Possibly the trailing objects mechanism itself gets 
a bit slower though.

I'll dig in and investigate today.

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


[jenkinsci/subversion-plugin]

2024-06-24 Thread 'github-actions[bot]' via Jenkins Commits
  Branch: refs/tags/1265.v4b_6d7cd94421
  Home:   https://github.com/jenkinsci/subversion-plugin

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/subversion-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/subversion-plugin/push/refs/tags/1265.v4b_6d7cd94421/00-4b6d7c%40github.com.


branch master updated: gnu: Add missing module import.

2024-06-24 Thread guix-commits
This is an automated email from the git hooks/post-receive script.

z572 pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
 new ac105faf4c gnu: Add missing module import.
ac105faf4c is described below

commit ac105faf4ceb67468c7011505a07a67b0c1b045f
Author: Zheng Junjie 
AuthorDate: Mon Jun 24 22:09:26 2024 +0800

gnu: Add missing module import.

Add missing module import.

Change-Id: Ib2cfd268455f9bb1d1abddc0bf04a4a67d78c1c6
---
 gnu/packages/tor-browsers.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/tor-browsers.scm b/gnu/packages/tor-browsers.scm
index 50f0e9c81f..3d01346c8c 100644
--- a/gnu/packages/tor-browsers.scm
+++ b/gnu/packages/tor-browsers.scm
@@ -42,6 +42,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages assembly)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages browser-extensions)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cups)



[jenkinsci/swarm-plugin] 16f575: Bump org.jenkins-ci.main:remoting (#632)

2024-06-24 Thread 'dependabot[bot]' via Jenkins Commits
  Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/swarm-plugin
  Commit: 16f575eeaa07252cca38ce6970ca06ca999ec6bd
  
https://github.com/jenkinsci/swarm-plugin/commit/16f575eeaa07252cca38ce6970ca06ca999ec6bd
  Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
M client/pom.xml

  Log Message:
  ---
  Bump org.jenkins-ci.main:remoting (#632)



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/swarm-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/swarm-plugin/push/refs/heads/master/6747fd-16f575%40github.com.


[clang] ae1c564 - [clang][Interp] Cast dummy pointers to other pointer type if necessary

2024-06-24 Thread Timm Bäder via cfe-commits

Author: Timm Bäder
Date: 2024-06-24T16:17:03+02:00
New Revision: ae1c564d1522f1202d05b698dce8d9c8ca46667c

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

LOG: [clang][Interp] Cast dummy pointers to other pointer type if necessary

Added: 


Modified: 
clang/lib/AST/Interp/ByteCodeExprGen.cpp
clang/test/Sema/ptrauth.c

Removed: 




diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp 
b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index 3c96059375360..69661a590b9c2 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -3574,8 +3574,14 @@ bool 
ByteCodeExprGen::VisitBuiltinCallExpr(const CallExpr *E) {
   Builtin == Builtin::BI__builtin___NSStringMakeConstantString ||
   Builtin == Builtin::BI__builtin_ptrauth_sign_constant ||
   Builtin == Builtin::BI__builtin_function_start) {
-if (std::optional GlobalOffset = P.createGlobal(E))
-  return this->emitGetPtrGlobal(*GlobalOffset, E);
+if (std::optional GlobalOffset = P.createGlobal(E)) {
+  if (!this->emitGetPtrGlobal(*GlobalOffset, E))
+return false;
+
+  if (PrimType PT = classifyPrim(E); PT != PT_Ptr && isPtrType(PT))
+return this->emitDecayPtr(PT_Ptr, PT, E);
+  return true;
+}
 return false;
   }
 

diff  --git a/clang/test/Sema/ptrauth.c b/clang/test/Sema/ptrauth.c
index cd069881793c5..fc1ae954fa36b 100644
--- a/clang/test/Sema/ptrauth.c
+++ b/clang/test/Sema/ptrauth.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify 
-fptrauth-intrinsics %s
+// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify 
-fptrauth-intrinsics %s -fexperimental-new-constant-interpreter
 
 #if __has_feature(ptrauth_intrinsics)
 #warning Pointer authentication enabled!



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


[jenkinsci/subversion-plugin] 4b6d7c: [JENKINS-73281] Use `mina-sshd-api` plugin (#297)

2024-06-24 Thread 'Basil Crow' via Jenkins Commits
  Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/subversion-plugin
  Commit: 4b6d7cd94421f6516195b30502ead5d209aefd14
  
https://github.com/jenkinsci/subversion-plugin/commit/4b6d7cd94421f6516195b30502ead5d209aefd14
  Author: Basil Crow 
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  [JENKINS-73281] Use `mina-sshd-api` plugin (#297)



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/subversion-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/subversion-plugin/push/refs/heads/master/7281cc-4b6d7c%40github.com.


[jenkinsci/subversion-plugin] 7281cc: Enable Jenkins Security Scan (#298)

2024-06-24 Thread 'strangelookingnerd' via Jenkins Commits
  Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/subversion-plugin
  Commit: 7281ccbf813cbbc39ff83310bf8bbe8e025d6ef6
  
https://github.com/jenkinsci/subversion-plugin/commit/7281ccbf813cbbc39ff83310bf8bbe8e025d6ef6
  Author: strangelookingnerd 
<49242855+strangelookingn...@users.noreply.github.com>
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
A .github/workflows/jenkins-security-scan.yml

  Log Message:
  ---
  Enable Jenkins Security Scan (#298)



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/subversion-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/subversion-plugin/push/refs/heads/master/ff0602-7281cc%40github.com.


[pmd-commits] [pmd/pmd] ee0084: Update documentation

2024-06-24 Thread Machine account for PMD via Pmd-commits
M pmd_userdocs_cpd_report_formats.html
M pmd_userdocs_extending_ast_dump.html
M pmd_userdocs_extending_defining_properties.html
M pmd_userdocs_extending_designer_reference.html
M pmd_userdocs_extending_rule_guidelines.html
M pmd_userdocs_extending_testing.html
M pmd_userdocs_extending_writing_java_rules.html
M pmd_userdocs_extending_writing_pmd_rules.html
M pmd_userdocs_extending_writing_rules_intro.html
M pmd_userdocs_extending_writing_xpath_rules.html
M pmd_userdocs_extending_your_first_rule.html
M pmd_userdocs_incremental_analysis.html
M pmd_userdocs_installation.html
M pmd_userdocs_making_rulesets.html
M pmd_userdocs_migrating_to_pmd7.html
M pmd_userdocs_report_formats.html
M pmd_userdocs_suppressing_warnings.html
M pmd_userdocs_tools.html
M pmd_userdocs_tools_ant.html
M pmd_userdocs_tools_bld.html
M pmd_userdocs_tools_ci.html
M pmd_userdocs_tools_gradle.html
M pmd_userdocs_tools_java_api.html
M pmd_userdocs_tools_maven.html
M sitemap.xml
M tag_CpdCapableLanguage.html
M tag_PmdCapableLanguage.html
M tag_devdocs.html
M tag_experimental.html
M tag_extending.html
M tag_getting_started.html
M tag_languages.html
M tag_metrics.html
M tag_release_notes.html
M tag_rule_references.html
M tag_tools.html
M tag_troubleshooting.html
M tag_userdocs.html

  Log Message:
  ---
  Update documentation

https://github.com/pmd/pmd/actions/runs/9646547730
https://github.com/pmd/pmd/compare/c2dc7b3d9b1a...648e2ebd6acd



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


___
Pmd-commits mailing list
Pmd-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmd-commits


[clang] [clang] Emit bad shift warnings (PR #70307)

2024-06-24 Thread Budimir Aranđelović via cfe-commits
 extension}}
+ // expected-note@-1 {{value 28958703552 
is outside the range of representable values of type 'int'}}
 #if __cplusplus >= 201103L
-// expected-warning@-2 {{not an integral constant expression}}
-// expected-note@-3 {{value 28958703552 is outside the range of representable 
values}}
-#else 
-// expected-warning@-5 {{overflow in expression; result is -1'106'067'520 with 
type 'int'}}
+#else
+// expected-warning@-4 {{overflow in expression; result is -1'106'067'520 with 
type 'int'}}
 #endif
 
 // FIXME: This is not consistent with the above case.
@@ -112,8 +111,10 @@ enum NoFold : int { overflow2 = 123456 * 234567 };
 // expected-error@-2 {{enumerator value is not a constant expression}}
 // expected-note@-3 {{value 28958703552 is outside the range of representable 
values}}
 #else
-// expected-warning@-5 {{overflow in expression; result is -1'106'067'520 with 
type 'int'}}
-// expected-warning@-6 {{extension}}
+// expected-warning@-5 {{enumeration types with a fixed underlying type are a 
C++11 extension}}
+// expected-warning@-6 {{overflow in expression; result is -1'106'067'520 with 
type 'int'}}
+// expected-warning@-7 {{expression is not an integral constant expression; 
folding it to a constant is a GNU extension}}
+// expected-note@-8 {{value 28958703552 is outside the range of representable 
values of type 'int'}}
 #endif
 
 // PR28903
diff --git a/clang/test/SemaCXX/shift.cpp b/clang/test/SemaCXX/shift.cpp
index 89a98791d3eba..6367e6d2f250b 100644
--- a/clang/test/SemaCXX/shift.cpp
+++ b/clang/test/SemaCXX/shift.cpp
@@ -22,7 +22,7 @@ void test() {
   c = 1 << -1; // expected-warning {{shift count is negative}}
   c = 1 >> -1; // expected-warning {{shift count is negative}}
   c = 1 << (unsigned)-1; // expected-warning {{shift count >= width of type}}
- // expected-warning@-1 {{implicit conversion}}
+ // expected-warning@-1 {{implicit conversion from 
'int' to 'char' changes value from -2147483648 to 0}}
   c = 1 >> (unsigned)-1; // expected-warning {{shift count >= width of type}}
   c = 1 << c;
   c <<= 0;

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


[clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Add GPU profiling flags to driver (PR #94268)

2024-06-24 Thread Ethan Luis McDonough via cfe-commits

EthanLuisMcDonough wrote:

> Is this something that specifically requires its own flag? Or could we just 
> do `-Xarch_device -fprofile-generate`.

Right now the `-fprofile-generate-gpu` and `-fprofile-instr-generate-gpu` flags 
make sure that the compiler-rt profiling library is included even if host 
profiling isn't enabled, but your suggestion seems quite nice and compact. I'm 
open to looking into this. Thoughts @jdoerfert?

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


[clang] [clang-format] Don't count template template parameter as declaration (PR #96396)

2024-06-24 Thread via cfe-commits

https://github.com/mydeveloperday commented:

Doesn't this show a change in default formatting from

```c++
template  class QQQ>
  class PPP>
void comment_to_html_conversion_22()
```

```c++
template  class QQQ> class PPP>
void comment_to_html_conversion_22()
```
I think the fact that the previous test failed shows more that we have changed 
the default. Is this the change we expect? maybe we could add a unit test to 
assert the new behavior if that is desired

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


[jenkins-infra/account-app] ae2b8e: Update dependency io.github.bonigarcia:webdriverma...

2024-06-24 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/heads/renovate/io.github.bonigarcia-webdrivermanager-5.x
  Home:   https://github.com/jenkins-infra/account-app
  Commit: ae2b8e33dd2147e95c033cb4891c198bf37994d4
  
https://github.com/jenkins-infra/account-app/commit/ae2b8e33dd2147e95c033cb4891c198bf37994d4
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
M build.gradle.kts

  Log Message:
  ---
  Update dependency io.github.bonigarcia:webdrivermanager to v5.9.0



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkins-infra/account-app/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/account-app/push/refs/heads/renovate/io.github.bonigarcia-webdrivermanager-5.x/00-ae2b8e%40github.com.


[clang-tools-extra] [clang-tidy] align all help message in run-clang-tidy (PR #96199)

2024-06-24 Thread Congcong Cai via cfe-commits
 | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py 
b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
index a2c8e4f8dc52b..6e7cc8a873a22 100755
--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
@@ -261,20 +261,20 @@ def main():
 parser.add_argument(
 "-allow-enabling-alpha-checkers",
 action="store_true",
-help="allow alpha checkers from clang-analyzer.",
+help="Allow alpha checkers from clang-analyzer.",
 )
 parser.add_argument(
-"-clang-tidy-binary", metavar="PATH", help="path to clang-tidy binary."
+"-clang-tidy-binary", metavar="PATH", help="Path to clang-tidy binary."
 )
 parser.add_argument(
 "-clang-apply-replacements-binary",
 metavar="PATH",
-help="path to clang-apply-replacements binary.",
+help="Path to clang-apply-replacements binary.",
 )
 parser.add_argument(
 "-checks",
 default=None,
-help="checks filter, when not specified, use clang-tidy default.",
+help="Checks filter, when not specified, use clang-tidy default.",
 )
 config_group = parser.add_mutually_exclusive_group()
 config_group.add_argument(
@@ -307,7 +307,7 @@ def main():
 parser.add_argument(
 "-header-filter",
 default=None,
-help="regular expression matching the names of the "
+    help="Regular expression matching the names of the "
     "headers to output diagnostics from. Diagnostics from "
 "the main file of each translation unit are always "
 "displayed.",
@@ -347,13 +347,13 @@ def main():
 "-j",
 type=int,
 default=0,
-help="number of tidy instances to be run in parallel.",
+help="Number of tidy instances to be run in parallel.",
 )
 parser.add_argument(
 "files",
 nargs="*",
 default=[".*"],
-help="files to be processed (regex on path).",
+help="Files to be processed (regex on path).",
 )
 parser.add_argument("-fix", action="store_true", help="apply fix-its.")
 parser.add_argument(

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


01/02: gnu: python-maxminddb: Update to 2.6.2.

2024-06-24 Thread guix-commits
jgart pushed a commit to branch master
in repository guix.

commit adf841fe3aeb2e3bdf2532a42251e5eba9664dcf
Author: Wilko Meyer 
AuthorDate: Mon Jun 24 00:01:34 2024 +0200

gnu: python-maxminddb: Update to 2.6.2.

* gnu/packages/geo.scm (python-maxminddb): Update to 2.6.2.
  [build-system]: Change to pyproject-build-system.

Change-Id: I824468160fef695a8fb9e517b9d91c90da9a2897
Signed-off-by: jgart 
---
 gnu/packages/geo.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 69e7b58677..0fad220f1c 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -2375,15 +2375,15 @@ associated with an address.")
 (define-public python-maxminddb
   (package
 (name "python-maxminddb")
-(version "2.2.0")
+(version "2.6.2")
 (source
  (origin
(method url-fetch)
(uri (pypi-uri "maxminddb" version))
(sha256
 (base32
- "1rc4a403r3b4vhmhb03gidd0fmsbvfpbf3qfcw25h4db9zn0fxz3"
-(build-system python-build-system)
+ "0r7jcqzr3hy9jims0ygjdhndysbs02hsaybx9f4vq2k2w8r2v13x"
+(build-system pyproject-build-system)
 (arguments
  `(#:tests? #f)) ;; Tests require a copy of the maxmind database
 (inputs



02/02: gnu: python-geoip2: Update to 4.8.0.

2024-06-24 Thread guix-commits
jgart pushed a commit to branch master
in repository guix.

commit d6211a9a71b4c5affb9a7e96b6d954ed5a4588cc
Author: Wilko Meyer 
AuthorDate: Mon Jun 24 00:01:35 2024 +0200

gnu: python-geoip2: Update to 4.8.0.

* gnu/packages/geo.scm (python-geoip2): Update to 4.8.0.
  [build-system]: Change to pyproject-build-system.
  [inputs]: Add python-aiohttp.

Change-Id: Ie5f4a6f99a8cb1bef562c6d2401391f6467a715d
Signed-off-by: jgart 
---
 gnu/packages/geo.scm | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 0fad220f1c..1146939408 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -2398,19 +2398,21 @@ MaxMind DB files.")
 (define-public python-geoip2
   (package
 (name "python-geoip2")
-(version "2.9.0")
+(version "4.8.0")
 (source
  (origin
(method url-fetch)
(uri (pypi-uri "geoip2" version))
(sha256
 (base32
- "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"
-(build-system python-build-system)
+ "0ddcm6a0f5xr66r84hpn6jr6b7hl77axb0d41qj285ylny0c376x"
+(build-system pyproject-build-system)
 (arguments
  `(#:tests? #f)) ;; Tests require a copy of the maxmind database
 (inputs
- (list python-maxminddb python-requests))
+ (list python-maxminddb
+   python-requests
+   python-aiohttp))
 (home-page "https://www.maxmind.com/;)
 (synopsis "MaxMind GeoIP2 API")
 (description "Provides an API for the GeoIP2 web services and databases.



branch master updated (831001c581 -> d6211a9a71)

2024-06-24 Thread guix-commits
jgart pushed a change to branch master
in repository guix.

from 831001c581 gnu: patch: Update to latest commit [security fixes].
 new adf841fe3a gnu: python-maxminddb: Update to 2.6.2.
 new d6211a9a71 gnu: python-geoip2: Update to 4.8.0.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/packages/geo.scm | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)



[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits


@@ -1130,7 +1130,8 @@ INSTANTIATE_TEST_SUITE_P(
  AArch64::AEK_MTE, AArch64::AEK_SSBS,
  AArch64::AEK_FP16,AArch64::AEK_FP16FML,
  AArch64::AEK_SB,  AArch64::AEK_JSCVT,
- AArch64::AEK_FCMA,AArch64::AEK_PERFMON}),
+ AArch64::AEK_FCMA,AArch64::AEK_PERFMON,
+ AArch64::AEK_ETE, AArch64::AEK_AM}),

tmatheson-arm wrote:

I notice there are no tests for `--print-enabled-extensions` for individual 
CPUs. Can we now remove these from `TargetParserTest`, which is quite annoying 
to keep updated, and instead add lit tests for these CPUs which can be 
autogenerated? Maybe in a follow up PR.

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


[clang-tools-extra] [clang-tidy] add fixhint for misc-use-internal-linkage (PR #96203)

2024-06-24 Thread Congcong Cai via cfe-commits
44b 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-var.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-var.cpp
@@ -1,4 +1,6 @@
 // RUN: %check_clang_tidy %s misc-use-internal-linkage %t -- -- 
-I%S/Inputs/use-internal-linkage
+// RUN: %check_clang_tidy %s misc-use-internal-linkage %t -- \
+// RUN:   -config="{CheckOptions: {misc-use-internal-linkage.FixMode: 
'UseStatic'}}"  -- -I%S/Inputs/use-internal-linkage
 
 #include "var.h"
 

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


[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-24 Thread Michael Buch via cfe-commits

https://github.com/Michael137 updated 
https://github.com/llvm/llvm-project/pull/96422

>From f5938919b3a0060db6b373bead1c52f4bb65c841 Mon Sep 17 00:00:00 2001
From: Michael Buch 
Date: Fri, 21 Jun 2024 12:15:07 +0100
Subject: [PATCH 1/4] [clang][CGRecordLayout] Remove dependency on isZeroSize

This is a follow-up from the conversation starting at
https://github.com/llvm/llvm-project/pull/93809#issuecomment-2173729801

The root problem that motivated the change are external AST
sources that compute `ASTRecordLayout`s themselves instead of
letting Clang compute them from the AST. One such examples is
LLDB using DWARF to get the definitive offsets and sizes of C++
structures. Such layouts should be considered correct (modulo
buggy DWARF), but various assertions and lowering logic around
the `CGRecordLayoutBuilder` relies on the AST having
`[[no_unique_address]]` attached to them. This is a layout-altering
attribute which is not encoded in DWARF. This causes us LLDB to trip
over the various LLVM<->Clang layout consistency checks. There has been
precedent for avoiding such layout-altering attributes to affect
lowering with externally-provided layouts (e.g., packed structs).

This patch proposes to replace the `isZeroSize` checks in
`CGRecordLayoutBuilder` (which roughly means "empty field
with [[no_unique_address]]") with checks for
`CodeGen::isEmptyField`/`CodeGen::isEmptyRecord`.
---
 clang/lib/CodeGen/ABIInfoImpl.cpp |  6 ++---
 clang/lib/CodeGen/ABIInfoImpl.h   |  6 ++---
 clang/lib/CodeGen/CGExpr.cpp  |  3 ++-
 clang/lib/CodeGen/CGRecordLayoutBuilder.cpp   | 14 ++--
 clang/test/CodeGen/X86/x86_64-vaarg.c |  3 ++-
 clang/test/CodeGen/debug-info-packed-struct.c |  2 +-
 clang/test/CodeGen/paren-list-agg-init.cpp| 15 +
 .../CodeGenCXX/2011-12-19-init-list-ctor.cpp  |  6 ++---
 clang/test/CodeGenCXX/auto-var-init.cpp   | 10 -
 .../test/CodeGenCXX/bitfield-access-empty.cpp | 16 +++---
 clang/test/CodeGenCXX/class-layout.cpp|  2 +-
 clang/test/CodeGenCXX/compound-literals.cpp   |  2 +-
 clang/test/CodeGenCXX/exceptions.cpp  |  7 +++---
 .../lambda-deterministic-captures.cpp |  4 +---
 clang/test/CodeGenCXX/ms_struct.cpp   |  4 +---
 clang/test/CodeGenCXX/partial-destruction.cpp | 11 --
 clang/test/CodeGenCXX/pr18962.cpp |  5 ++---
 clang/test/CodeGenCXX/references.cpp  |  4 +---
 clang/test/CodeGenCXX/temporaries.cpp | 12 +-
 clang/test/CodeGenObjCXX/lambda-to-block.mm   |  9 
 clang/test/OpenMP/irbuilder_for_iterator.cpp  | 10 -
 clang/test/OpenMP/irbuilder_for_rangefor.cpp  | 14 +---
 .../test/OpenMP/task_member_call_codegen.cpp  | 22 ---
 clang/test/Sema/ms_class_layout.cpp   | 14 ++--
 24 files changed, 85 insertions(+), 116 deletions(-)

diff --git a/clang/lib/CodeGen/ABIInfoImpl.cpp 
b/clang/lib/CodeGen/ABIInfoImpl.cpp
index e9a26abb77837..92fcc3bc2c5f4 100644
--- a/clang/lib/CodeGen/ABIInfoImpl.cpp
+++ b/clang/lib/CodeGen/ABIInfoImpl.cpp
@@ -248,7 +248,7 @@ Address CodeGen::emitMergePHI(CodeGenFunction , Address 
Addr1,
   return Address(PHI, Addr1.getElementType(), Align);
 }
 
-bool CodeGen::isEmptyField(ASTContext , const FieldDecl *FD,
+bool CodeGen::isEmptyField(const ASTContext , const FieldDecl *FD,
bool AllowArrays, bool AsIfNoUniqueAddr) {
   if (FD->isUnnamedBitField())
 return true;
@@ -289,8 +289,8 @@ bool CodeGen::isEmptyField(ASTContext , const 
FieldDecl *FD,
   return isEmptyRecord(Context, FT, AllowArrays, AsIfNoUniqueAddr);
 }
 
-bool CodeGen::isEmptyRecord(ASTContext , QualType T, bool AllowArrays,
-bool AsIfNoUniqueAddr) {
+bool CodeGen::isEmptyRecord(const ASTContext , QualType T,
+bool AllowArrays, bool AsIfNoUniqueAddr) {
   const RecordType *RT = T->getAs();
   if (!RT)
 return false;
diff --git a/clang/lib/CodeGen/ABIInfoImpl.h b/clang/lib/CodeGen/ABIInfoImpl.h
index 92986fb431646..e3f373e39c35a 100644
--- a/clang/lib/CodeGen/ABIInfoImpl.h
+++ b/clang/lib/CodeGen/ABIInfoImpl.h
@@ -126,15 +126,15 @@ Address emitMergePHI(CodeGenFunction , Address Addr1,
 /// is an unnamed bit-field or an (array of) empty record(s). If
 /// AsIfNoUniqueAddr is true, then C++ record fields are considered empty if
 /// the [[no_unique_address]] attribute would have made them empty.
-bool isEmptyField(ASTContext , const FieldDecl *FD, bool AllowArrays,
-  bool AsIfNoUniqueAddr = false);
+bool isEmptyField(const ASTContext , const FieldDecl *FD,
+  bool AllowArrays, bool AsIfNoUniqueAddr = false);
 
 /// isEmptyRecord - Return true iff a structure contains only empty
 /// fields. Note that a structure with a flexible array member is not
 /// considered empty. If AsIfNoUniqueAddr is true, then C++ record fields are
 /// considered empty if the 

[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-24 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: None (antangelo)


Changes

Fixes ICE when compiling preserve_nonecc functions on Windows and adds support 
for the calling convention on AArch64 for Windows targets.

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


4 Files Affected:

- (modified) clang/lib/AST/MicrosoftMangle.cpp (+7-1) 
- (modified) clang/lib/Basic/Targets/AArch64.cpp (+1) 
- (added) clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp (+28) 
- (modified) clang/test/Sema/preserve-none-call-conv.c (+1) 


``diff
diff --git a/clang/lib/AST/MicrosoftMangle.cpp 
b/clang/lib/AST/MicrosoftMangle.cpp
index 3923d34274703..b49a96f105cfb 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -2962,7 +2962,10 @@ void 
MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) {
   //  ::= J # __export __fastcall
   //  ::= Q # __vectorcall
   //  ::= S # __attribute__((__swiftcall__)) // Clang-only
-  //  ::= T # __attribute__((__swiftasynccall__))
+  //  ::= W # __attribute__((__swiftasynccall__))
+  //  ::= U # __attribute__((__preserve_most__))
+  //  ::= V # __attribute__((__preserve_none__)) //
+  //  Clang-only
   //// Clang-only
   //  ::= w # __regcall
   //  ::= x # __regcall4
@@ -2986,6 +2989,9 @@ void 
MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) {
 case CC_Swift: Out << 'S'; break;
 case CC_SwiftAsync: Out << 'W'; break;
 case CC_PreserveMost: Out << 'U'; break;
+case CC_PreserveNone:
+  Out << 'V';
+  break;
 case CC_X86RegCall:
   if (getASTContext().getLangOpts().RegCall4)
 Out << "x";
diff --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index 31d8121b91d10..2692ddec26ff4 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -1536,6 +1536,7 @@ 
WindowsARM64TargetInfo::checkCallingConvention(CallingConv CC) const {
   case CC_OpenCLKernel:
   case CC_PreserveMost:
   case CC_PreserveAll:
+  case CC_PreserveNone:
   case CC_Swift:
   case CC_SwiftAsync:
   case CC_Win64:
diff --git a/clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp 
b/clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp
new file mode 100644
index 0..29df5e4d84a70
--- /dev/null
+++ b/clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -fdeclspec -emit-llvm 
%s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc -fdeclspec -emit-llvm 
%s -o - | FileCheck %s
+
+void __attribute__((__preserve_none__)) f() {}
+// CHECK-DAG: @"?f@@YVXXZ"
+
+void (__attribute__((__preserve_none__)) *p)();
+// CHECK-DAG: @"?p@@3P6VXXZEA
+
+namespace {
+void __attribute__((__preserve_none__)) __attribute__((__used__)) f() { }
+}
+// CHECK-DAG: @"?f@?A0x{{[^@]*}}@@YVXXZ"
+
+namespace n {
+void __attribute__((__preserve_none__)) f() {}
+}
+// CHECK-DAG: @"?f@n@@YVXXZ"
+
+struct __declspec(dllexport) S {
+  S(const S &) = delete;
+  S & operator=(const S &) = delete;
+  void __attribute__((__preserve_none__)) m() { }
+};
+// CHECK-DAG: @"?m@S@@QEAVXXZ"
+
+void f(void (__attribute__((__preserve_none__))())) {}
+// CHECK-DAG: @"?f@@YAXP6VXXZ@Z"
diff --git a/clang/test/Sema/preserve-none-call-conv.c 
b/clang/test/Sema/preserve-none-call-conv.c
index 4508095863de5..678fa7d5317e5 100644
--- a/clang/test/Sema/preserve-none-call-conv.c
+++ b/clang/test/Sema/preserve-none-call-conv.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 %s -fsyntax-only -triple x86_64-unknown-unknown -verify
+// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-unknown-unknown -verify
 
 typedef void typedef_fun_t(int);
 

``




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


[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-24 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-backend-aarch64

Author: None (antangelo)


Changes

Fixes ICE when compiling preserve_nonecc functions on Windows and adds support 
for the calling convention on AArch64 for Windows targets.

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


4 Files Affected:

- (modified) clang/lib/AST/MicrosoftMangle.cpp (+7-1) 
- (modified) clang/lib/Basic/Targets/AArch64.cpp (+1) 
- (added) clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp (+28) 
- (modified) clang/test/Sema/preserve-none-call-conv.c (+1) 


``diff
diff --git a/clang/lib/AST/MicrosoftMangle.cpp 
b/clang/lib/AST/MicrosoftMangle.cpp
index 3923d34274703..b49a96f105cfb 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -2962,7 +2962,10 @@ void 
MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) {
   //  ::= J # __export __fastcall
   //  ::= Q # __vectorcall
   //  ::= S # __attribute__((__swiftcall__)) // Clang-only
-  //  ::= T # __attribute__((__swiftasynccall__))
+  //  ::= W # __attribute__((__swiftasynccall__))
+  //  ::= U # __attribute__((__preserve_most__))
+  //  ::= V # __attribute__((__preserve_none__)) //
+  //  Clang-only
   //// Clang-only
   //  ::= w # __regcall
   //  ::= x # __regcall4
@@ -2986,6 +2989,9 @@ void 
MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) {
 case CC_Swift: Out << 'S'; break;
 case CC_SwiftAsync: Out << 'W'; break;
 case CC_PreserveMost: Out << 'U'; break;
+case CC_PreserveNone:
+  Out << 'V';
+  break;
 case CC_X86RegCall:
   if (getASTContext().getLangOpts().RegCall4)
 Out << "x";
diff --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index 31d8121b91d10..2692ddec26ff4 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -1536,6 +1536,7 @@ 
WindowsARM64TargetInfo::checkCallingConvention(CallingConv CC) const {
   case CC_OpenCLKernel:
   case CC_PreserveMost:
   case CC_PreserveAll:
+  case CC_PreserveNone:
   case CC_Swift:
   case CC_SwiftAsync:
   case CC_Win64:
diff --git a/clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp 
b/clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp
new file mode 100644
index 0..29df5e4d84a70
--- /dev/null
+++ b/clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -fdeclspec -emit-llvm 
%s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc -fdeclspec -emit-llvm 
%s -o - | FileCheck %s
+
+void __attribute__((__preserve_none__)) f() {}
+// CHECK-DAG: @"?f@@YVXXZ"
+
+void (__attribute__((__preserve_none__)) *p)();
+// CHECK-DAG: @"?p@@3P6VXXZEA
+
+namespace {
+void __attribute__((__preserve_none__)) __attribute__((__used__)) f() { }
+}
+// CHECK-DAG: @"?f@?A0x{{[^@]*}}@@YVXXZ"
+
+namespace n {
+void __attribute__((__preserve_none__)) f() {}
+}
+// CHECK-DAG: @"?f@n@@YVXXZ"
+
+struct __declspec(dllexport) S {
+  S(const S &) = delete;
+  S & operator=(const S &) = delete;
+  void __attribute__((__preserve_none__)) m() { }
+};
+// CHECK-DAG: @"?m@S@@QEAVXXZ"
+
+void f(void (__attribute__((__preserve_none__))())) {}
+// CHECK-DAG: @"?f@@YAXP6VXXZ@Z"
diff --git a/clang/test/Sema/preserve-none-call-conv.c 
b/clang/test/Sema/preserve-none-call-conv.c
index 4508095863de5..678fa7d5317e5 100644
--- a/clang/test/Sema/preserve-none-call-conv.c
+++ b/clang/test/Sema/preserve-none-call-conv.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 %s -fsyntax-only -triple x86_64-unknown-unknown -verify
+// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-unknown-unknown -verify
 
 typedef void typedef_fun_t(int);
 

``




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


[clang] [MS ABI]: Support preserve_none in MS ABI (PR #96487)

2024-06-24 Thread via cfe-commits

https://github.com/antangelo created 
https://github.com/llvm/llvm-project/pull/96487

Fixes ICE when compiling preserve_nonecc functions on Windows and adds support 
for the calling convention on AArch64 for Windows targets.

>From 1e95098e324860268d55e72a14090f9524c7dde1 Mon Sep 17 00:00:00 2001
From: Antonio Abbatangelo 
Date: Mon, 24 Jun 2024 09:49:28 -0400
Subject: [PATCH] [MS ABI]: Support preserve_none in MS ABI

---
 clang/lib/AST/MicrosoftMangle.cpp |  8 +-
 clang/lib/Basic/Targets/AArch64.cpp   |  1 +
 .../CodeGenCXX/msabi-preserve-none-cc.cpp | 28 +++
 clang/test/Sema/preserve-none-call-conv.c |  1 +
 4 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp

diff --git a/clang/lib/AST/MicrosoftMangle.cpp 
b/clang/lib/AST/MicrosoftMangle.cpp
index 3923d34274703..b49a96f105cfb 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -2962,7 +2962,10 @@ void 
MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) {
   //  ::= J # __export __fastcall
   //  ::= Q # __vectorcall
   //  ::= S # __attribute__((__swiftcall__)) // Clang-only
-  //  ::= T # __attribute__((__swiftasynccall__))
+  //  ::= W # __attribute__((__swiftasynccall__))
+  //  ::= U # __attribute__((__preserve_most__))
+  //  ::= V # __attribute__((__preserve_none__)) //
+  //  Clang-only
   //// Clang-only
   //  ::= w # __regcall
   //  ::= x # __regcall4
@@ -2986,6 +2989,9 @@ void 
MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) {
 case CC_Swift: Out << 'S'; break;
 case CC_SwiftAsync: Out << 'W'; break;
 case CC_PreserveMost: Out << 'U'; break;
+case CC_PreserveNone:
+  Out << 'V';
+  break;
 case CC_X86RegCall:
   if (getASTContext().getLangOpts().RegCall4)
 Out << "x";
diff --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index 31d8121b91d10..2692ddec26ff4 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -1536,6 +1536,7 @@ 
WindowsARM64TargetInfo::checkCallingConvention(CallingConv CC) const {
   case CC_OpenCLKernel:
   case CC_PreserveMost:
   case CC_PreserveAll:
+  case CC_PreserveNone:
   case CC_Swift:
   case CC_SwiftAsync:
   case CC_Win64:
diff --git a/clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp 
b/clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp
new file mode 100644
index 0..29df5e4d84a70
--- /dev/null
+++ b/clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -fdeclspec -emit-llvm 
%s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc -fdeclspec -emit-llvm 
%s -o - | FileCheck %s
+
+void __attribute__((__preserve_none__)) f() {}
+// CHECK-DAG: @"?f@@YVXXZ"
+
+void (__attribute__((__preserve_none__)) *p)();
+// CHECK-DAG: @"?p@@3P6VXXZEA
+
+namespace {
+void __attribute__((__preserve_none__)) __attribute__((__used__)) f() { }
+}
+// CHECK-DAG: @"?f@?A0x{{[^@]*}}@@YVXXZ"
+
+namespace n {
+void __attribute__((__preserve_none__)) f() {}
+}
+// CHECK-DAG: @"?f@n@@YVXXZ"
+
+struct __declspec(dllexport) S {
+  S(const S &) = delete;
+  S & operator=(const S &) = delete;
+  void __attribute__((__preserve_none__)) m() { }
+};
+// CHECK-DAG: @"?m@S@@QEAVXXZ"
+
+void f(void (__attribute__((__preserve_none__))())) {}
+// CHECK-DAG: @"?f@@YAXP6VXXZ@Z"
diff --git a/clang/test/Sema/preserve-none-call-conv.c 
b/clang/test/Sema/preserve-none-call-conv.c
index 4508095863de5..678fa7d5317e5 100644
--- a/clang/test/Sema/preserve-none-call-conv.c
+++ b/clang/test/Sema/preserve-none-call-conv.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 %s -fsyntax-only -triple x86_64-unknown-unknown -verify
+// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-unknown-unknown -verify
 
 typedef void typedef_fun_t(int);
 

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits


@@ -154,17 +156,39 @@ std::optional 
AArch64::parseCpu(StringRef Name) {
   return {};
 }
 
-void AArch64::PrintSupportedExtensions(StringMap DescMap) {
+void AArch64::PrintSupportedExtensions() {
   outs() << "All available -march extensions for AArch64\n\n"
  << "" << left_justify("Name", 20)
- << (DescMap.empty() ? "\n" : "Description\n");
+ << left_justify("Architecture Feature(s)", 55)
+ << "Description\n";
   for (const auto  : Extensions) {
 // Extensions without a feature cannot be used with -march.
-if (!Ext.Feature.empty()) {
-  std::string Description = DescMap[Ext.Name].str();
+if (!Ext.UserVisibleName.empty() && !Ext.PosTargetFeature.empty()) {
+  outs() << ""
+ << format(Ext.Description.empty() ? "%-20s%s\n" : 
"%-20s%-55s%s\n",
+   Ext.UserVisibleName.str().c_str(),
+   Ext.ArchFeatureName.str().c_str(),
+   Ext.Description.str().c_str());
+}
+  }
+}
+
+void
+AArch64::printEnabledExtensions(std::vector EnabledFeatureNames) {
+  outs() << "Extensions enabled for the given AArch64 target\n\n"
+ << "" << left_justify("Architecture Feature(s)", 55)
+ << "Description\n";
+  auto IsEnabled = [&](const ExtensionInfo ) {
+StringRef FeatureName = Ext.PosTargetFeature.drop_front(); // drop '+' 
before comparing

tmatheson-arm wrote:

Can you ever have a negative feature here?

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits


@@ -19,3 +19,17 @@
 // RUN: %clang --target=arm64 -mlittle-endian -march=armv8.1a -### -c %s 2>&1 
| FileCheck -check-prefix=ARM64-GENERICV81A %s
 // RUN: %clang --target=arm64 -mlittle-endian -march=armv8.1-a -### -c %s 2>&1 
| FileCheck -check-prefix=ARM64-GENERICV81A %s
 // ARM64-GENERICV81A: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" 
"generic"{{.*}} "-target-feature" "+v8.1a"{{.*}} "-target-feature" "+neon"
+
+// = Architecture extensions =
+
+// RUN: %clang -target aarch64 -march=armv8.1-a --print-enabled-extensions 
2>&1 | sort | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ 
%s

tmatheson-arm wrote:

I don't think any of the `2>&1` are necessary, because you print to `outs()` 
(which is good).

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits


@@ -19,3 +19,17 @@
 // RUN: %clang --target=arm64 -mlittle-endian -march=armv8.1a -### -c %s 2>&1 
| FileCheck -check-prefix=ARM64-GENERICV81A %s
 // RUN: %clang --target=arm64 -mlittle-endian -march=armv8.1-a -### -c %s 2>&1 
| FileCheck -check-prefix=ARM64-GENERICV81A %s
 // ARM64-GENERICV81A: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" 
"generic"{{.*}} "-target-feature" "+v8.1a"{{.*}} "-target-feature" "+neon"
+
+// = Architecture extensions =
+
+// RUN: %clang -target aarch64 -march=armv8.1-a --print-enabled-extensions 
2>&1 | sort | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ 
%s

tmatheson-arm wrote:

Why not sort the extensions in the actual output, rather than just in the test? 
Currently they are not in any particular order, which will make reading the 
output difficult when there are a lot.

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits


@@ -14,23 +14,36 @@
 class Extension<

tmatheson-arm wrote:

The comment needs updating, something like:
> A SubtargetFeature that represents one or more Architecture Extensions, as 
> defined in the Arm ARM and typically named `FEAT_*`. Each has an `AEK_*` 
> entry in the ArmExtKind enum.

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits


@@ -161,6 +162,39 @@ static int PrintSupportedExtensions(std::string TargetStr) 
{
   return 0;
 }
 
+static int PrintEnabledExtensions(const TargetOptions& TargetOpts) {
+  std::string Error;
+  const llvm::Target *TheTarget =
+  llvm::TargetRegistry::lookupTarget(TargetOpts.Triple, Error);
+  if (!TheTarget) {
+llvm::errs() << Error;
+return 1;
+  }
+
+  llvm::TargetOptions BackendOptions;

tmatheson-arm wrote:

What is the difference between this and `TargetOpts`? This section maybe needs 
a comment explaining what is going on.

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits


@@ -116,12 +116,18 @@ using ExtensionBitset = Bitset;
 // SubtargetFeature which may represent either an actual extension or some
 // internal LLVM property.
 struct ExtensionInfo {
-  StringRef Name; // Human readable name, e.g. "profile".
+  StringRef UserVisibleName;  // Human readable name used in -march, -cpu

tmatheson-arm wrote:

Please could you make the names here consistent with tablegen, i.e. either pick 
`UserVisibleName` or `MArchName`.

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits


@@ -154,17 +156,39 @@ std::optional 
AArch64::parseCpu(StringRef Name) {
   return {};
 }
 
-void AArch64::PrintSupportedExtensions(StringMap DescMap) {
+void AArch64::PrintSupportedExtensions() {
   outs() << "All available -march extensions for AArch64\n\n"
  << "" << left_justify("Name", 20)
- << (DescMap.empty() ? "\n" : "Description\n");
+ << left_justify("Architecture Feature(s)", 55)
+ << "Description\n";
   for (const auto  : Extensions) {
 // Extensions without a feature cannot be used with -march.
-if (!Ext.Feature.empty()) {
-  std::string Description = DescMap[Ext.Name].str();
+if (!Ext.UserVisibleName.empty() && !Ext.PosTargetFeature.empty()) {
+  outs() << ""
+ << format(Ext.Description.empty() ? "%-20s%s\n" : 
"%-20s%-55s%s\n",
+   Ext.UserVisibleName.str().c_str(),
+   Ext.ArchFeatureName.str().c_str(),
+   Ext.Description.str().c_str());
+}
+  }
+}
+
+void
+AArch64::printEnabledExtensions(std::vector EnabledFeatureNames) {
+  outs() << "Extensions enabled for the given AArch64 target\n\n"
+ << "" << left_justify("Architecture Feature(s)", 55)
+ << "Description\n";
+  auto IsEnabled = [&](const ExtensionInfo ) {
+StringRef FeatureName = Ext.PosTargetFeature.drop_front(); // drop '+' 
before comparing
+return std::find(EnabledFeatureNames.begin(), EnabledFeatureNames.end(),
+ FeatureName) != EnabledFeatureNames.end();

tmatheson-arm wrote:

Can you use `targetFeatureToExtension` here, to avoid the double loop?

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits


@@ -1841,7 +1868,8 @@ INSTANTIATE_TEST_SUITE_P(
  AArch64::AEK_PROFILE, AArch64::AEK_RAND,
  AArch64::AEK_FP16FML, AArch64::AEK_I8MM,
  AArch64::AEK_JSCVT,   AArch64::AEK_FCMA,
- AArch64::AEK_PAUTH,   AArch64::AEK_PERFMON}),
+ AArch64::AEK_PAUTH,   AArch64::AEK_PERFMON,
+ AArch64::AEK_CCDP}),

tmatheson-arm wrote:

We should think about whether we want each AEK to correspond to a `-march` 
modifier (status quo) or whether we want it to correspond to an `Extension` 
like here.

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits

https://github.com/tmatheson-arm commented:

LGTM, just some minor suggestions/clarifications.

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits


@@ -14,23 +14,36 @@
 class Extension<
   string TargetFeatureName,// String used for -target-feature and 
-march, unless overridden.
   string Spelling, // The XYZ in HasXYZ and AEK_XYZ.
+  string ArchitectureFeatureName,  // The extension's "FEAT_*"" name(s) 
defined by the architecture
   string Desc, // Description.
   list Implies = []  // List of dependent features.
 > : SubtargetFeature Implies>
 {
 string ArchExtKindSpelling = "AEK_" # Spelling; // ArchExtKind enum name.
 
-// In general, the name written on the command line should match the name
-// used for -target-feature. However, there are exceptions. Therefore we
-// add a separate field for this, to allow overriding it. Strongly prefer
-// not doing so.
-string MArchName = TargetFeatureName;
+string ArchFeatureName = ArchitectureFeatureName;
+
+// By default, extensions are available as -march/-cpu command line 
options.
+string MArchName = "";
 
 // An alias that can be used on the command line, if the extension has one.
 // Used for correcting historical names while remaining backwards 
compatible.
 string MArchAlias = "";
 }
 
+class ExtensionWithMArch<

tmatheson-arm wrote:

```suggestion
// An Extension that can be enabled via a `-march` modifier or target 
attribute, e.g. `+sm4`
class ExtensionWithMArch<
```

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits


@@ -161,6 +162,39 @@ static int PrintSupportedExtensions(std::string TargetStr) 
{
   return 0;
 }
 
+static int PrintEnabledExtensions(const TargetOptions& TargetOpts) {
+  std::string Error;
+  const llvm::Target *TheTarget =
+  llvm::TargetRegistry::lookupTarget(TargetOpts.Triple, Error);
+  if (!TheTarget) {
+llvm::errs() << Error;
+return 1;
+  }
+
+  llvm::TargetOptions BackendOptions;
+  std::string FeaturesStr = llvm::join(TargetOpts.FeaturesAsWritten, ",");
+  std::unique_ptr TheTargetMachine(
+  TheTarget->createTargetMachine(TargetOpts.Triple, TargetOpts.CPU, 
FeaturesStr, BackendOptions, std::nullopt));
+  const llvm::Triple  = TheTargetMachine->getTargetTriple();
+  const llvm::MCSubtargetInfo *MCInfo = TheTargetMachine->getMCSubtargetInfo();
+  const std::vector Features =
+MCInfo->getEnabledProcessorFeatures();
+
+  std::vector EnabledFeatureNames;
+  for (const llvm::SubtargetFeatureKV  : Features)
+EnabledFeatureNames.push_back(feature.Key);

tmatheson-arm wrote:

Maybe we shouldn't throw away the type information in 
`llvm::SubtargetFeatureKV` before `printEnabledExtensions`. It is not clear 
what `EnabledFeatureNames` contains, since it is just a vector of strings. i.e. 
are they internal names, extension names, subtarget feature names, etc.

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


[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

2024-06-24 Thread Tomas Matheson via cfe-commits

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


[Lldb-commits] [lldb] [lldb/DWARF] Remove parsing recursion when searching for definition DIEs (PR #96484)

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

labath wrote:

> Makes sense to me Do we make sure that the type lookup map is updated so we 
> don't re-parse when calling `ParseTypeFromDWARF` with either the declaration 
> or the definition DIE?

Good catch. I've been meaning to add that, but I forgot. Things should still 
work even without the DieToType update, as the type will be caught by the 
UniqueDWARFASTTypeMap, but this is definitely faster.

The way that the definition dies are currently handled is a bit clumsy now, but 
I didn't want to implement anything more elaborate as this should go away once 
we stop eagerly searching for the definition.

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


[clang] 3ff680a - [C11] Claim we do not conform to WG14 N1285 yet

2024-06-24 Thread Aaron Ballman via cfe-commits

Author: Aaron Ballman
Date: 2024-06-24T09:50:37-04:00
New Revision: 3ff680a1a57d74a5c94d3da35594a8046a879888

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

LOG: [C11] Claim we do not conform to WG14 N1285 yet

This also updates the status for C11 to be Partial, and because C17 is
C11 plus DR resolutions, that makes C17 also Partial.

Added: 
clang/test/C/C11/n1285.c

Modified: 
clang/www/c_status.html

Removed: 




diff  --git a/clang/test/C/C11/n1285.c b/clang/test/C/C11/n1285.c
new file mode 100644
index 0..e7a9463e68103
--- /dev/null
+++ b/clang/test/C/C11/n1285.c
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -verify=wrong -std=c99 %s
+// RUN: %clang_cc1 -verify=wrong -std=c11 %s
+// RUN: %clang_cc1 -verify=cpp -std=c++11 -x c++ %s
+
+/* WG14 N1285: No
+ * Extending the lifetime of temporary objects (factored approach)
+ *
+ * NB: we do not properly materialize temporary expressions in situations where
+ * it would be expected; that is why the "no-diagnostics" marking is named
+ * "wrong". We do issue the expected diagnostic in C++ mode.
+ */
+
+// wrong-no-diagnostics
+
+struct X { int a[5]; };
+struct X f(void);
+
+int foo(void) {
+  // FIXME: This diagnostic should be issued in C11 as well (though not in C99,
+  // as this paper was a breaking change between C99 and C11).
+  int *p = f().a; // cpp-warning {{temporary whose address is used as value of 
local variable 'p' will be destroyed at the end of the full-expression}}
+  return *p;
+}
+

diff  --git a/clang/www/c_status.html b/clang/www/c_status.html
index d71d4c216f744..922a84ca34312 100644
--- a/clang/www/c_status.html
+++ b/clang/www/c_status.html
@@ -57,12 +57,12 @@ C Support in Clang
 
  C11
  -std=c11
- Probably
+ Partial
 
 
  C17
  -std=c17
- Maybe?
+ Partial
 
 
  C23
@@ -425,7 +425,7 @@ C11 implementation status
 
   Extending the lifetime of temporary objects (factored approach)
   https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1285.htm;>N1285
-  Unknown
+  No
 
 
   Requiring signed char to have no padding bits



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


[pmd-commits] [pmd/pmd] b3cf14: [core] CPD: Include processing errors in XML report

2024-06-24 Thread Juan Martín Sotuyo Dodero via Pmd-commits
/29983a91a20d6c927671f83f853e03a9e9d617de
  Author: Andreas Dangel 
  Date:   2024-06-23 (Sun, 23 Jun 2024)

  Changed paths:
M pmd-core/src/main/resources/cpd-report_1_0_0.xsd

  Log Message:
  ---
  Fix schema types

Co-authored-by: Juan Martin Sotuyo Dodero 


  Commit: a8ab215010a11bf96394a116f76e7f755695ee60
  https://github.com/pmd/pmd/commit/a8ab215010a11bf96394a116f76e7f755695ee60
  Author: Andreas Dangel 
  Date:   2024-06-23 (Sun, 23 Jun 2024)

  Changed paths:
M pmd-core/src/main/java/net/sourceforge/pmd/cpd/XMLRenderer.java
M pmd-core/src/main/resources/cpd-report_1_0_0.xsd
M pmd-core/src/test/java/net/sourceforge/pmd/cpd/XMLRendererTest.java

  Log Message:
  ---
  Clarify namespace, version, pmdVersion


  Commit: 0340bf0568463b8ee94f7c6761eb6e671e7056b0
  https://github.com/pmd/pmd/commit/0340bf0568463b8ee94f7c6761eb6e671e7056b0
  Author: Andreas Dangel 
  Date:   2024-06-23 (Sun, 23 Jun 2024)

  Changed paths:
M pmd-cli/src/test/java/net/sourceforge/pmd/cli/CpdCliTest.java

  Log Message:
  ---
  [cli] Fix unit test after cpd report change


  Commit: 33f9268cf7fde48dcd713750b4699c461e10d838
  https://github.com/pmd/pmd/commit/33f9268cf7fde48dcd713750b4699c461e10d838
  Author: Andreas Dangel 
  Date:   2024-06-23 (Sun, 23 Jun 2024)

  Changed paths:
M docs/pages/pmd/userdocs/cpd/cpd_report_formats.md
M docs/pages/release_notes.md
M pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java
M pmd-cli/src/test/java/net/sourceforge/pmd/cli/CpdCliTest.java
M pmd-core/etc/xslt/cpdhtml-v2.xslt
M pmd-core/etc/xslt/cpdhtml.xslt
M pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java
A pmd-core/src/main/java/net/sourceforge/pmd/cpd/XMLOldRenderer.java
M pmd-core/src/main/java/net/sourceforge/pmd/cpd/XMLRenderer.java
A pmd-core/src/test/java/net/sourceforge/pmd/cpd/XMLOldRendererTest.java

  Log Message:
  ---
  [core] Provide a backwards compatible XMLOldRenderer as "xmlold"


  Commit: 40bd882f3e721bc7677371dc92aae7bf9ffdd6a6
  https://github.com/pmd/pmd/commit/40bd882f3e721bc7677371dc92aae7bf9ffdd6a6
  Author: Andreas Dangel 
  Date:   2024-06-23 (Sun, 23 Jun 2024)

  Changed paths:
M pmd-core/etc/xslt/cpdhtml-v2.xslt
M pmd-core/etc/xslt/cpdhtml.xslt
M pmd-core/src/test/resources/net/sourceforge/pmd/cpd/SampleCpdReport.xml

  Log Message:
  ---
  Fix cpd xslt sample templates


  Commit: 648e2ebd6acd1071b3782c8f6ecdfdc4fd6ffcf3
  https://github.com/pmd/pmd/commit/648e2ebd6acd1071b3782c8f6ecdfdc4fd6ffcf3
  Author: Juan Martín Sotuyo Dodero 
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
M docs/pages/pmd/userdocs/cpd/cpd_report_formats.md
M docs/pages/release_notes.md
M pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java
M pmd-cli/src/test/java/net/sourceforge/pmd/cli/CpdCliTest.java
M pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/RendererHelper.java
M pmd-core/etc/xslt/cpdhtml-v2.xslt
M pmd-core/etc/xslt/cpdhtml.xslt
M pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java
M pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDReport.java
M pmd-core/src/main/java/net/sourceforge/pmd/cpd/CpdAnalysis.java
M pmd-core/src/main/java/net/sourceforge/pmd/cpd/GUI.java
A pmd-core/src/main/java/net/sourceforge/pmd/cpd/XMLOldRenderer.java
M pmd-core/src/main/java/net/sourceforge/pmd/cpd/XMLRenderer.java
A pmd-core/src/main/resources/cpd-report_1_0_0.xsd
M pmd-core/src/test/java/net/sourceforge/pmd/cpd/CpdAnalysisTest.java
M pmd-core/src/test/java/net/sourceforge/pmd/cpd/CpdTestUtils.java
A pmd-core/src/test/java/net/sourceforge/pmd/cpd/XMLOldRendererTest.java
M pmd-core/src/test/java/net/sourceforge/pmd/cpd/XMLRendererTest.java
M pmd-core/src/test/resources/net/sourceforge/pmd/cpd/SampleCpdReport.xml

  Log Message:
  ---
  Merge pull request #4992 from adangel/cpd-report-processing-errors

[core] CPD: Include processing errors in XML report


Compare: https://github.com/pmd/pmd/compare/c2dc7b3d9b1a...648e2ebd6acd

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


___
Pmd-commits mailing list
Pmd-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmd-commits


[Lldb-commits] [lldb] [lldb/DWARF] Remove parsing recursion when searching for definition DIEs (PR #96484)

2024-06-24 Thread Pavel Labath via lldb-commits
eclContext(die);
+DWARFDIE SymbolFileDWARFDwo::FindDefinitionDIE(const DWARFDIE ) {
+  return GetBaseSymbolFile().FindDefinitionDIE(die);
 }
 
 lldb::TypeSP SymbolFileDWARFDwo::FindCompleteObjCDefinitionTypeForDIE(
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h 
b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
index 1500540424b52..690fe62f68926 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -76,8 +76,7 @@ class SymbolFileDWARFDwo : public SymbolFileDWARF {
 
   UniqueDWARFASTTypeMap () override;
 
-  lldb::TypeSP
-  FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) override;
+  DWARFDIE FindDefinitionDIE(const DWARFDIE ) override;
 
   lldb::TypeSP
   FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE ,

>From 683d881886908f64355f2312122c58fc05981818 Mon Sep 17 00:00:00 2001
From: Pavel Labath 
Date: Mon, 24 Jun 2024 15:46:01 +0200
Subject: [PATCH 2/2] update dietotype

---
 .../SymbolFile/DWARF/DWARFASTParserClang.cpp  | 37 +++
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index ad58e0cbb5a59..f36e2af9589b8 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -898,19 +898,22 @@ TypeSP DWARFASTParserClang::ParseEnum(const SymbolContext 
,
   attrs.name.GetStringRef(), GetClangDeclContextContainingDIE(def_die, 
nullptr),
   GetOwningClangModule(def_die), attrs.decl, enumerator_clang_type,
   attrs.is_scoped_enum);
-
-  clang::DeclContext *type_decl_ctx =
-  TypeSystemClang::GetDeclContextForType(clang_type);
-  LinkDeclContextToDIE(type_decl_ctx, def_die);
-  if (decl_die != def_die)
-LinkDeclContextToDIE(type_decl_ctx, decl_die);
-
   TypeSP type_sp =
   dwarf->MakeType(def_die.GetID(), attrs.name, attrs.byte_size, nullptr,
   attrs.type.Reference().GetID(), Type::eEncodingIsUID,
   , clang_type, Type::ResolveState::Forward,
   TypePayloadClang(GetOwningClangModule(def_die)));
 
+  clang::DeclContext *type_decl_ctx =
+  TypeSystemClang::GetDeclContextForType(clang_type);
+  LinkDeclContextToDIE(type_decl_ctx, decl_die);
+  if (decl_die != def_die) {
+LinkDeclContextToDIE(type_decl_ctx, def_die);
+dwarf->GetDIEToType()[def_die.GetDIE()] = type_sp.get();
+// Declaration DIE is inserted into the type map in ParseTypeFromDWARF
+  }
+
+
   if (TypeSystemClang::StartTagDeclarationDefinition(clang_type)) {
 if (def_die.HasChildren()) {
   bool is_signed = false;
@@ -1862,20 +1865,24 @@ DWARFASTParserClang::ParseStructureLikeDIE(const 
SymbolContext ,
 attrs.exports_symbols);
   }
 
-  // Store a forward declaration to this class type in case any
-  // parameters in any class methods need it for the clang types for
-  // function prototypes.
-  clang::DeclContext *type_decl_ctx =
-  TypeSystemClang::GetDeclContextForType(clang_type);
-  LinkDeclContextToDIE(type_decl_ctx, def_die);
-  if (decl_die != def_die)
-LinkDeclContextToDIE(type_decl_ctx, decl_die);
   TypeSP type_sp = dwarf->MakeType(
   def_die.GetID(), attrs.name, attrs.byte_size, nullptr, LLDB_INVALID_UID,
   Type::eEncodingIsUID, , clang_type,
   Type::ResolveState::Forward,
   TypePayloadClang(OptionalClangModuleID(), attrs.is_complete_objc_class));
 
+  // Store a forward declaration to this class type in case any
+  // parameters in any class methods need it for the clang types for
+  // function prototypes.
+  clang::DeclContext *type_decl_ctx =
+  TypeSystemClang::GetDeclContextForType(clang_type);
+  LinkDeclContextToDIE(type_decl_ctx, decl_die);
+  if (decl_die != def_die) {
+LinkDeclContextToDIE(type_decl_ctx, def_die);
+dwarf->GetDIEToType()[def_die.GetDIE()] = type_sp.get();
+// Declaration DIE is inserted into the type map in ParseTypeFromDWARF
+  }
+
   // Add our type to the unique type map so we don't end up creating many
   // copies of the same type over and over in the ASTContext for our
   // module

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


[clang] [clang] Improve diagnostics for constraints of inline asm (NFC) (PR #96363)

2024-06-24 Thread via cfe-commits


@@ -2626,14 +2629,20 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt ) {
   SmallVector OutputConstraintInfos;
   SmallVector InputConstraintInfos;
 
+  const FunctionDecl *FD = dyn_cast_or_null(CurCodeDecl);

Sirraide wrote:

> do we want an RFC to decide on which one to remove

I could look into that if that would help.

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


[llvm-branch-commits] [llvm] AMDGPU: Add subtarget feature for memory atomic fadd f64 (PR #96444)

2024-06-24 Thread Matt Arsenault via llvm-branch-commits

https://github.com/arsenm updated 
https://github.com/llvm/llvm-project/pull/96444

>From 80c3f71f03d3b2ccbcd418d76d417f2a243fdbe4 Mon Sep 17 00:00:00 2001
From: Matt Arsenault 
Date: Sun, 23 Jun 2024 17:07:53 +0200
Subject: [PATCH 1/2] AMDGPU: Add subtarget feature for memory atomic fadd f64

---
 llvm/lib/Target/AMDGPU/AMDGPU.td  | 10 +-
 llvm/lib/Target/AMDGPU/GCNSubtarget.h |  7 +++
 llvm/lib/Target/AMDGPU/SIISelLowering.cpp |  2 +-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index 0ec65f759bc35..028c54d8d94d2 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -788,6 +788,13 @@ def FeatureFlatAtomicFaddF32Inst
   "Has flat_atomic_add_f32 instruction"
 >;
 
+def FeatureFlatBufferGlobalAtomicFaddF64Inst
+  : SubtargetFeature<"flat-buffer-global-fadd-f64-inst",
+  "HasFlatBufferGlobalAtomicFaddF64Inst",
+  "true",
+  "Has flat, buffer, and global instructions for f64 atomic fadd"
+>;
+
 def FeatureMemoryAtomicFaddF32DenormalSupport
   : SubtargetFeature<"memory-atomic-fadd-f32-denormal-support",
   "HasAtomicMemoryAtomicFaddF32DenormalSupport",
@@ -1388,7 +1395,8 @@ def FeatureISAVersion9_0_A : FeatureSet<
  FeatureBackOffBarrier,
  FeatureKernargPreload,
  FeatureAtomicFMinFMaxF64GlobalInsts,
- FeatureAtomicFMinFMaxF64FlatInsts
+ FeatureAtomicFMinFMaxF64FlatInsts,
+ FeatureFlatBufferGlobalAtomicFaddF64Inst
  ])>;
 
 def FeatureISAVersion9_0_C : FeatureSet<
diff --git a/llvm/lib/Target/AMDGPU/GCNSubtarget.h 
b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
index 674d84422538f..922435c5efaa6 100644
--- a/llvm/lib/Target/AMDGPU/GCNSubtarget.h
+++ b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
@@ -174,6 +174,7 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
   bool HasAtomicGlobalPkAddBF16Inst = false;
   bool HasAtomicBufferPkAddBF16Inst = false;
   bool HasFlatAtomicFaddF32Inst = false;
+  bool HasFlatBufferGlobalAtomicFaddF64Inst = false;
   bool HasDefaultComponentZero = false;
   bool HasAgentScopeFineGrainedRemoteMemoryAtomics = false;
   bool HasDefaultComponentBroadcast = false;
@@ -873,6 +874,12 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
 
   bool hasFlatAtomicFaddF32Inst() const { return HasFlatAtomicFaddF32Inst; }
 
+  /// \return true if the target has flat, global, and buffer atomic fadd for
+  /// double.
+  bool hasFlatBufferGlobalAtomicFaddF64Inst() const {
+return HasFlatBufferGlobalAtomicFaddF64Inst;
+  }
+
   /// \return true if the target's flat, global, and buffer atomic fadd for
   /// float supports denormal handling.
   bool hasMemoryAtomicFaddF32DenormalSupport() const {
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp 
b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index eec750e5b8251..6b5ba160d6402 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -16028,7 +16028,7 @@ 
SITargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const {
   return AtomicExpansionKind::CmpXChg;
 
 // global and flat atomic fadd f64: gfx90a, gfx940.
-if (Subtarget->hasGFX90AInsts() && Ty->isDoubleTy())
+if (Subtarget->hasFlatBufferGlobalAtomicFaddF64Inst() && Ty->isDoubleTy())
   return ReportUnsafeHWInst(AtomicExpansionKind::None);
 
 if (AS != AMDGPUAS::FLAT_ADDRESS && Ty->isFloatTy()) {

>From c1354032fc55234ffddf9136f17f5ee400c01c16 Mon Sep 17 00:00:00 2001
From: Matt Arsenault 
Date: Mon, 24 Jun 2024 15:42:17 +0200
Subject: [PATCH 2/2] Add to gfx940

---
 llvm/lib/Target/AMDGPU/AMDGPU.td | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index 028c54d8d94d2..3ed68a259ca15 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -1441,7 +1441,8 @@ def FeatureISAVersion9_4_Common : FeatureSet<
FeatureAtomicFMinFMaxF64GlobalInsts,
FeatureAtomicFMinFMaxF64FlatInsts,
FeatureAgentScopeFineGrainedRemoteMemoryAtomics,
-   FeatureMemoryAtomicFaddF32DenormalSupport
+   FeatureMemoryAtomicFaddF32DenormalSupport,
+   FeatureFlatBufferGlobalAtomicFaddF64Inst
]>;
 
 def FeatureISAVersion9_4_0 : FeatureSet<

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


[clang] [clang] Improve diagnostics for constraints of inline asm (NFC) (PR #96363)

2024-06-24 Thread via cfe-commits


@@ -2626,14 +2629,20 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt ) {
   SmallVector OutputConstraintInfos;
   SmallVector InputConstraintInfos;
 
+  const FunctionDecl *FD = dyn_cast_or_null(CurCodeDecl);

Sirraide wrote:

Yeah, I agree it seems weird to keep both around, and just outright removing 
one of them shouldn’t be too disruptive imo considering that it’s a fairly 
straight-forward change; I don’t know the history behind this too well, but do 
we want an RFC to decide on which one to remove, or is there already a clear 
favourite?

For what it’s worth, we currently have (at least according to grep, however 
accurate that may be) around 7900 occurrences of calls to functions ending 
with`cast_or_null` and around 530 ending with `cast_if_present` in the entire 
codebase.

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


[jenkinsci/gradle-plugin] 5ddba2: Fix README regarding Build Scan publication

2024-06-24 Thread 'Alexis Tual' via Jenkins Commits
  Branch: refs/heads/atual/fix-readme-dv
  Home:   https://github.com/jenkinsci/gradle-plugin
  Commit: 5ddba2a8e4d1e9cce27dab4fcdfa407c5f9cc9f5
  
https://github.com/jenkinsci/gradle-plugin/commit/5ddba2a8e4d1e9cce27dab4fcdfa407c5f9cc9f5
  Author: Alexis Tual 
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
M README.adoc

  Log Message:
  ---
  Fix README regarding Build Scan publication



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/gradle-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/gradle-plugin/push/refs/heads/atual/fix-readme-dv/00-5ddba2%40github.com.


[jenkinsci/gradle-plugin] 90adbf: Update Jenkins versions and adapt JDK requirement

2024-06-24 Thread 'Alexis Tual' via Jenkins Commits
  Branch: refs/heads/atual/fix-readme
  Home:   https://github.com/jenkinsci/gradle-plugin
  Commit: 90adbfe6ca59f429ca565970db29b7759af617ee
  
https://github.com/jenkinsci/gradle-plugin/commit/90adbfe6ca59f429ca565970db29b7759af617ee
  Author: Alexis Tual 
  Date:   2024-06-21 (Fri, 21 Jun 2024)

  Changed paths:
M acceptance-tests/build.gradle.kts
M build.gradle.kts
M settings.gradle.kts

  Log Message:
  ---
  Update Jenkins versions and adapt JDK requirement

Latest Jenkins requires Java 17 or above.
Recently added plugin dependencies (jackson) require Jenkins 2.401.3
Jenkins 2.401.3 requires Java 11 or above.
Animal Sniffer is not needed with Java 11, replaced by compileJava 
`options.release = 11`.


  Commit: 6a914ed2586cb67c19c2ab567264b5e72c05a350
  
https://github.com/jenkinsci/gradle-plugin/commit/6a914ed2586cb67c19c2ab567264b5e72c05a350
  Author: Alexis Tual 
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
M README.adoc

  Log Message:
  ---
  Fix README regarding Build Scan publication


Compare: 
https://github.com/jenkinsci/gradle-plugin/compare/90adbfe6ca59%5E...6a914ed2586c

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/gradle-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/gradle-plugin/push/refs/heads/atual/fix-readme/00-6a914e%40github.com.


[clang] [clang] Improve diagnostics for constraints of inline asm (NFC) (PR #96363)

2024-06-24 Thread Matt Arsenault via cfe-commits


@@ -2626,14 +2629,20 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt ) {
   SmallVector OutputConstraintInfos;
   SmallVector InputConstraintInfos;
 
+  const FunctionDecl *FD = dyn_cast_or_null(CurCodeDecl);

arsenm wrote:

I think we should just get rid of dyn_cast_if_present then: 
https://discourse.llvm.org/t/psa-swapping-out-or-null-with-if-present/65018/12

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


[Lldb-commits] [lldb] [lldb/DWARF] Remove parsing recursion when searching for definition DIEs (PR #96484)

2024-06-24 Thread Michael Buch via lldb-commits

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

Makes sense to me
Do we make sure that the type lookup map is updated so we don't re-parse when 
calling `ParseTypeFromDWARF` with either the declaration or the definition DIE?

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


[clang] [clang][ThreadSafety] Check trylock function success and return types (PR #95290)

2024-06-24 Thread via cfe-commits

github-actions[bot] wrote:



@dmcardle Congratulations on having your first Pull Request (PR) merged into 
the LLVM Project!

Your changes will be combined with recent changes from other authors, then 
tested
by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with 
a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as
the builds can include changes from many authors. It is not uncommon for your
change to be included in a build that fails due to someone else's changes, or
infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail 
[here](https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr).

If your change does cause a problem, it may be reverted, or you can revert it 
yourself.
This is a normal part of [LLVM 
development](https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy).
 You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are 
working as expected, well done!


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


[clang] [clang][ThreadSafety] Check trylock function success and return types (PR #95290)

2024-06-24 Thread Aaron Ballman via cfe-commits

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


[clang] c1bde0a - [clang][ThreadSafety] Check trylock function success and return types (#95290)

2024-06-24 Thread via cfe-commits
NCTION(1, 
muDoubleWrapper.muWrapper->mu);
 int etf_function_3() EXCLUSIVE_TRYLOCK_FUNCTION(1, muWrapper.getMu());
@@ -768,14 +844,13 @@ int etf_functetfn_8() EXCLUSIVE_TRYLOCK_FUNCTION(1, 
muPointer);
 int etf_function_9() EXCLUSIVE_TRYLOCK_FUNCTION(true); // \
   // expected-warning {{'exclusive_trylock_function' attribute without 
capability arguments can only be applied to non-static methods of a class}}
 
-
 // illegal attribute arguments
 int etf_function_bad_1() EXCLUSIVE_TRYLOCK_FUNCTION(mu1); // \
-  // expected-error {{'exclusive_trylock_function' attribute requires 
parameter 1 to be int or bool}}
+  // expected-error {{'exclusive_trylock_function' attribute requires 
parameter 1 to be nullptr or a bool, int, or enum literal}}
 int etf_function_bad_2() EXCLUSIVE_TRYLOCK_FUNCTION("mu"); // \
-  // expected-error {{'exclusive_trylock_function' attribute requires 
parameter 1 to be int or bool}}
+  // expected-error {{'exclusive_trylock_function' attribute requires 
parameter 1 to be nullptr or a bool, int, or enum literal}}
 int etf_function_bad_3() EXCLUSIVE_TRYLOCK_FUNCTION(muDoublePointer); // \
-  // expected-error {{'exclusive_trylock_function' attribute requires 
parameter 1 to be int or bool}}
+  // expected-error {{'exclusive_trylock_function' attribute requires 
parameter 1 to be nullptr or a bool, int, or enum literal}}
 
 int etf_function_bad_4() EXCLUSIVE_TRYLOCK_FUNCTION(1, "mu"); // \
   // expected-warning {{ignoring 'exclusive_trylock_function' attribute 
because its argument is invalid}}
@@ -799,9 +874,9 @@ int etf_function_bad_6() EXCLUSIVE_TRYLOCK_FUNCTION(1, 
umu); // \
 void stf_function() __attribute__((shared_trylock_function));  // \
   // expected-error {{'shared_trylock_function' attribute takes at least 1 
argument}}
 
-void stf_function_args() SHARED_TRYLOCK_FUNCTION(1, mu2);
+bool stf_function_args() SHARED_TRYLOCK_FUNCTION(1, mu2);
 
-void stf_function_arg() SHARED_TRYLOCK_FUNCTION(1); // \
+bool stf_function_arg() SHARED_TRYLOCK_FUNCTION(1); // \
   // expected-warning {{'shared_trylock_function' attribute without capability 
arguments can only be applied to non-static methods of a class}}
 
 int stf_testfn(int y) SHARED_TRYLOCK_FUNCTION(1); // \
@@ -824,7 +899,7 @@ class StfFoo {
  private:
   int test_field SHARED_TRYLOCK_FUNCTION(1); // \
 // expected-warning {{'shared_trylock_function' attribute only applies to 
functions}}
-  void test_method() SHARED_TRYLOCK_FUNCTION(1); // \
+  bool test_method() SHARED_TRYLOCK_FUNCTION(1); // \
 // expected-warning {{'shared_trylock_function' attribute without 
capability arguments refers to 'this', but 'StfFoo' isn't annotated with 
'capability' or 'scoped_lockable' attribute}}
 };
 
@@ -849,11 +924,11 @@ int stf_function_9() SHARED_TRYLOCK_FUNCTION(true); // \
 
 // illegal attribute arguments
 int stf_function_bad_1() SHARED_TRYLOCK_FUNCTION(mu1); // \
-  // expected-error {{'shared_trylock_function' attribute requires parameter 1 
to be int or bool}}
+  // expected-error {{'shared_trylock_function' attribute requires parameter 1 
to be nullptr or a bool, int, or enum literal}}
 int stf_function_bad_2() SHARED_TRYLOCK_FUNCTION("mu"); // \
-  // expected-error {{'shared_trylock_function' attribute requires parameter 1 
to be int or bool}}
+  // expected-error {{'shared_trylock_function' attribute requires parameter 1 
to be nullptr or a bool, int, or enum literal}}
 int stf_function_bad_3() SHARED_TRYLOCK_FUNCTION(muDoublePointer); // \
-  // expected-error {{'shared_trylock_function' attribute requires parameter 1 
to be int or bool}}
+  // expected-error {{'shared_trylock_function' attribute requires parameter 1 
to be nullptr or a bool, int, or enum literal}}
 
 int stf_function_bad_4() SHARED_TRYLOCK_FUNCTION(1, "mu"); // \
   // expected-warning {{ignoring 'shared_trylock_function' attribute because 
its argument is invalid}}

diff  --git a/clang/unittests/AST/ASTImporterTest.cpp 
b/clang/unittests/AST/ASTImporterTest.cpp
index 92f9bae6cb064..4c33546de6f92 100644
--- a/clang/unittests/AST/ASTImporterTest.cpp
+++ b/clang/unittests/AST/ASTImporterTest.cpp
@@ -7851,7 +7851,7 @@ TEST_P(ImportAttributes, ImportAcquireCapability) {
 TEST_P(ImportAttributes, ImportTryAcquireCapability) {
   TryAcquireCapabilityAttr *FromAttr, *ToAttr;
   importAttr(
-  "void test(int A1, int A2) __attribute__((try_acquire_capability(1, A1, "
+  "bool test(int A1, int A2) __attribute__((try_acquire_capability(1, A1, "
   "A2)));",
   FromAttr, ToAttr);
   checkImported(FromAttr->getSuccessValue(), ToAttr->getSuccessValue());
@@ -7948,7 +7948,7 @@ TEST_P(ImportAttributes, ImportAssertSharedLock) {
 TEST_P(ImportAttributes, ImportExclusiveTrylockFunction) {
   ExclusiveTrylockFunctionAttr *FromAttr, *ToAttr;
   importAttr(
-  "void test(int A1, int A2) __attribute__((exclusive_trylock_function(1, "
+  "bool test(int A1, int A2) __attribute__((exclusive_trylock_function(1, "
   "A1, A2)));",
   FromAttr, ToAttr);
   checkImported(FromAttr->getSuccessValue(), ToAttr->getSuccessValue());
@@ -7958,7 +7958,7 @@ TEST_P(ImportAttributes, ImportExclusiveTrylockFunction) {
 TEST_P(ImportAttributes, ImportSharedTrylockFunction) {
   SharedTrylockFunctionAttr *FromAttr, *ToAttr;
   importAttr(
-  "void test(int A1, int A2) __attribute__((shared_trylock_function(1, A1, 
"
+  "bool test(int A1, int A2) __attribute__((shared_trylock_function(1, A1, 
"
   "A2)));",
   FromAttr, ToAttr);
   checkImported(FromAttr->getSuccessValue(), ToAttr->getSuccessValue());



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


[clang] [clang][ThreadSafety] Check trylock function success and return types (PR #95290)

2024-06-24 Thread Aaron Ballman via cfe-commits

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

LGTM still

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


[clang] [clang][Sema] Fix crash on atomic builtins with incomplete type args (PR #96374)

2024-06-24 Thread Aaron Ballman via cfe-commits


@@ -4570,7 +4570,8 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, 
SourceRange ExprRange,
   }
 
   // Pointer to object of size zero is not allowed.
-  if (Context.getTypeInfoInChars(AtomTy).Width.isZero()) {
+  if (!AtomTy->isIncompleteType() &&

AaronBallman wrote:

If you call `RequireCompleteType()` before this `if` instead of checking for an 
incomplete type, do you get better diagnostic behavior?

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


[clang] [clang][Sema] Fix crash on atomic builtins with incomplete type args (PR #96374)

2024-06-24 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman commented:

Thank you for the fix! The changes should also come with a release note in 
`clang/docs/ReleaseNotes.rst` so users know about the improvement.

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


[clang] [clang][Sema] Fix crash on atomic builtins with incomplete type args (PR #96374)

2024-06-24 Thread Aaron Ballman via cfe-commits

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


[clang] [clang] Improve diagnostics for constraints of inline asm (NFC) (PR #96363)

2024-06-24 Thread via cfe-commits


@@ -2626,14 +2629,20 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt ) {
   SmallVector OutputConstraintInfos;
   SmallVector InputConstraintInfos;
 
+  const FunctionDecl *FD = dyn_cast_or_null(CurCodeDecl);

Sirraide wrote:

> Where do you get dyn_cast_or_null is deprecated?

Mainly from here (as well as other places in `Casting.h`):
https://github.com/llvm/llvm-project/blob/5cd0ba30f53d11835dbfd05ad4071d397387fb04/llvm/include/llvm/Support/Casting.h#L756-L769

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


[clang] [clang] Improve diagnostics for constraints of inline asm (NFC) (PR #96363)

2024-06-24 Thread Matt Arsenault via cfe-commits

https://github.com/arsenm commented:

It's really unfortunate to have to add all this asm handling to clang. Can't it 
rely on backend diagnostic remarks for this? 

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


[clang] [clang] Improve diagnostics for constraints of inline asm (NFC) (PR #96363)

2024-06-24 Thread Matt Arsenault via cfe-commits


@@ -2626,14 +2629,20 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt ) {
   SmallVector OutputConstraintInfos;
   SmallVector InputConstraintInfos;
 
+  const FunctionDecl *FD = dyn_cast_or_null(CurCodeDecl);

arsenm wrote:

Where do you get dyn_cast_or_null is deprecated? I only remember a rejected RFC 
to start using dyn_cast_if_present

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


[Lldb-commits] [lldb] Reapply [lldb][DWARF] Delay struct/class/union definition DIE searching when parsing declaration DIEs. (PR #92328)

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

labath wrote:

Hi there. Nice to see interest in this patch. Zequan has been OOO for the past 
couple of weeks, so I've sort of taken this up in the mean time.

The problem with the simplified template names is actually already fixed (by 
#95905), but in the mean time, I've discovered a very similar problem with type 
units (basically, just take the test case from #95905, but build it with 
-fdebug-types-section instead). While this could (and should) be fixed in 
similar way, this led me to believe that the overall approach in this patch was 
too fragile. When completing a type, it basically does something like:
- look up the (declaration) die for the type being completed (using the 
`ForwardDeclCompilerTypeToDIE` map)
- look up the definition die (using the dwarf index)
- look up the type for the definition die (using the UniqueDWARFASTTypeMap)

The last step, besides being completely unnecessary (we already know the type 
we're supposed to complete), is also a big liability, because here we are 
implicitly relying on the the map to return the same type that we started with. 
If it does not then we will end up creating a new type instead of completing 
the existing one, and things will quickly go sideways.

The meeting that David alluded to is tomorrow, and I hope we're going to try to 
figure out who's going to do what and in what order. In the mean time, I've 
added you as a reviewer to one of my pending patches.

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


[llvm-branch-commits] [mlir] [mlir][linalg] Implement TilingInterface for winograd operators (PR #96184)

2024-06-24 Thread Oleksandr Alex Zinenko via llvm-branch-commits


@@ -2638,4 +2638,41 @@ def WinogradConv2DOp : Op {
+  let description = [{
+Decompose winograd operators. It will convert filter, input and output
+transform operators into a combination of scf, tensor, and linalg

ftynse wrote:

Nit: operations

https://github.com/llvm/llvm-project/pull/96184
___
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] [mlir] [mlir][linalg] Implement TilingInterface for winograd operators (PR #96184)

2024-06-24 Thread Oleksandr Alex Zinenko via llvm-branch-commits


@@ -2760,6 +2760,89 @@ LogicalResult WinogradFilterTransformOp::verify() {
   return success();
 }
 
+SmallVector
+WinogradFilterTransformOp::getIterationDomain(OpBuilder ) {
+  Location loc = getLoc();
+  Value zero = builder.create(loc, 0);
+  Value one = builder.create(loc, 1);
+  Value output = getOutput();
+  SmallVector loopBounds(6);
+  for (unsigned dim = 0; dim < 6; ++dim) {
+loopBounds[dim].offset = zero;
+loopBounds[dim].size = getDimValue(builder, loc, output, dim);
+loopBounds[dim].stride = one;
+  }
+  return loopBounds;
+}
+
+SmallVector
+WinogradFilterTransformOp::getLoopIteratorTypes() {
+  SmallVector iteratorTypes(6,
+ 
utils::IteratorType::parallel);
+  return iteratorTypes;
+}
+
+Value getValueFromOpFoldResult(OpFoldResult opFoldResult, OpBuilder ,
+   Location loc) {
+  if (auto val = opFoldResult.dyn_cast()) {
+return val;
+  } else if (auto attr = opFoldResult.dyn_cast()) {
+auto intAttr = cast(attr);
+return builder.create(loc, intAttr);
+  }
+  // This should never happen if OpFoldResult is correctly formed.

ftynse wrote:

Then this should be an assertion.

https://github.com/llvm/llvm-project/pull/96184
___
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] [mlir] [mlir][linalg] Implement TilingInterface for winograd operators (PR #96184)

2024-06-24 Thread Oleksandr Alex Zinenko via llvm-branch-commits


@@ -2760,6 +2760,89 @@ LogicalResult WinogradFilterTransformOp::verify() {
   return success();
 }
 
+SmallVector
+WinogradFilterTransformOp::getIterationDomain(OpBuilder ) {
+  Location loc = getLoc();
+  Value zero = builder.create(loc, 0);
+  Value one = builder.create(loc, 1);

ftynse wrote:

IIRC, `Range` contains list of `OpFoldResult`, meaning we can put attributes 
there and not materialize operations for these constants.

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


<    1   2   3   4   5   6   7   8   9   10   >