[clang] [clang][ASTImporter] Fix possible crash "given incorrect InsertPos for specialization". (PR #89887)

2024-05-25 Thread Qizhi Hu via cfe-commits

jcsxky wrote:

> > Could you please show your commands which reproduced this crash? I tested 
> > locally with the following commands and it runs OK.
> > ```c++
> > clang++ -cc1 -std=c++17 -emit-pch -o test.cpp.ast test.cpp
> > clang++ -cc1 -x c++ -ast-merge test.cpp.ast  /dev/null -ast-dump
> > ```
> 
> That code is only an example, it differs not much of the real code that 
> caused the crash. But it is not enough to use this code for the problem 
> reproduction. This code can be used to get the case when the specialization 
> list is changed before the insertion, but even then no crash happens:
> 
> ```c++
> namespace N {
> template 
> int B = B + B;
> template <>
> int B<0> = 0;
> template <>
> int B<1> = 1;
> }
> int A = N::B<5>;
> ```
> 
> With clang version 18.1.6 the original crash does not occur any more. The 
> "original crash" was reproduced on specific source files of project 
> "contour". Probably I can attach the files and command, but some changes can 
> be required to make it work.

Could you please show me how to reproduce the crash in detail if possible? Then 
I can debug this issue in my spare time.

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


[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/89746
___
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] [clang-tools-extra] [clang-tools-extra] Revise IDE folder structure (PR #89744)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/89744
___
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] [compiler-rt] [compiler-rt] Revise IDE folder structure (PR #89753)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

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


[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/89750
___
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] [libc] [libcxx] [libcxxabi] [libunwind] [llvm] [pstl] Revise IDE folder structure (PR #89755)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/89755
___
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] Revise IDE folder structure (PR #89749)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/89749
___
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] [lldb] [lldb] Revise IDE folder structure (PR #89748)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/89748
___
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] [polly] [polly] Revise IDE folder structure (PR #89752)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/89752
___
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] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/89743
___
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] [flang] [flang] Revise IDE folder structure (PR #89745)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

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


[llvm-branch-commits] [llvm] [BOLT] Revise IDE folder structure (PR #89742)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/89742
___
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] [lld] [lld] Revise IDE folder structure (PR #89747)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

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


[Lldb-commits] [lldb] lldb unused var fix for NetBSD < 10. (PR #93377)

2024-05-25 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: David CARLIER (devnexen)


Changes



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


1 Files Affected:

- (modified) lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp (+2-2) 


``diff
diff --git a/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp 
b/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
index f561c21b9d91c..77b4301ea22e5 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
+++ b/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
@@ -180,8 +180,6 @@ void NativeThreadNetBSD::SetStepping() {
 }
 
 std::string NativeThreadNetBSD::GetName() {
-  Log *log = GetLog(POSIXLog::Thread);
-
 #ifdef PT_LWPSTATUS
   struct ptrace_lwpstatus info = {};
   info.pl_lwpid = m_tid;
@@ -193,6 +191,8 @@ std::string NativeThreadNetBSD::GetName() {
   return info.pl_name;
 #else
   std::vector infos;
+  Log *log = GetLog(POSIXLog::Thread);
+
   int mib[5] = {CTL_KERN, KERN_LWP, static_cast(m_process.GetID()),
 sizeof(struct kinfo_lwp), 0};
   size_t size;

``




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


[Lldb-commits] [lldb] lldb unused var fix for NetBSD < 10. (PR #93377)

2024-05-25 Thread David CARLIER via lldb-commits

https://github.com/devnexen created 
https://github.com/llvm/llvm-project/pull/93377

None

>From 9dcd8be919582006b5ade0b6c1f3074678f50bed Mon Sep 17 00:00:00 2001
From: David Carlier 
Date: Sat, 25 May 2024 10:59:54 +
Subject: [PATCH] lldb unused var fix for NetBSD < 10.

---
 lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp 
b/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
index f561c21b9d91c..77b4301ea22e5 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
+++ b/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
@@ -180,8 +180,6 @@ void NativeThreadNetBSD::SetStepping() {
 }
 
 std::string NativeThreadNetBSD::GetName() {
-  Log *log = GetLog(POSIXLog::Thread);
-
 #ifdef PT_LWPSTATUS
   struct ptrace_lwpstatus info = {};
   info.pl_lwpid = m_tid;
@@ -193,6 +191,8 @@ std::string NativeThreadNetBSD::GetName() {
   return info.pl_name;
 #else
   std::vector infos;
+  Log *log = GetLog(POSIXLog::Thread);
+
   int mib[5] = {CTL_KERN, KERN_LWP, static_cast(m_process.GetID()),
 sizeof(struct kinfo_lwp), 0};
   size_t size;

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


[jenkins-infra/jenkins-infra] c04d44: chore: Bump container agent image jenkinsciinfra/b...

2024-05-25 Thread 'jenkins-infra-bot' via Jenkins Commits
  Branch: 
refs/heads/updatecli_production_f10b18e55b9d879c3dc9d397305f5bd93d89cf9ecbc457d2fadf491e9076d68d
  Home:   https://github.com/jenkins-infra/jenkins-infra
  Commit: c04d441e03215ef912950656feb18a173b9b0ec8
  
https://github.com/jenkins-infra/jenkins-infra/commit/c04d441e03215ef912950656feb18a173b9b0ec8
  Author: Jenkins Infra Bot (updatecli) 
<60776566+jenkins-infra-...@users.noreply.github.com>
  Date:   2024-05-25 (Sat, 25 May 2024)

  Changed paths:
M hieradata/common.yaml

  Log Message:
  ---
  chore: Bump container agent image jenkinsciinfra/builder

Made with ❤️️ by updatecli



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

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


[jenkinsci/additional-metrics-plugin]

2024-05-25 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/renovate/branches/renovate/maven-3.x
  Home:   https://github.com/jenkinsci/additional-metrics-plugin

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

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


[jenkinsci/additional-metrics-plugin] 52ec3d: chore(deps): update dependency maven to v3.9.7

2024-05-25 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/heads/renovate/maven-3.x
  Home:   https://github.com/jenkinsci/additional-metrics-plugin
  Commit: 52ec3d70913b998865403c2122c11b1ded71d002
  
https://github.com/jenkinsci/additional-metrics-plugin/commit/52ec3d70913b998865403c2122c11b1ded71d002
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2024-05-25 (Sat, 25 May 2024)

  Changed paths:
M .mvn/wrapper/maven-wrapper.properties

  Log Message:
  ---
  chore(deps): update dependency maven to v3.9.7



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

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


[jenkinsci/additional-metrics-plugin] 203af8: chore(deps): update dependency maven to v3.9.7

2024-05-25 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/renovate/branches/renovate/maven-3.x
  Home:   https://github.com/jenkinsci/additional-metrics-plugin
  Commit: 203af865d740f46e861b3889924d0a131e754b2a
  
https://github.com/jenkinsci/additional-metrics-plugin/commit/203af865d740f46e861b3889924d0a131e754b2a
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2024-05-25 (Sat, 25 May 2024)

  Changed paths:
M .mvn/wrapper/maven-wrapper.properties

  Log Message:
  ---
  chore(deps): update dependency maven to v3.9.7



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

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


[jenkinsci/jenkins]

2024-05-25 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/renovate/branches/renovate/org.apache.maven-maven-core-3.x
  Home:   https://github.com/jenkinsci/jenkins

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/jenkins/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/jenkins/push/refs/renovate/branches/renovate/org.apache.maven-maven-core-3.x/9bc0ee-00%40github.com.


[jenkinsci/jenkins] 0d06ae: Update dependency org.apache.maven:maven-core to v...

2024-05-25 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/heads/renovate/org.apache.maven-maven-core-3.x
  Home:   https://github.com/jenkinsci/jenkins
  Commit: 0d06ae959a37dafdece6a09bf61d8ec1b94f9cd8
  
https://github.com/jenkinsci/jenkins/commit/0d06ae959a37dafdece6a09bf61d8ec1b94f9cd8
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2024-05-25 (Sat, 25 May 2024)

  Changed paths:
M .gitpod/Dockerfile

  Log Message:
  ---
  Update dependency org.apache.maven:maven-core to v3.9.7



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/jenkins/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/jenkins/push/refs/heads/renovate/org.apache.maven-maven-core-3.x/00-0d06ae%40github.com.


[jenkinsci/jenkins] 9bc0ee: Update dependency org.apache.maven:maven-core to v...

2024-05-25 Thread 'renovate[bot]' via Jenkins Commits
  Branch: refs/renovate/branches/renovate/org.apache.maven-maven-core-3.x
  Home:   https://github.com/jenkinsci/jenkins
  Commit: 9bc07cadfa588ace0948da407edbc0c07d65
  
https://github.com/jenkinsci/jenkins/commit/9bc07cadfa588ace0948da407edbc0c07d65
  Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  Date:   2024-05-25 (Sat, 25 May 2024)

  Changed paths:
M .gitpod/Dockerfile

  Log Message:
  ---
  Update dependency org.apache.maven:maven-core to v3.9.7



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/jenkins/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/jenkins/push/refs/renovate/branches/renovate/org.apache.maven-maven-core-3.x/00-9bc0ee%40github.com.


[jenkins-infra/jenkins-infra] 6f5aff: chore: Bump container agent image jenkinsciinfra/b...

2024-05-25 Thread 'jenkins-infra-bot' via Jenkins Commits
  Branch: 
refs/heads/updatecli_production_f10b18e55b9d879c3dc9d397305f5bd93d89cf9ecbc457d2fadf491e9076d68d
  Home:   https://github.com/jenkins-infra/jenkins-infra
  Commit: 6f5aff4ded99feca8ac2a463bbf08edc9f9c9b3d
  
https://github.com/jenkins-infra/jenkins-infra/commit/6f5aff4ded99feca8ac2a463bbf08edc9f9c9b3d
  Author: Jenkins Infra Bot (updatecli) 
<60776566+jenkins-infra-...@users.noreply.github.com>
  Date:   2024-05-25 (Sat, 25 May 2024)

  Changed paths:
M hieradata/common.yaml

  Log Message:
  ---
  chore: Bump container agent image jenkinsciinfra/builder

Made with ❤️️ by updatecli



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

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


branch master updated (c5e63e19ac -> 9756d9d634)

2024-05-25 Thread guix-commits
glv pushed a change to branch master
in repository guix.

from c5e63e19ac gnu: gssdp-1.4: Fix building.
 new 2ac3d61ca3 gnu: cl-cf: Update to 1.0-2.fbc025b.
 new 199e8f9581 gnu: cl-collectors: Update to 1.0-2.4c5e70c.
 new 1fa8997f6f gnu: cl-stmx: Update to 2.0.5-3.95f7dea.
 new 8ca6e63b00 gnu: cl-access: Update to 1.6.0-1.a4f87fc.
 new 9756d9d634 gnu: cl-nodgui: Update to 0.6.2.0-1.9d0c973.

The 5 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/lisp-xyz.scm | 61 ++-
 1 file changed, 28 insertions(+), 33 deletions(-)



03/05: gnu: cl-stmx: Update to 2.0.5-3.95f7dea.

2024-05-25 Thread guix-commits
glv pushed a commit to branch master
in repository guix.

commit 1fa8997f6fb4422777c1cf404cbc26ab2871e2a2
Author: Guillaume Le Vaillant 
AuthorDate: Sat May 25 10:52:53 2024 +0200

gnu: cl-stmx: Update to 2.0.5-3.95f7dea.

* gnu/packages/lisp-xyz.scm (sbcl-stmx): Update to 2.0.5-3.95f7dea.
  [arguments]: Remove 'fix-build' phase.

Change-Id: I72e3f323f38ced32ea03ab2661d5802e93e13572
---
 gnu/packages/lisp-xyz.scm | 19 ---
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 947f9e6543..ecb0b496a7 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -22812,8 +22812,8 @@ window it creates as just another output for your 
graphics, analogous to how
 (define-public sbcl-stmx
   ;; No release for years and recent commits contain fixes for recent SBCL
   ;; versions.
-  (let ((commit "f71e742a50b85e3abc0af9bb5f02802f218a1705")
-(revision "2"))
+  (let ((commit "95f7dea8e1e58dee59e14a1deb148908d920839f")
+(revision "3"))
 (package
  (name "sbcl-stmx")
  (version (git-version "2.0.5" revision commit))
@@ -22823,24 +22823,13 @@ window it creates as just another output for your 
graphics, analogous to how
(uri (git-reference
  (url "https://github.com/cosmos72/stmx/;)
  (commit commit)))
-   (file-name (git-file-name name version))
+   (file-name (git-file-name "cl-stmx" version))
(sha256
-(base32 "0q739mlw3s3z5kclzccz4r64ag38ks11fmd38109qwjv5knn69jv"
+(base32 "1qq25y79casaa56a76gj9hk2f3hjcc5z3f4na4vy3sw99km54hn9"
  (build-system asdf-build-system/sbcl)
  (inputs
   (list sbcl-alexandria sbcl-bordeaux-threads sbcl-log4cl
 sbcl-closer-mop sbcl-trivial-garbage))
- (arguments
-  (list
-   #:phases
-   #~(modify-phases %standard-phases
-   (add-after 'unpack 'fix-build
- (lambda _
-   (substitute* "asm/transaction.lisp"
- (("\\(ftype \\(function \\(\\) fixnum\\)
transaction-begin\\)")
-  "(ftype (function () (unsigned-byte 32))
transaction-begin)")
- (("\\(values fixnum  \\)")
-  "(unsigned-byte 32)")))
  (home-page "https://stmx.org/;)
  (synopsis "High performance Transactional Memory for Common Lisp")
  (description



01/05: gnu: cl-cf: Update to 1.0-2.fbc025b.

2024-05-25 Thread guix-commits
glv pushed a commit to branch master
in repository guix.

commit 2ac3d61ca3d57bc602ad1f67d6fb701ebcaab45b
Author: Guillaume Le Vaillant 
AuthorDate: Sat May 25 10:43:13 2024 +0200

gnu: cl-cf: Update to 1.0-2.fbc025b.

* gnu/packages/lisp-xyz.scm (sbcl-cf): Update to 1.0-2.fbc025b.

Change-Id: Ide38475fb171f71c5dc35bb12d66a81b0f08cf64
---
 gnu/packages/lisp-xyz.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 5ee42d03f9..cea532de0e 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -451,8 +451,8 @@ with dice-roll statistics.")
   (sbcl-package->ecl-package sbcl-alea))
 
 (define-public sbcl-cf
-  (let ((commit "9a8ecb2fa3f9d36a1384647067c5c630d132d5b6")
-(revision "1"))
+  (let ((commit "fbc025b6f274687ee9acc8d07496d44999ac428e")
+(revision "2"))
 (package
   (name "sbcl-cf")
   (version (git-version "1.0" revision commit))
@@ -464,7 +464,7 @@ with dice-roll statistics.")
(commit commit)))
  (file-name (git-file-name "cl-cf" version))
  (sha256
-  (base32 "0w6vqykx65jhk8i3a7j85fa60f9irnd5a0338rg50m45bj3vrc25"
+  (base32 "182laa57j9qs567g75qwf8vh4xb0d22lr94x84r32dy28mrwi5ig"
   (build-system asdf-build-system/sbcl)
   (native-inputs (list sbcl-fiveam))
   (synopsis "Continued fractions library")



05/05: gnu: cl-nodgui: Update to 0.6.2.0-1.9d0c973.

2024-05-25 Thread guix-commits
glv pushed a commit to branch master
in repository guix.

commit 9756d9d6345fb142944261174453ab0a597cc2e7
Author: Guillaume Le Vaillant 
AuthorDate: Sat May 25 11:16:09 2024 +0200

gnu: cl-nodgui: Update to 0.6.2.0-1.9d0c973.

* gnu/packages/lisp-xyz.scm (sbcl-nodgui): Update to 0.6.2.0-1.9d0c973.
  [inputs]: Add sbcl-flexi-streams, sbcl-static-vectors,
  sbcl-trivial-garbage. Move sbcl-clunit2 to...
  [native-inputs]: ... here.

Change-Id: I2299175a06786ce93fde34aa54005c00b40edd71
---
 gnu/packages/lisp-xyz.scm | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 80f16e99fa..7d9dc45f55 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -12932,11 +12932,11 @@ Scalable Vector Graphics files.")
   (sbcl-package->cl-source-package sbcl-cl-svg))
 
 (define-public sbcl-nodgui
-  (let ((commit "35fd379e11162995ed48c2f8ebe6a5bf0a6f48cb")
+  (let ((commit "9d0c9731bc2f2b434f0ddabe4b3796432aad8cba")
 (revision "1"))
 (package
   (name "sbcl-nodgui")
-  (version (git-version "0.6.0.2" revision commit))
+  (version (git-version "0.6.2.0" revision commit))
   (source
(origin
  (method git-fetch)
@@ -12945,22 +12945,26 @@ Scalable Vector Graphics files.")
(commit commit)))
  (file-name (git-file-name "cl-nodgui" version))
  (sha256
-  (base32 "01l1hyzf8ryc35ydrjhqjn4az8asdwn46knl5gx8v02z2jcv7j24"
+  (base32 "0j98mcq0mn3wrlqm3j29pv530q0pkq00sk6liai97an51i1n08g6"
   (build-system asdf-build-system/sbcl)
+  (native-inputs
+   (list sbcl-clunit2))
   (inputs
(list sbcl-alexandria
  sbcl-bordeaux-threads
  sbcl-cl-colors2
  sbcl-cl-ppcre-unicode
  sbcl-cl-unicode
- sbcl-clunit2
  sbcl-esrap
+ sbcl-flexi-streams
  sbcl-jpeg-turbo
  sbcl-named-readtables
  sbcl-cl-opengl
  sbcl-parse-number
  sbcl-pngload
  sbcl-sdl2
+ sbcl-static-vectors
+ sbcl-trivial-garbage
  sbcl-zpng
  tk
  tklib))



04/05: gnu: cl-access: Update to 1.6.0-1.a4f87fc.

2024-05-25 Thread guix-commits
glv pushed a commit to branch master
in repository guix.

commit 8ca6e63b001dab1b9279b4f7f7af8048754c28ac
Author: Guillaume Le Vaillant 
AuthorDate: Sat May 25 11:04:33 2024 +0200

gnu: cl-access: Update to 1.6.0-1.a4f87fc.

* gnu/packages/lisp-xyz.scm (sbcl-access): Update to 1.6.0-1.a4f87fc.
  [source, home-page]: Switch to maintained repository.
  [inputs]: Remove sbcl-anaphora and sbcl-cl-interpol. Add sbcl-cl-ppcre.

Change-Id: Idbc140b1264156e975b69ab65423765d5f5a77d1
---
 gnu/packages/lisp-xyz.scm | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index ecb0b496a7..80f16e99fa 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -19690,32 +19690,34 @@ UTF-8 block characters.")
   (sbcl-package->cl-source-package sbcl-cl-spark))
 
 (define-public sbcl-access
-  (let ((commit "1b26db3760018cdc4624f880f0a1e0155d8f6c50")
+  (let ((commit "a4f87fc1007f5c9a0a2abfddc1c23a77e87096f8")
 (revision "1"))
 (package
   (name "sbcl-access")
-  (version (git-version "1.5.0" revision commit))
+  (version (git-version "1.6.0" revision commit))
   (source
(origin
  (method git-fetch)
  (uri (git-reference
-   (url "https://github.com/sharplispers/access;)
+   (url "https://github.com/AccelerationNet/access;)
(commit commit)))
- (file-name (git-file-name "access" version))
+ (file-name (git-file-name "cl-access" version))
  (sha256
-  (base32 "1knd3n4mpzkc97i1znbas32pscd30416isvmx2pjmgvar6k93pl5"
+  (base32 "0zdjqhb9rvnlq6nzmsp7372gi91k1rq9bz510m6hcki7g3r01iv5"
   (build-system asdf-build-system/sbcl)
   (native-inputs
(list sbcl-lisp-unit2))
   (inputs
-   (list sbcl-alexandria sbcl-anaphora sbcl-closer-mop
- sbcl-cl-interpol sbcl-iterate))
+   (list sbcl-alexandria
+ sbcl-cl-ppcre
+ sbcl-closer-mop
+ sbcl-iterate))
   (synopsis
"Common lisp library to unify access to dictionary-like structures")
   (description
"This is a Common lisp library to unify access to the most common
 dictionary-like data structures.")
-  (home-page "https://github.com/sharplispers/access;)
+  (home-page "https://github.com/AccelerationNet/access;)
   (license license:bsd-3
 
 (define-public ecl-access



02/05: gnu: cl-collectors: Update to 1.0-2.4c5e70c.

2024-05-25 Thread guix-commits
glv pushed a commit to branch master
in repository guix.

commit 199e8f9581a73c4b971cc24f644e4f94a4b75b73
Author: Guillaume Le Vaillant 
AuthorDate: Sat May 25 10:47:19 2024 +0200

gnu: cl-collectors: Update to 1.0-2.4c5e70c.

* gnu/packages/lisp-xyz.scm (sbcl-collectors): Update to 1.0-2.4c5e70c.

Change-Id: I95c9beb1aa5e59b658ee091ab14d803e6eded3fe
---
 gnu/packages/lisp-xyz.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index cea532de0e..947f9e6543 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -17047,8 +17047,8 @@ table.")
   (sbcl-package->ecl-package sbcl-concurrent-hash-tables))
 
 (define-public sbcl-collectors
-  (let ((commit "748f0a1613ce161edccad4cc815eccd7fc55aaf3")
-(revision "1"))
+  (let ((commit "4c5e70cf399381de8fb485d4ed5a5c8fd7555146")
+(revision "2"))
 (package
   (name "sbcl-collectors")
   (version (git-version "1.0" revision commit))
@@ -17060,7 +17060,7 @@ table.")
(commit commit)))
  (file-name (git-file-name "cl-collectors" version))
  (sha256
-  (base32 "1mxcq7wq2jwbjd39afihpd46qkaidq76prgjbzpkv5749wf2spib"
+  (base32 "1kc9q05wyp8yjz5wqc73nar7l49vcnfhj4924li81v76hlb03665"
   (build-system asdf-build-system/sbcl)
   (inputs
(list sbcl-alexandria sbcl-closer-mop sbcl-symbol-munger))



[clang] [Clang] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

2024-05-25 Thread via cfe-commits
90c4e..e10ffbabd1da6 100644
--- a/clang/include/clang/Basic/DiagnosticLexKinds.td
+++ b/clang/include/clang/Basic/DiagnosticLexKinds.td
@@ -112,11 +112,11 @@ def warn_cxx98_compat_raw_string_literal : Warning<
   InGroup, DefaultIgnore;
 
 def warn_cxx26_compat_raw_string_literal_character_set : Warning<
-  "'%0'in a raw string literal delimiter is incompatible "
+  " '%0' in a raw string literal delimiter is incompatible "
   "with standards before C++2c">,
   InGroup, DefaultIgnore;
 def ext_cxx26_raw_string_literal_character_set : Extension<
-  "'%0'in a raw string literal delimiter is a C++2c extension">,
+  " '%0' in a raw string literal delimiter is a C++2c extension">,
   InGroup, DefaultIgnore;
 
 def warn_multichar_character_literal : Warning<
diff --git a/clang/test/Lexer/cxx2c-raw-strings.cpp 
b/clang/test/Lexer/cxx2c-raw-strings.cpp
index 9181cbc7cf8d4..569a4b8447e57 100644
--- a/clang/test/Lexer/cxx2c-raw-strings.cpp
+++ b/clang/test/Lexer/cxx2c-raw-strings.cpp
@@ -3,10 +3,10 @@
 
 int main() {
   (void) R"abc`@$(foobar)abc`@$";
-  //expected-warning@-1 {{'`'in a raw string literal delimiter is a C++2c 
extension}}
-  //expected-warning@-2 {{'@'in a raw string literal delimiter is a C++2c 
extension}}
-  //expected-warning@-3 {{'$'in a raw string literal delimiter is a C++2c 
extension}}
-  //cxx26-warning@-4 {{'`'in a raw string literal delimiter is incompatible 
with standards before C++2c}}
-  //cxx26-warning@-5 {{'@'in a raw string literal delimiter is incompatible 
with standards before C++2c}}
-  //cxx26-warning@-6 {{'$'in a raw string literal delimiter is incompatible 
with standards before C++2c}}
+  //expected-warning@-1 {{'`' in a raw string literal delimiter is a C++2c 
extension}}
+  //expected-warning@-2 {{'@' in a raw string literal delimiter is a C++2c 
extension}}
+  //expected-warning@-3 {{'$' in a raw string literal delimiter is a C++2c 
extension}}
+  //cxx26-warning@-4 {{'`' in a raw string literal delimiter is incompatible 
with standards before C++2c}}
+  //cxx26-warning@-5 {{'@' in a raw string literal delimiter is incompatible 
with standards before C++2c}}
+  //cxx26-warning@-6 {{'$' in a raw string literal delimiter is incompatible 
with standards before C++2c}}
 }

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


[clang] [Clang] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

2024-05-25 Thread via cfe-commits
90c4e..e10ffbabd1da6 100644
--- a/clang/include/clang/Basic/DiagnosticLexKinds.td
+++ b/clang/include/clang/Basic/DiagnosticLexKinds.td
@@ -112,11 +112,11 @@ def warn_cxx98_compat_raw_string_literal : Warning<
   InGroup, DefaultIgnore;
 
 def warn_cxx26_compat_raw_string_literal_character_set : Warning<
-  "'%0'in a raw string literal delimiter is incompatible "
+  " '%0' in a raw string literal delimiter is incompatible "
   "with standards before C++2c">,
   InGroup, DefaultIgnore;
 def ext_cxx26_raw_string_literal_character_set : Extension<
-  "'%0'in a raw string literal delimiter is a C++2c extension">,
+  " '%0' in a raw string literal delimiter is a C++2c extension">,
   InGroup, DefaultIgnore;
 
 def warn_multichar_character_literal : Warning<
diff --git a/clang/test/Lexer/cxx2c-raw-strings.cpp 
b/clang/test/Lexer/cxx2c-raw-strings.cpp
index 9181cbc7cf8d4..e72dbfb63c390 100644
--- a/clang/test/Lexer/cxx2c-raw-strings.cpp
+++ b/clang/test/Lexer/cxx2c-raw-strings.cpp
@@ -3,10 +3,10 @@
 
 int main() {
   (void) R"abc`@$(foobar)abc`@$";
-  //expected-warning@-1 {{'`'in a raw string literal delimiter is a C++2c 
extension}}
-  //expected-warning@-2 {{'@'in a raw string literal delimiter is a C++2c 
extension}}
-  //expected-warning@-3 {{'$'in a raw string literal delimiter is a C++2c 
extension}}
-  //cxx26-warning@-4 {{'`'in a raw string literal delimiter is incompatible 
with standards before C++2c}}
-  //cxx26-warning@-5 {{'@'in a raw string literal delimiter is incompatible 
with standards before C++2c}}
-  //cxx26-warning@-6 {{'$'in a raw string literal delimiter is incompatible 
with standards before C++2c}}
+  //expected-warning@-1 {{'` 'in a raw string literal delimiter is a C++2c 
extension}}
+  //expected-warning@-2 {{'@' in a raw string literal delimiter is a C++2c 
extension}}
+  //expected-warning@-3 {{'$' in a raw string literal delimiter is a C++2c 
extension}}
+  //cxx26-warning@-4 {{'`' in a raw string literal delimiter is incompatible 
with standards before C++2c}}
+  //cxx26-warning@-5 {{'@' in a raw string literal delimiter is incompatible 
with standards before C++2c}}
+  //cxx26-warning@-6 {{'$' in a raw string literal delimiter is incompatible 
with standards before C++2c}}
 }

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


[clang] [clang] In Sema use new parentEvaluationContext function (PR #93338)

2024-05-25 Thread Vlad Serebrennikov via cfe-commits


@@ -17693,12 +17691,13 @@ void Sema::PopExpressionEvaluationContext() {
 
   // Append the collected materialized temporaries into previous context before
   // exit if the previous also is a lifetime extending context.
-  auto  = ExprEvalContexts[ExprEvalContexts.size() - 2];
+  auto  = parentEvaluationContext();
   if (getLangOpts().CPlusPlus23 && Rec.InLifetimeExtendingContext &&
   PrevRecord.InLifetimeExtendingContext &&
   !Rec.ForRangeLifetimeExtendTemps.empty()) {
-PrevRecord.ForRangeLifetimeExtendTemps.append(
-Rec.ForRangeLifetimeExtendTemps);
+const_cast &>(

Endilll wrote:

For the context, our overall const-correctness situation in Sema is less than 
ideal, to put it mildly. In this particular case I think we need to add a 
non-const overload for `parentEvaluationContext()` with the following 
prototype: `ExpressionEvaluationContextRecord ()`.

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


[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-25 Thread Ryosuke Niwa via cfe-commits
7993eaae958078244b Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa 
Date: Thu, 23 May 2024 22:59:56 -0700
Subject: [PATCH 3/4] Fix formatting.

---
 .../Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp 
b/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp
index 4547ffd800b6d..72a7363204083 100644
--- 
a/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp
+++ 
b/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp
@@ -173,7 +173,7 @@ class RefCntblBaseVirtualDtorChecker
 continue;
 
   if (auto *CTSD = dyn_cast(C)) {
-for (auto& Arg : CTSD->getTemplateArgs().asArray()) {
+for (auto  : CTSD->getTemplateArgs().asArray()) {
   if (Arg.getKind() != TemplateArgument::Type)
 continue;
   auto TemplT = Arg.getAsType();

>From e11b86cad8d7428ca8b68d4cbfaf8b095c4bb1a2 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa 
Date: Sat, 25 May 2024 01:35:02 -0700
Subject: [PATCH 4/4] Address the review comment.

---
 .../Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp  | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp 
b/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp
index 72a7363204083..26879f2f87c8b 100644
--- 
a/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp
+++ 
b/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp
@@ -88,10 +88,8 @@ class DerefFuncDeleteExprVisitor
 if (ArgList) {
   auto ParmIndex = ParmType->getIndex();
   auto Type = ArgList->get(ParmIndex).getAsType();
-  if (auto *RD = dyn_cast(Type)) {
-if (RD->getDecl() == ClassDecl)
-  return true;
-  }
+  if (Type->getAsCXXRecordDecl() == ClassDecl)
+return true;
 }
   } else if (auto *RD = dyn_cast(PointeeType)) {
 if (RD->getDecl() == ClassDecl)

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via cfe-commits

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via cfe-commits

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via cfe-commits


@@ -1488,12 +1488,81 @@ TEST_F(TokenAnnotatorTest, 
RequiresDoesNotChangeParsingOfTheRest) {
 
 TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
   auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
-  ASSERT_EQ(Tokens.size(), 7u) << Tokens;
+ "\"a\":\n"
+ ": x\n"
+ ":};");
+  ASSERT_EQ(Tokens.size(), 10u) << Tokens;
   EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
   EXPECT_TOKEN(Tokens[1], tok::l_brace, TT_InlineASMBrace);
-  EXPECT_TOKEN(Tokens[4], tok::r_brace, TT_InlineASMBrace);
+  EXPECT_TOKEN(Tokens[3], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[4], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[7], tok::r_brace, TT_InlineASMBrace);
+
+  Tokens = annotate("__asm(\n"
+"\"a\":\n"
+": x\n"
+":);");
+  ASSERT_EQ(Tokens.size(), 10u) << Tokens;
+  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
+  EXPECT_TOKEN(Tokens[3], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[4], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
+
+  Tokens = annotate("asm volatile (\n"
+"\"a_label:\"\n"
+":\n"
+": x\n"
+":);");
+  ASSERT_EQ(Tokens.size(), 11u) << Tokens;
+  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
+  EXPECT_TOKEN(Tokens[4], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[7], tok::colon, TT_InlineASMColon);
+
+  Tokens = annotate("__asm__(\n"
+"\"a_label:\"\n"
+": x\n"
+":\n"
+": y);");
+  ASSERT_EQ(Tokens.size(), 11u) << Tokens;
+  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
+  EXPECT_TOKEN(Tokens[3], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
+
+  Tokens = annotate("__asm volatile (\n"
+"\"a_label:\"\n"
+"\"a b c(%%x)\"\n"
+":\n"
+": x\n"
+":);");
+  ASSERT_EQ(Tokens.size(), 12u) << Tokens;
+  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
+  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[8], tok::colon, TT_InlineASMColon);
+
+  Tokens = annotate("asm(\n"
+"\"insn\"\n"
+": \"=r\" (var1), \"=\" (value)\n"
+":\n"
+": \"memory\");");
+  ASSERT_EQ(Tokens.size(), 19u) << Tokens;
+  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
+  EXPECT_TOKEN(Tokens[3], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[13], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[14], tok::colon, TT_InlineASMColon);
+
+  Tokens = annotate("__asm__ volatile (\n"
+"\"ldr r1, [r0, %%[sym]]\"\n"
+":\n"
+": [sym] \"J\" (a(, ))\n"
+");");
+  ASSERT_EQ(Tokens.size(), 21u) << Tokens;
+  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
+  EXPECT_TOKEN(Tokens[4], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
 }

owenca wrote:

```suggestion
  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMSymbolicNameLSquare);
}
```

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via cfe-commits

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


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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via cfe-commits

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


[Lldb-commits] [flang] [lldb] [llvm] [flang] [lldb] [llvm] Fix 'destory' comment typos [NFC] (PR #93260)

2024-05-25 Thread Stephan T. Lavavej via lldb-commits

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


[Lldb-commits] [lldb] 25f4ead - [flang] [lldb] [llvm] Fix 'destory' comment typos [NFC] (#93260)

2024-05-25 Thread via lldb-commits

Author: Stephan T. Lavavej
Date: 2024-05-24T23:57:12-07:00
New Revision: 25f4ead96618dd5d54072689d2f399b8189b574f

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

LOG: [flang] [lldb] [llvm] Fix 'destory' comment typos [NFC] (#93260)

Added: 


Modified: 
flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp
lldb/include/lldb/Target/Process.h
llvm/lib/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.cpp
llvm/test/Transforms/Coroutines/no-suspend.ll

Removed: 




diff  --git a/flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp 
b/flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
index 11196353b07c7..218b38e9ba79d 100644
--- a/flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
+++ b/flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
@@ -1115,7 +1115,7 @@ mlir::LogicalResult
 hlfir::MatmulOp::canonicalize(MatmulOp matmulOp,
   mlir::PatternRewriter ) {
   // the only two uses of the transposed matrix should be for the hlfir.matmul
-  // and hlfir.destory
+  // and hlfir.destroy
   auto isOtherwiseUnused = [&](hlfir::TransposeOp transposeOp) -> bool {
 std::size_t numUses = 0;
 for (mlir::Operation *user : transposeOp.getResult().getUsers()) {

diff  --git a/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp 
b/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp
index 06d0518763848..6c8e3e1193747 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp
@@ -32,7 +32,7 @@ namespace hlfir {
 } // namespace hlfir
 
 /// If the elemental has only two uses and those two are an apply operation and
-/// a destory operation, return those two, otherwise return {}
+/// a destroy operation, return those two, otherwise return {}
 static std::optional>
 getTwoUses(hlfir::ElementalOp elemental) {
   mlir::Operation::user_range users = elemental->getUsers();

diff  --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index aac0cf51680a9..637d34c29715c 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -915,8 +915,8 @@ class Process : public 
std::enable_shared_from_this,
   /// \param[in] force_kill
   /// Whether lldb should force a kill (instead of a detach) from
   /// the inferior process.  Normally if lldb launched a binary and
-  /// Destory is called, lldb kills it.  If lldb attached to a
-  /// running process and Destory is called, lldb detaches.  If
+  /// Destroy is called, lldb kills it.  If lldb attached to a
+  /// running process and Destroy is called, lldb detaches.  If
   /// this behavior needs to be over-ridden, this is the bool that
   /// can be used.
   ///

diff  --git 
a/llvm/lib/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.cpp 
b/llvm/lib/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.cpp
index 4da031716e32a..3cdffb8cd0615 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.cpp
@@ -75,7 +75,7 @@ Error 
SimpleExecutorMemoryManager::finalize(tpctypes::FinalizeRequest ) {
   auto BailOut = [&](Error Err) {
 std::pair AllocToDestroy;
 
-// Get allocation to destory.
+// Get allocation to destroy.
 {
   std::lock_guard Lock(M);
   auto I = Allocations.find(Base.toPtr());
@@ -153,7 +153,7 @@ Error SimpleExecutorMemoryManager::deallocate(
   std::vector> AllocPairs;
   AllocPairs.reserve(Bases.size());
 
-  // Get allocation to destory.
+  // Get allocation to destroy.
   Error Err = Error::success();
   {
 std::lock_guard Lock(M);

diff  --git a/llvm/test/Transforms/Coroutines/no-suspend.ll 
b/llvm/test/Transforms/Coroutines/no-suspend.ll
index 53eb98f1273a9..fd8c5ac990958 100644
--- a/llvm/test/Transforms/Coroutines/no-suspend.ll
+++ b/llvm/test/Transforms/Coroutines/no-suspend.ll
@@ -325,7 +325,7 @@ body:
   %save = call token @llvm.coro.save(ptr %hdl)
   %subfn = call ptr @llvm.coro.subfn.addr(ptr %hdl, i8 1)
   call fastcc void %subfn(ptr %hdl)
-  ; memcpy separates destory from suspend, therefore cannot simplify.
+  ; memcpy separates destroy from suspend, therefore cannot simplify.
   call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false)
   %0 = call i8 @llvm.coro.suspend(token %save, i1 false)
   switch i8 %0, label %suspend [i8 0, label %resume



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


[clang] [clang] Report erroneous floating point results in _Complex math (PR #90588)

2024-05-24 Thread Timm Baeder via cfe-commits
nf_sign(__real__((1.0 + InfC) * (1.0 + InfC))) == 
-1);
+static_assert(__builtin_isinf_sign(__real__(InfInf * InfInf)) == 0);
 static_assert(__builtin_isinf_sign(__real__((__builtin_inf() + 1.0j) / (1.0 + 
1.0j))) == 1);
-static_assert(__builtin_isinf_sign(__imag__(1.0 + (__builtin_inf() * 1.0j) / 
(1.0 + 1.0j))) == 1);
-static_assert(__builtin_isinf_sign(__imag__((__builtin_inf() + __builtin_inf() 
* 1.0j) / (1.0 + 1.0j))) == 1);
+static_assert(__builtin_isinf_sign(__imag__(1.0 + (InfC) / (1.0 + 1.0j))) == 
1);
+static_assert(__builtin_isinf_sign(__imag__((InfInf) / (1.0 + 1.0j))) == 0);
 static_assert(__builtin_isinf_sign(__real__((__builtin_inf() + 1.0j) / 1.0)) 
== 1);
-static_assert(__builtin_isinf_sign(__imag__(1.0 + (__builtin_inf() * 1.0j) / 
1.0)) == 1);
-static_assert(__builtin_isinf_sign(__imag__((__builtin_inf() + __builtin_inf() 
* 1.0j) / 1.0)) == 1);
-
+static_assert(__builtin_isinf_sign(__imag__(1.0 + (InfC) / 1.0)) == 1);
+static_assert(__builtin_isinf_sign(__imag__((InfInf) / 1.0)) == 1);
 static_assert(((1.0 + 1.0j) / (__builtin_inf() + 1.0j)) == (0.0 + 0.0j));
-static_assert(((1.0 + 1.0j) / (1.0 + __builtin_inf() * 1.0j)) == (0.0 + 0.0j));
-static_assert(((1.0 + 1.0j) / (__builtin_inf() + __builtin_inf() * 1.0j)) == 
(0.0 + 0.0j));
+static_assert(((1.0 + 1.0j) / (1.0 + InfC)) == (0.0 + 0.0j));
+static_assert(((1.0 + 1.0j) / (InfInf)) == (0.0 + 0.0j));
 static_assert(((1.0 + 1.0j) / __builtin_inf()) == (0.0 + 0.0j));
-
+static_assert(1.0j / 0.0 == 1); // expected-error {{static assertion}} \
+// expected-note {{division by zero}}
 static_assert(__builtin_isinf_sign(__real__((1.0 + 1.0j) / (0.0 + 0.0j))) == 
1);
-static_assert(__builtin_isinf_sign(__real__((1.0 + 1.0j) / 0.0)) == 1);
-
+static_assert(__builtin_isinf_sign(__real__((1.0 + 1.0j) / 0.0)) == 1); // 
expected-error {{static assertion}} \
+// 
expected-note {{division by zero}}
 static_assert(__builtin_isinf_sign(__real__((__builtin_inf() + 1.0j) / (0.0 + 
0.0j))) == 1);
-static_assert(__builtin_isinf_sign(__imag__((1.0 + __builtin_inf() * 1.0j) / 
(0.0 + 0.0j))) == 1);
-static_assert(__builtin_isinf_sign(__imag__((__builtin_inf() + __builtin_inf() 
* 1.0j) / (0.0 + 0.0j))) == 1);
-static_assert(__builtin_isinf_sign(__real__((__builtin_inf() + 1.0j) / 0.0)) 
== 1);
-static_assert(__builtin_isinf_sign(__imag__((1.0 + __builtin_inf() * 1.0j) / 
0.0)) == 1);
-static_assert(__builtin_isinf_sign(__imag__((__builtin_inf() + __builtin_inf() 
* 1.0j) / 0.0)) == 1);
+static_assert(__builtin_isinf_sign(__imag__((1.0 + InfC) / (0.0 + 0.0j))) == 
1);
+static_assert(__builtin_isinf_sign(__imag__((InfInf) / (0.0 + 0.0j))) == 1);
+static_assert(__builtin_isinf_sign(__real__((__builtin_inf() + 1.0j) / 0.0)) 
== 1); // expected-error {{static assertion}} \
+   
 // expected-note {{division by zero}}
+static_assert(__builtin_isinf_sign(__imag__((1.0 + InfC) / 0.0)) == 1); // 
expected-error {{static assertion}} \
+// 
expected-note {{division by zero}}
+static_assert(__builtin_isinf_sign(__imag__((InfInf) / 0.0)) == 1); // 
expected-error {{static assertion}} \
+// 
expected-note {{division by zero}}
+

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


[clang] [clang] Report erroneous floating point results in _Complex math (PR #90588)

2024-05-24 Thread Timm Baeder via cfe-commits
n_isinf_sign(__real__((1.0 + InfC) * (1.0 + InfC))) == 
-1);
+static_assert(__builtin_isinf_sign(__real__(InfInf * InfInf)) == 0);
 static_assert(__builtin_isinf_sign(__real__((__builtin_inf() + 1.0j) / (1.0 + 
1.0j))) == 1);
-static_assert(__builtin_isinf_sign(__imag__(1.0 + (__builtin_inf() * 1.0j) / 
(1.0 + 1.0j))) == 1);
-static_assert(__builtin_isinf_sign(__imag__((__builtin_inf() + __builtin_inf() 
* 1.0j) / (1.0 + 1.0j))) == 1);
+static_assert(__builtin_isinf_sign(__imag__(1.0 + (InfC) / (1.0 + 1.0j))) == 
1);
+static_assert(__builtin_isinf_sign(__imag__((InfInf) / (1.0 + 1.0j))) == 0);
 static_assert(__builtin_isinf_sign(__real__((__builtin_inf() + 1.0j) / 1.0)) 
== 1);
-static_assert(__builtin_isinf_sign(__imag__(1.0 + (__builtin_inf() * 1.0j) / 
1.0)) == 1);
-static_assert(__builtin_isinf_sign(__imag__((__builtin_inf() + __builtin_inf() 
* 1.0j) / 1.0)) == 1);
-
+static_assert(__builtin_isinf_sign(__imag__(1.0 + (InfC) / 1.0)) == 1);
+static_assert(__builtin_isinf_sign(__imag__((InfInf) / 1.0)) == 1);
 static_assert(((1.0 + 1.0j) / (__builtin_inf() + 1.0j)) == (0.0 + 0.0j));
-static_assert(((1.0 + 1.0j) / (1.0 + __builtin_inf() * 1.0j)) == (0.0 + 0.0j));
-static_assert(((1.0 + 1.0j) / (__builtin_inf() + __builtin_inf() * 1.0j)) == 
(0.0 + 0.0j));
+static_assert(((1.0 + 1.0j) / (1.0 + InfC)) == (0.0 + 0.0j));
+static_assert(((1.0 + 1.0j) / (InfInf)) == (0.0 + 0.0j));
 static_assert(((1.0 + 1.0j) / __builtin_inf()) == (0.0 + 0.0j));
-
+static_assert(1.0j / 0.0 == 1); // expected-error {{static assertion}} \
+// expected-note {{division by zero}}
 static_assert(__builtin_isinf_sign(__real__((1.0 + 1.0j) / (0.0 + 0.0j))) == 
1);
-static_assert(__builtin_isinf_sign(__real__((1.0 + 1.0j) / 0.0)) == 1);
-
+static_assert(__builtin_isinf_sign(__real__((1.0 + 1.0j) / 0.0)) == 1); // 
expected-error {{static assertion}} \
+// 
expected-note {{division by zero}}
 static_assert(__builtin_isinf_sign(__real__((__builtin_inf() + 1.0j) / (0.0 + 
0.0j))) == 1);
-static_assert(__builtin_isinf_sign(__imag__((1.0 + __builtin_inf() * 1.0j) / 
(0.0 + 0.0j))) == 1);
-static_assert(__builtin_isinf_sign(__imag__((__builtin_inf() + __builtin_inf() 
* 1.0j) / (0.0 + 0.0j))) == 1);
-static_assert(__builtin_isinf_sign(__real__((__builtin_inf() + 1.0j) / 0.0)) 
== 1);
-static_assert(__builtin_isinf_sign(__imag__((1.0 + __builtin_inf() * 1.0j) / 
0.0)) == 1);
-static_assert(__builtin_isinf_sign(__imag__((__builtin_inf() + __builtin_inf() 
* 1.0j) / 0.0)) == 1);
+static_assert(__builtin_isinf_sign(__imag__((1.0 + InfC) / (0.0 + 0.0j))) == 
1);
+static_assert(__builtin_isinf_sign(__imag__((InfInf) / (0.0 + 0.0j))) == 1);
+static_assert(__builtin_isinf_sign(__real__((__builtin_inf() + 1.0j) / 0.0)) 
== 1); // expected-error {{static assertion}} \
+   
 // expected-note {{division by zero}}
+static_assert(__builtin_isinf_sign(__imag__((1.0 + InfC) / 0.0)) == 1); // 
expected-error {{static assertion}} \
+// 
expected-note {{division by zero}}
+static_assert(__builtin_isinf_sign(__imag__((InfInf) / 0.0)) == 1); // 
expected-error {{static assertion}} \
+// 
expected-note {{division by zero}}
+

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Gedare Bloom via cfe-commits

gedare wrote:

> It seems that you used 5 different assembly snippets and repeated each 3-6 
> times. Instead, we can have something like the following:
> 
> ```
> asm{Snippet 1};
> 
> __asm(Snippet 2);
> 
> __asm__(Snippet 3);
> 
> asm volatile (Snippet 4);
> 
> __asm volatile (Snippet 5);
> ```
> 
> Also, no space between `tok::asm` (i.e. `asm`, `__asm`, or `__asm__`) and `(`.

done, thanks for the clarification

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Gedare Bloom via cfe-commits


@@ -1488,12 +1488,247 @@ TEST_F(TokenAnnotatorTest, 
RequiresDoesNotChangeParsingOfTheRest) {
 
 TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
   auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
-  ASSERT_EQ(Tokens.size(), 7u) << Tokens;
+ "\"a\":\n"
+ ": x\n"
+ ":};");

gedare wrote:

AFAIK it's not valid, unless `a` is a CPP string.

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Gedare Bloom via cfe-commits
N(Tokens[7], tok::colon, TT_InlineASMColon);
 
-  Tokens = annotate("__asm__ volatile (\n"
-"\"a_label:\"\n"
-":\n"
-": x\n"
-":);");
-  ASSERT_EQ(Tokens.size(), 11u) << Tokens;
-  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
-  EXPECT_TOKEN(Tokens[4], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[7], tok::colon, TT_InlineASMColon);
-
-  Tokens = annotate("__asm (\n"
-"\"a_label:\"\n"
-": x\n"
-":\n"
-": y);");
-  ASSERT_EQ(Tokens.size(), 11u) << Tokens;
-  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
-  EXPECT_TOKEN(Tokens[3], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
-
-  Tokens = annotate("asm (\n"
-"\"a_label:\"\n"
-": x\n"
-":\n"
-": y);");
-  ASSERT_EQ(Tokens.size(), 11u) << Tokens;
-  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
-  EXPECT_TOKEN(Tokens[3], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
-
-  Tokens = annotate("__asm__ (\n"
+  Tokens = annotate("__asm__(\n"
 "\"a_label:\"\n"
 ": x\n"
 ":\n"
@@ -1631,65 +1543,7 @@ TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
   EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
   EXPECT_TOKEN(Tokens[8], tok::colon, TT_InlineASMColon);
 
-  Tokens = annotate("__asm volatile (\n"
-"\"a_label:\"\n"
-"\"a b c(%%x)\"\n"
-":\n"
-": x\n"
-":);");
-  ASSERT_EQ(Tokens.size(), 12u) << Tokens;
-  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
-  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[8], tok::colon, TT_InlineASMColon);
-
-  Tokens = annotate("asm volatile (\n"
-"\"a_label:\"\n"
-"\"a b c(%%x)\"\n"
-":\n"
-": x\n"
-":);");
-  ASSERT_EQ(Tokens.size(), 12u) << Tokens;
-  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
-  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[8], tok::colon, TT_InlineASMColon);
-
-  Tokens = annotate("__asm__ volatile (\n"
-"\"a_label:\"\n"
-"\"a b c(%%x)\"\n"
-":\n"
-": x\n"
-":);");
-  ASSERT_EQ(Tokens.size(), 12u) << Tokens;
-  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
-  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[8], tok::colon, TT_InlineASMColon);
-
-  Tokens = annotate("__asm (\n"
-"\"insn\"\n"
-": \"=r\" (var1), \"=\" (value)\n"
-":\n"
-": \"memory\");");
-  ASSERT_EQ(Tokens.size(), 19u) << Tokens;
-  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
-  EXPECT_TOKEN(Tokens[3], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[13], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[14], tok::colon, TT_InlineASMColon);
-
-  Tokens = annotate("asm (\n"
-"\"insn\"\n"
-": \"=r\" (var1), \"=\" (value)\n"
-":\n"
-": \"memory\");");
-  ASSERT_EQ(Tokens.size(), 19u) << Tokens;
-  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
-  EXPECT_TOKEN(Tokens[3], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[13], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[14], tok::colon, TT_InlineASMColon);
-
-  Tokens = annotate("__asm__ (\n"
+  Tokens = annotate("asm(\n"
 "\"insn\"\n"
 ": \"=r\" (var1), \"=\" (value)\n"
 ":\n"
@@ -1700,26 +1554,6 @@ TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
   EXPECT_TOKEN(Tokens[13], tok::colon, TT_InlineASMColon);
   EXPECT_TOKEN(Tokens[14], tok::colon, TT_InlineASMColon);
 
-  Tokens = annotate("__asm volatile (\n"
-"\"ldr r1, [r0, %%[sym]]\"\n"
-":\n"
-": [sym] \"J\" (a(, ))\n"
-");");
-  ASSERT_EQ(Tokens.size(), 21u) << Tokens;
-  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
-  EXPECT_TOKEN(Tokens[4], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
-
-  Tokens = annotate("asm volatile (\n"
-"\"ldr r1, [r0, %%[sym]]\"\n"
-":\n"
-": [sym] \"J\" (a(, ))\n"
-");");
-  ASSERT_EQ(Tokens.size(), 21u) << Tokens;
-  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
-  EXPECT_TOKEN(Tokens[4], tok::colon, TT_InlineASMColon);
-  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
-
   Tokens = annotate("__asm__ volatile (\n"
 "\"ldr r1, [r0, %%[sym]]\"\n"
 ":\n"

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


[clang] 7d29718 - [CMake] Update CMake cache file for the Win-to-Arm cross toolchains. NFC. (#93363)

2024-05-24 Thread via cfe-commits
  
   OFF CACHE BOOL "")
-set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ABI_VERSION 
   2 CACHE STRING "")
+set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ABI_VERSION 
   ${LIBCXX_ABI_VERSION} CACHE STRING "")
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_CXX_ABI 
   "libcxxabi" CACHE STRING "")#!!!
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS   
   ON CACHE BOOL "")
 



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


[clang] [CMake] Update CMake cache file for the Win-to-Arm cross toolchains. NFC. (PR #93363)

2024-05-24 Thread Vladimir Vereschaka via cfe-commits

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


[clang] [clang][Interp] Member Pointers (PR #91303)

2024-05-24 Thread via cfe-commits
Timm =?utf-8?q?Bäder?= 
Message-ID:
In-Reply-To: 


github-actions[bot] wrote:




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



You can test this locally with the following command:


``bash
git-clang-format --diff 5c40db1da3a5ee1ed27b2ed874353dd80b294c15 
19bb75633bf6875cecd0d6ec72e4d756c4b39174 -- 
clang/lib/AST/Interp/MemberPointer.cpp clang/lib/AST/Interp/MemberPointer.h 
clang/test/AST/Interp/memberpointers.cpp 
clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/Context.cpp 
clang/lib/AST/Interp/Context.h clang/lib/AST/Interp/Descriptor.cpp 
clang/lib/AST/Interp/Disasm.cpp clang/lib/AST/Interp/Interp.cpp 
clang/lib/AST/Interp/Interp.h clang/lib/AST/Interp/InterpFrame.cpp 
clang/lib/AST/Interp/InterpStack.cpp clang/lib/AST/Interp/InterpStack.h 
clang/lib/AST/Interp/Pointer.cpp clang/lib/AST/Interp/Pointer.h 
clang/lib/AST/Interp/PrimType.cpp clang/lib/AST/Interp/PrimType.h 
clang/test/AST/Interp/eval-order.cpp clang/test/AST/Interp/literals.cpp 
clang/test/CodeGenCXX/mangle-ms-templates-memptrs.cpp 
clang/test/CodeGenCXX/pointers-to-data-members.cpp 
clang/test/SemaCXX/attr-weak.cpp 
clang/test/SemaCXX/nullptr_in_arithmetic_ops.cpp 
clang/unittests/AST/Interp/toAPValue.cpp
``





View the diff from clang-format here.


``diff
diff --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp 
b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index 53e6b4cfc4..25c600efc2 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -3349,7 +3349,7 @@ bool ByteCodeExprGen::VisitCallExpr(const 
CallExpr *E) {
   if (!this->emitGetMemberPtrBase(E))
 return false;
 } else if (!this->visit(MC->getImplicitObjectArgument())) {
-return false;
+  return false;
 }
   }
 
diff --git a/clang/lib/AST/Interp/MemberPointer.h 
b/clang/lib/AST/Interp/MemberPointer.h
index d5299e0ff1..2eca911fc8 100644
--- a/clang/lib/AST/Interp/MemberPointer.h
+++ b/clang/lib/AST/Interp/MemberPointer.h
@@ -34,7 +34,8 @@ public:
   MemberPointer(uint32_t Address, const Descriptor *D) {
 // This should be impossible to hit, at least I've been unable
 // to write a test for it.
-assert(false && "This constructor shouldn't be reachable for 
MemberPointers");
+assert(false &&
+   "This constructor shouldn't be reachable for MemberPointers");
   }
 
   MemberPointer(const Decl *D) : Dcl(D) {
@@ -43,7 +44,9 @@ public:
   }
 
   uint64_t getIntegerRepresentation() const {
-assert(false && "getIntegerRepresentation() shouldn't be reachable for 
MemberPointers");
+assert(
+false &&
+"getIntegerRepresentation() shouldn't be reachable for 
MemberPointers");
 return 17;
   }
 

``




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


[clang] [clang][Interp] Member Pointers (PR #91303)

2024-05-24 Thread Timm Baeder via cfe-commits
// RUN: FileCheck %s < %t.ll
 // RUN: FileCheck -check-prefix=CHECK-GLOBAL %s < %t.ll
 
diff --git a/clang/test/SemaCXX/attr-weak.cpp b/clang/test/SemaCXX/attr-weak.cpp
index f065bfd9483f8..0f9a2975e5f68 100644
--- a/clang/test/SemaCXX/attr-weak.cpp
+++ b/clang/test/SemaCXX/attr-weak.cpp
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify 
-std=c++11 %s
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify 
-std=c++11 %s -fexperimental-new-constant-interpreter
 
 static int test0 __attribute__((weak)); // expected-error {{weak declaration 
cannot have internal linkage}}
 static void test1() __attribute__((weak)); // expected-error {{weak 
declaration cannot have internal linkage}}
diff --git a/clang/test/SemaCXX/nullptr_in_arithmetic_ops.cpp 
b/clang/test/SemaCXX/nullptr_in_arithmetic_ops.cpp
index 6273d9c42e0b1..df8bbcc0eda5d 100644
--- a/clang/test/SemaCXX/nullptr_in_arithmetic_ops.cpp
+++ b/clang/test/SemaCXX/nullptr_in_arithmetic_ops.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wno-tautological-pointer-compare -fblocks 
-std=c++11 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-tautological-pointer-compare -fblocks 
-std=c++11 -verify %s -fexperimental-new-constant-interpreter
 
 void foo() {
   int a;
diff --git a/clang/unittests/AST/Interp/toAPValue.cpp 
b/clang/unittests/AST/Interp/toAPValue.cpp
index e56453aba2c5f..d6879d6e0bca3 100644
--- a/clang/unittests/AST/Interp/toAPValue.cpp
+++ b/clang/unittests/AST/Interp/toAPValue.cpp
@@ -186,3 +186,49 @@ TEST(ToAPValue, FunctionPointersC) {
 ASSERT_EQ(I, 17);
   }
 }
+
+TEST(ToAPValue, MemberPointers) {
+  constexpr char Code[] = "struct S {\n"
+  "  int m, n;\n"
+  "};\n"
+  "constexpr int S::*pm = ::m;\n"
+  "constexpr int S::*nn = nullptr;\n";
+
+  auto AST = tooling::buildASTFromCodeWithArgs(
+  Code, {"-fexperimental-new-constant-interpreter"});
+
+  auto  = AST->getASTContext().getInterpContext();
+  Program  = Ctx.getProgram();
+
+  auto getDecl = [&](const char *Name) -> const ValueDecl * {
+auto Nodes =
+match(valueDecl(hasName(Name)).bind("var"), AST->getASTContext());
+assert(Nodes.size() == 1);
+const auto *D = Nodes[0].getNodeAs("var");
+assert(D);
+return D;
+  };
+
+  auto getGlobalPtr = [&](const char *Name) -> Pointer {
+const VarDecl *D = cast(getDecl(Name));
+return Prog.getPtrGlobal(*Prog.getGlobal(D));
+  };
+
+  {
+const Pointer  = getGlobalPtr("pm");
+ASSERT_TRUE(GP.isLive());
+const MemberPointer  = GP.deref();
+APValue A = FP.toAPValue();
+ASSERT_EQ(A.getMemberPointerDecl(), getDecl("m"));
+ASSERT_EQ(A.getKind(), APValue::MemberPointer);
+  }
+
+  {
+const Pointer  = getGlobalPtr("nn");
+ASSERT_TRUE(GP.isLive());
+const MemberPointer  = GP.deref();
+ASSERT_TRUE(NP.isZero());
+APValue A = NP.toAPValue();
+ASSERT_EQ(A.getKind(), APValue::MemberPointer);
+  }
+}

>From 19bb75633bf6875cecd0d6ec72e4d756c4b39174 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= 
Date: Sat, 25 May 2024 06:41:13 +0200
Subject: [PATCH 2/2] Address review feedback

---
 clang/lib/AST/Interp/ByteCodeExprGen.cpp | 3 +--
 clang/lib/AST/Interp/MemberPointer.h | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp 
b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index 5f8b94c3a0f94..53e6b4cfc417a 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -3348,8 +3348,7 @@ bool ByteCodeExprGen::VisitCallExpr(const 
CallExpr *E) {
 return false;
   if (!this->emitGetMemberPtrBase(E))
 return false;
-} else {
-  if (!this->visit(MC->getImplicitObjectArgument()))
+} else if (!this->visit(MC->getImplicitObjectArgument())) {
 return false;
 }
   }
diff --git a/clang/lib/AST/Interp/MemberPointer.h 
b/clang/lib/AST/Interp/MemberPointer.h
index a7551678eec20..d5299e0ff15c6 100644
--- a/clang/lib/AST/Interp/MemberPointer.h
+++ b/clang/lib/AST/Interp/MemberPointer.h
@@ -34,6 +34,7 @@ class MemberPointer final {
   MemberPointer(uint32_t Address, const Descriptor *D) {
 // This should be impossible to hit, at least I've been unable
 // to write a test for it.
+assert(false && "This constructor shouldn't be reachable for 
MemberPointers");
   }
 
   MemberPointer(const Decl *D) : Dcl(D) {
@@ -42,8 +43,7 @@ class MemberPointer final {
   }
 
   uint64_t getIntegerRepresentation() const {
-// This should be impossible to hit, at least I've been unable
-// to write a test for it.
+assert(false && "getIntegerRepresentation() shouldn't be reachable for 
MemberPointers");
 return 17;
   }
 

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


[clang] [clang][Interp] Member Pointers (PR #91303)

2024-05-24 Thread Timm Baeder via cfe-commits


@@ -3123,10 +3172,28 @@ bool ByteCodeExprGen::VisitCallExpr(const 
CallExpr *E) {
 }
   }
 
+  std::optional CalleeOffset;
   // Add the (optional, implicit) This pointer.
   if (const auto *MC = dyn_cast(E)) {
-if (!this->visit(MC->getImplicitObjectArgument()))
-  return false;
+if (!FuncDecl && classifyPrim(E->getCallee()) == PT_MemberPtr) {
+  // If we end up creating a CallPtr op for this, we need the base of the
+  // member pointer as the instance pointer, and later extract the function
+  // decl as the function pointer.
+  const Expr *Callee = E->getCallee();
+  CalleeOffset =
+  this->allocateLocalPrimitive(Callee, PT_MemberPtr, true, false);
+  if (!this->visit(Callee))
+return false;
+  if (!this->emitSetLocal(PT_MemberPtr, *CalleeOffset, E))
+return false;
+  if (!this->emitGetLocal(PT_MemberPtr, *CalleeOffset, E))

tbaederr wrote:

We could also `dup()` the value before the `SetLocal` - but the `SetLocal` will 
remove it from the stack, so we have to get the value somehow again.

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


[clang] [clang][Interp] Member Pointers (PR #91303)

2024-05-24 Thread Timm Baeder via cfe-commits


@@ -0,0 +1,112 @@
+//===- MemberPointer.h --*- C++ 
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLVM_CLANG_AST_INTERP_MEMBER_POINTER_H
+#define LLVM_CLANG_AST_INTERP_MEMBER_POINTER_H
+
+#include "Pointer.h"
+#include 
+
+namespace clang {
+class ASTContext;
+namespace interp {
+
+class Context;
+class FunctionPointer;
+
+class MemberPointer final {
+private:
+  Pointer Base;
+  const Decl *Dcl = nullptr;
+  int32_t PtrOffset = 0;
+
+  MemberPointer(Pointer Base, const Decl *Dcl, int32_t PtrOffset)
+  : Base(Base), Dcl(Dcl), PtrOffset(PtrOffset) {}
+
+public:
+  MemberPointer() = default;
+  MemberPointer(Pointer Base, const Decl *Dcl) : Base(Base), Dcl(Dcl) {}
+  MemberPointer(uint32_t Address, const Descriptor *D) {
+// This should be impossible to hit, at least I've been unable
+// to write a test for it.
+  }
+
+  MemberPointer(const Decl *D) : Dcl(D) {
+assert(isa(D) || isa(D) ||
+   isa(D));

tbaederr wrote:

I made that change at least a few times locally, but it doesn't work:
```
/home/tbaeder/code/llvm-project/clang/lib/AST/Interp/MemberPointer.h:40:27: 
error: too many arguments provided to function-like macro invocation
   40 | assert(isa(D));
  |   ^
/usr/include/assert.h:99:11: note: macro 'assert' defined here
   99 | #  define assert(expr)  
\
  |   ^

```

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Hirofumi Nakamura via cfe-commits


@@ -1426,12 +1428,9 @@ class AnnotatingParser {
 // the colon are passed as macro arguments.
 Tok->setType(TT_ObjCMethodExpr);
   } else if (Contexts.back().ContextKind == tok::l_paren &&
- !Line.InPragmaDirective) {
-if (Style.isTableGen() && Contexts.back().IsTableGenDAGArg) {
-  Tok->setType(TT_TableGenDAGArgListColon);
-  break;
-}
-Tok->setType(TT_InlineASMColon);
+ !Line.InPragmaDirective && Style.isTableGen() &&
+ Contexts.back().IsTableGenDAGArg) {
+Tok->setType(TT_TableGenDAGArgListColon);

hnakamura5 wrote:

No objection. This seems redundant. Thank you for removing.

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


[Lldb-commits] [lldb] [lldb] Allow specific 'make' tool for LLDB testsuite. (PR #93367)

2024-05-24 Thread via lldb-commits
uot;@LLDB_TEST_BUILD_DIRECTORY@"
 config.python_executable = "@Python3_EXECUTABLE@"
 config.lua_executable = "@Lua_EXECUTABLE@"
+config.make_executable = "@Make_EXECUTABLE@"
 config.lua_test_entry = "TestLuaAPI.py"
 config.dotest_common_args_str = 
lit_config.substitute("@LLDB_TEST_COMMON_ARGS@")
 config.dotest_user_args_str = lit_config.substitute("@LLDB_TEST_USER_ARGS@")
diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index 6a9ca59f96b0f..8a2966d43f60d 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -9,6 +9,16 @@ if (NOT DEFINED Python3_EXECUTABLE)
 "`LLDB_INCLUDE_TESTS=OFF`.")
 endif()
 
+if (NOT DEFINED Make_EXECUTABLE)
+  find_program(Make_EXECUTABLE NAMES make
+   PATH_SUFFIXES bin
+   DOC "Make build tool"
+   # Avoid searching with CMAKE_SYSROOT for the target platform.
+   # The target platform could be a binary incompatible.
+   NO_CMAKE_FIND_ROOT_PATH
+   REQUIRED)
+endif()
+
 if(LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS)
   message(STATUS "Enforcing strict test requirements for LLDB")
   # Lit uses psutil to do per-test timeouts.
diff --git a/lldb/test/Shell/lit.site.cfg.py.in 
b/lldb/test/Shell/lit.site.cfg.py.in
index b69e7bce1bc0b..e6385842e900e 100644
--- a/lldb/test/Shell/lit.site.cfg.py.in
+++ b/lldb/test/Shell/lit.site.cfg.py.in
@@ -16,6 +16,7 @@ config.lldb_lit_tools_dir = 
lit_config.substitute(r"@LLDB_LIT_TOOLS_DIR@")
 config.cmake_sysroot = lit_config.substitute("@CMAKE_SYSROOT@")
 config.target_triple = "@LLVM_TARGET_TRIPLE@"
 config.python_executable = "@Python3_EXECUTABLE@"
+config.make_executable = "@Make_EXECUTABLE@"
 config.have_zlib = @LLVM_ENABLE_ZLIB@
 config.objc_gnustep_dir = "@LLDB_TEST_OBJC_GNUSTEP_DIR@"
 config.lldb_enable_lzma = @LLDB_ENABLE_LZMA@
diff --git a/lldb/test/Unit/lit.site.cfg.py.in 
b/lldb/test/Unit/lit.site.cfg.py.in
index b22af0f381439..dabf033b11f02 100644
--- a/lldb/test/Unit/lit.site.cfg.py.in
+++ b/lldb/test/Unit/lit.site.cfg.py.in
@@ -10,6 +10,7 @@ config.lldb_obj_root = "@LLDB_BINARY_DIR@"
 config.lldb_src_root = "@LLDB_SOURCE_DIR@"
 config.target_triple = "@LLVM_TARGET_TRIPLE@"
 config.python_executable = "@Python3_EXECUTABLE@"
+config.make_executable = "@Make_EXECUTABLE@"
 
 import lit.llvm
 lit.llvm.initialize(lit_config, config)
diff --git a/lldb/test/lit.site.cfg.py.in b/lldb/test/lit.site.cfg.py.in
index 5e1f60920638a..7eb0cea47efc0 100644
--- a/lldb/test/lit.site.cfg.py.in
+++ b/lldb/test/lit.site.cfg.py.in
@@ -10,6 +10,7 @@ config.lldb_obj_root = "@LLDB_BINARY_DIR@"
 config.lldb_src_root = "@LLDB_SOURCE_DIR@"
 config.target_triple = "@LLVM_TARGET_TRIPLE@"
 config.python_executable = "@Python3_EXECUTABLE@"
+config.make_executable = "@Make_EXECUTABLE@"
 
 import lit.llvm
 lit.llvm.initialize(lit_config, config)
diff --git a/lldb/utils/lldb-dotest/lldb-dotest.in 
b/lldb/utils/lldb-dotest/lldb-dotest.in
index 0e9648a6e6dc8..62a27fddb1933 100755
--- a/lldb/utils/lldb-dotest/lldb-dotest.in
+++ b/lldb/utils/lldb-dotest/lldb-dotest.in
@@ -19,6 +19,7 @@ has_libcxx = @LLDB_HAS_LIBCXX@
 libcxx_libs_dir = "@LIBCXX_LIBRARY_DIR@"
 libcxx_include_dir = "@LIBCXX_GENERATED_INCLUDE_DIR@"
 libcxx_include_target_dir = "@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@"
+make_executable = "@Make_EXECUTABLE@"
 
 if __name__ == '__main__':
     wrapper_args = sys.argv[1:]
@@ -46,6 +47,8 @@ if __name__ == '__main__':
 cmd.extend(['--framework', lldb_framework_dir])
 if lldb_build_intel_pt == "1":
 cmd.extend(['--enable-plugin', 'intel-pt'])
+if make_executable:
+cmd.extend(['--make', make_executable])
 cmd.extend(['--lldb-obj-root', lldb_obj_root])
 cmd.extend(wrapper_args)
 # Invoke dotest.py and return exit code.

``




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


[Lldb-commits] [lldb] [lldb] Allow specific 'make' tool for LLDB testsuite. (PR #93367)

2024-05-24 Thread Vladimir Vereschaka via lldb-commits
ent(
 "--dsymutil",
 metavar="dsymutil",
diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index d934349fe3ca3..ce8ae0c3b2341 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -227,6 +227,9 @@ def delete_module_cache(path):
 if is_configured("lldb_executable"):
 dotest_cmd += ["--executable", config.lldb_executable]
 
+if is_configured("make_executable"):
+dotest_cmd += ["--make", config.make_executable]
+
 if is_configured("test_compiler"):
 dotest_cmd += ["--compiler", config.test_compiler]
 
diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in
index 8b2d09ae41cd2..d4cadd5440a8a 100644
--- a/lldb/test/API/lit.site.cfg.py.in
+++ b/lldb/test/API/lit.site.cfg.py.in
@@ -21,6 +21,7 @@ config.target_triple = "@LLVM_TARGET_TRIPLE@"
 config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
 config.python_executable = "@Python3_EXECUTABLE@"
 config.lua_executable = "@Lua_EXECUTABLE@"
+config.make_executable = "@Make_EXECUTABLE@"
 config.lua_test_entry = "TestLuaAPI.py"
 config.dotest_common_args_str = 
lit_config.substitute("@LLDB_TEST_COMMON_ARGS@")
 config.dotest_user_args_str = lit_config.substitute("@LLDB_TEST_USER_ARGS@")
diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index 6a9ca59f96b0f..8a2966d43f60d 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -9,6 +9,16 @@ if (NOT DEFINED Python3_EXECUTABLE)
 "`LLDB_INCLUDE_TESTS=OFF`.")
 endif()
 
+if (NOT DEFINED Make_EXECUTABLE)
+  find_program(Make_EXECUTABLE NAMES make
+   PATH_SUFFIXES bin
+   DOC "Make build tool"
+   # Avoid searching with CMAKE_SYSROOT for the target platform.
+   # The target platform could be a binary incompatible.
+   NO_CMAKE_FIND_ROOT_PATH
+   REQUIRED)
+endif()
+
 if(LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS)
   message(STATUS "Enforcing strict test requirements for LLDB")
   # Lit uses psutil to do per-test timeouts.
diff --git a/lldb/test/Shell/lit.site.cfg.py.in 
b/lldb/test/Shell/lit.site.cfg.py.in
index b69e7bce1bc0b..e6385842e900e 100644
--- a/lldb/test/Shell/lit.site.cfg.py.in
+++ b/lldb/test/Shell/lit.site.cfg.py.in
@@ -16,6 +16,7 @@ config.lldb_lit_tools_dir = 
lit_config.substitute(r"@LLDB_LIT_TOOLS_DIR@")
 config.cmake_sysroot = lit_config.substitute("@CMAKE_SYSROOT@")
 config.target_triple = "@LLVM_TARGET_TRIPLE@"
 config.python_executable = "@Python3_EXECUTABLE@"
+config.make_executable = "@Make_EXECUTABLE@"
 config.have_zlib = @LLVM_ENABLE_ZLIB@
 config.objc_gnustep_dir = "@LLDB_TEST_OBJC_GNUSTEP_DIR@"
 config.lldb_enable_lzma = @LLDB_ENABLE_LZMA@
diff --git a/lldb/test/Unit/lit.site.cfg.py.in 
b/lldb/test/Unit/lit.site.cfg.py.in
index b22af0f381439..dabf033b11f02 100644
--- a/lldb/test/Unit/lit.site.cfg.py.in
+++ b/lldb/test/Unit/lit.site.cfg.py.in
@@ -10,6 +10,7 @@ config.lldb_obj_root = "@LLDB_BINARY_DIR@"
 config.lldb_src_root = "@LLDB_SOURCE_DIR@"
 config.target_triple = "@LLVM_TARGET_TRIPLE@"
 config.python_executable = "@Python3_EXECUTABLE@"
+config.make_executable = "@Make_EXECUTABLE@"
 
 import lit.llvm
 lit.llvm.initialize(lit_config, config)
diff --git a/lldb/test/lit.site.cfg.py.in b/lldb/test/lit.site.cfg.py.in
index 5e1f60920638a..7eb0cea47efc0 100644
--- a/lldb/test/lit.site.cfg.py.in
+++ b/lldb/test/lit.site.cfg.py.in
@@ -10,6 +10,7 @@ config.lldb_obj_root = "@LLDB_BINARY_DIR@"
 config.lldb_src_root = "@LLDB_SOURCE_DIR@"
 config.target_triple = "@LLVM_TARGET_TRIPLE@"
 config.python_executable = "@Python3_EXECUTABLE@"
+config.make_executable = "@Make_EXECUTABLE@"
 
 import lit.llvm
 lit.llvm.initialize(lit_config, config)
diff --git a/lldb/utils/lldb-dotest/lldb-dotest.in 
b/lldb/utils/lldb-dotest/lldb-dotest.in
index 0e9648a6e6dc8..62a27fddb1933 100755
--- a/lldb/utils/lldb-dotest/lldb-dotest.in
+++ b/lldb/utils/lldb-dotest/lldb-dotest.in
@@ -19,6 +19,7 @@ has_libcxx = @LLDB_HAS_LIBCXX@
 libcxx_libs_dir = "@LIBCXX_LIBRARY_DIR@"
 libcxx_include_dir = "@LIBCXX_GENERATED_INCLUDE_DIR@"
 libcxx_include_target_dir = "@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@"
+make_executable = "@Make_EXECUTABLE@"
 
 if __name__ == '__main__':
 wrapper_args = sys.argv[1:]
@@ -46,6 +47,8 @@ if __name__ == '__main__':
 cmd.extend(['--framework', lldb_framework_dir])
 if lldb_build_intel_pt == "1":
 cmd.extend(['--enable-plugin', 'intel-pt'])
+if make_executable:
+cmd.extend(['--make', make_executable])
 cmd.extend(['--lldb-obj-root', lldb_obj_root])
 cmd.extend(wrapper_args)
 # Invoke dotest.py and return exit code.

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


[clang] [clang-format] Add option to remove leading blank lines (PR #91221)

2024-05-24 Thread via cfe-commits
est, ParsesConfigurationBools) {
   CHECK_PARSE_BOOL(IndentWrappedFunctionNames);
   CHECK_PARSE_BOOL(InsertBraces);
   CHECK_PARSE_BOOL(InsertNewlineAtEOF);
-  CHECK_PARSE_BOOL(KeepEmptyLinesAtEOF);
-  CHECK_PARSE_BOOL(KeepEmptyLinesAtStart);
-  CHECK_PARSE_BOOL(KeepEmptyLinesAtTheStartOfBlocks);
+  CHECK_PARSE_BOOL_FIELD(KeepEmptyLines.AtEndOfFile, "KeepEmptyLinesAtEOF");
+  CHECK_PARSE_BOOL_FIELD(KeepEmptyLines.AtStartOfBlock,
+ "KeepEmptyLinesAtTheStartOfBlocks");
   CHECK_PARSE_BOOL(ObjCSpaceAfterProperty);
   CHECK_PARSE_BOOL(ObjCSpaceBeforeProtocolList);
   CHECK_PARSE_BOOL(Cpp11BracedListStyle);
@@ -224,6 +224,9 @@ TEST(ConfigParseTest, ParsesConfigurationBools) {
   CHECK_PARSE_NESTED_BOOL(BraceWrapping, SplitEmptyFunction);
   CHECK_PARSE_NESTED_BOOL(BraceWrapping, SplitEmptyRecord);
   CHECK_PARSE_NESTED_BOOL(BraceWrapping, SplitEmptyNamespace);
+  CHECK_PARSE_NESTED_BOOL(KeepEmptyLines, AtEndOfFile);
+  CHECK_PARSE_NESTED_BOOL(KeepEmptyLines, AtStartOfBlock);
+  CHECK_PARSE_NESTED_BOOL(KeepEmptyLines, AtStartOfFile);
   CHECK_PARSE_NESTED_BOOL(SpaceBeforeParensOptions, AfterControlStatements);
   CHECK_PARSE_NESTED_BOOL(SpaceBeforeParensOptions, AfterForeachMacros);
   CHECK_PARSE_NESTED_BOOL(SpaceBeforeParensOptions,
diff --git a/clang/unittests/Format/FormatTest.cpp 
b/clang/unittests/Format/FormatTest.cpp
index d76d4b7a7858c..c9fb246eb7912 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -46,7 +46,7 @@ TEST_F(FormatTest, FormatsGlobalStatementsAt0) {
   verifyFormat("int i;\nint j;", "int i; int j;");
   verifyFormat("int i;\nint j;", "int i;\n  int j;");
   auto Style = getLLVMStyle();
-  Style.KeepEmptyLinesAtStart = false;
+  Style.KeepEmptyLines.AtStartOfFile = false;
   verifyFormat("int i;", " \n\t \v \f  int i;", Style);
 }
 
@@ -166,7 +166,7 @@ TEST_F(FormatTest, RemovesEmptyLines) {
   auto CustomStyle = getLLVMStyle();
   CustomStyle.BreakBeforeBraces = FormatStyle::BS_Custom;
   CustomStyle.BraceWrapping.AfterNamespace = true;
-  CustomStyle.KeepEmptyLinesAtTheStartOfBlocks = false;
+  CustomStyle.KeepEmptyLines.AtStartOfBlock = false;
   verifyFormat("namespace N\n"
"{\n"
"\n"
@@ -392,7 +392,7 @@ TEST_F(FormatTest, RemovesEmptyLines) {
   Style.BreakBeforeBraces = FormatStyle::BS_Custom;
   Style.BraceWrapping.AfterClass = true;
   Style.BraceWrapping.AfterFunction = true;
-  Style.KeepEmptyLinesAtTheStartOfBlocks = false;
+  Style.KeepEmptyLines.AtStartOfBlock = false;
 
   verifyFormat("class Foo\n"
"{\n"
@@ -21902,7 +21902,7 @@ TEST_F(FormatTest, HandlesUTF8BOM) {
   verifyFormat("\xef\xbb\xbf#include ");
   verifyFormat("\xef\xbb\xbf\n#include ");
   auto Style = getLLVMStyle();
-  Style.KeepEmptyLinesAtStart = false;
+  Style.KeepEmptyLines.AtStartOfFile = false;
   verifyFormat("\xef\xbb\xbf#include ",
"\xef\xbb\xbf\n#include ", Style);
 }
@@ -27144,7 +27144,7 @@ TEST_F(FormatTest, InsertNewlineAtEOF) {
 
 TEST_F(FormatTest, KeepEmptyLinesAtEOF) {
   FormatStyle Style = getLLVMStyle();
-  Style.KeepEmptyLinesAtEOF = true;
+  Style.KeepEmptyLines.AtEndOfFile = true;
 
   const StringRef Code{"int i;\n\n"};
   verifyNoChange(Code, Style);

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


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

2024-05-24 Thread Max Winkler via cfe-commits

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


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

2024-05-24 Thread via cfe-commits
r.cpp 
b/clang/lib/Frontend/InitPreprocessor.cpp
index 68760e3e0..e8c8a5175f8f4 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -432,7 +432,8 @@ static void InitializeStandardPredefinedMacros(const 
TargetInfo ,
   //  [C++] Whether __STDC__ is predefined and if so, what its value is,
   //  are implementation-defined.
   // (Removed in C++20.)
-  if (!LangOpts.MSVCCompat && !LangOpts.TraditionalCPP)
+  if ((!LangOpts.MSVCCompat || LangOpts.MSVCEnableStdcMacro) &&
+  !LangOpts.TraditionalCPP)
 Builder.defineMacro("__STDC__");
   //   -- __STDC_HOSTED__
   //  The integer literal 1 if the implementation is a hosted

diff  --git a/clang/test/Driver/ms-define-stdc.c 
b/clang/test/Driver/ms-define-stdc.c
new file mode 100644
index 0..d5e873d21a76b
--- /dev/null
+++ b/clang/test/Driver/ms-define-stdc.c
@@ -0,0 +1,11 @@
+// Note: %s must be preceded by --, otherwise it may be interpreted as a
+// command-line option, e.g. on Mac where %s is commonly under /Users.
+//
+// Note: see also cl-zc.cpp
+
+// RUN: %clang_cl /TC /dev/null /E -Xclang -dM /Zc:__STDC__- 2>&1 | FileCheck 
%s --check-prefix=ZCSTDCIGNORED
+// ZCSTDCIGNORED-NOT: #define __STDC__ 1
+// ZCSTDCIGNORED: argument unused during compilation
+
+// RUN: not %clang -Xclang -fno-ms-define-stdc %s 2>&1 | FileCheck %s 
--check-prefix="NOARG"
+// NOARG: error: unknown argument: '-fno-ms-define-stdc'

diff  --git a/clang/test/Preprocessor/stdc-ms-extension.cpp 
b/clang/test/Preprocessor/stdc-ms-extension.cpp
new file mode 100644
index 0..6e9fa6055306e
--- /dev/null
+++ b/clang/test/Preprocessor/stdc-ms-extension.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cl /TC /dev/null /E -Xclang -dM 2> /dev/null | FileCheck 
-match-full-lines %s --check-prefix=NOSTDC
+// RUN: %clang_cl /TC /dev/null /E -Xclang -dM /Zc:__STDC__ 2> /dev/null | 
FileCheck -match-full-lines %s --check-prefix=YESSTDC
+// __STDC__ should never be defined in C++ mode with fms-compatibility.
+// RUN: %clang_cl /dev/null /E -Xclang -dM 2>&1 | FileCheck %s 
--check-prefix=NOSTDC
+// RUN: %clang_cl /dev/null /E -Xclang -dM /Zc:__STDC__ 2>&1 | FileCheck %s 
--check-prefix=ZCSTDCIGNORED
+// YESSTDC: #define __STDC__ 1
+// NOSTDC-NOT: #define __STDC__ 1
+// ZCSTDCIGNORED-NOT: #define __STDC__ 1
+// ZCSTDCIGNORED: argument unused during compilation



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


[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

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


@@ -11,16 +11,134 @@
 #include "PtrTypesSemantics.h"
 #include "clang/AST/CXXInheritance.h"
 #include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
 #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/Checker.h"
+#include "llvm/ADT/DenseSet.h"
+#include "llvm/ADT/SetVector.h"
 #include 
 
 using namespace clang;
 using namespace ento;
 
 namespace {
+
+class DerefAnalysisVisitor
+: public ConstStmtVisitor {
+  // Returns true if any of child statements return true.
+  bool VisitChildren(const Stmt *S) {
+for (const Stmt *Child : S->children()) {
+  if (Child && Visit(Child))
+return true;
+}
+return false;
+  }
+
+  bool VisitBody(const Stmt *Body) {
+if (!Body)
+  return false;
+
+auto [It, IsNew] = VisitedBody.insert(Body);
+if (!IsNew) // This body is recursive

rniwa wrote:

Yeah. We could keep the visitor around for the duration of the checker & cache 
the results. Will address that in a follow up.

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


[Lldb-commits] [lldb] [lldb][tests] Transfer some environment variables into API tests on Windows platform. (PR #93366)

2024-05-24 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Vladimir Vereschaka (vvereschaka)


Changes

These environment variables avoid some side effects during execution of the 
remote API tests on Windows platform.

One of the side effect is a creating of weird folders, such as 
`test-root-dir\%SystemDrive%\...`, within the test directory.

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


1 Files Affected:

- (modified) lldb/test/API/lit.cfg.py (+19) 


``diff
diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index d934349fe3ca3..7d38ee0ec098c 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -313,3 +313,22 @@ def delete_module_cache(path):
 # Propagate XDG_CACHE_HOME
 if "XDG_CACHE_HOME" in os.environ:
 config.environment["XDG_CACHE_HOME"] = os.environ["XDG_CACHE_HOME"]
+
+# Transfer some environment variables into the tests on Windows build host.
+if platform.system() == "Windows":
+for v in [
+"SystemDrive",
+"SystemRoot",
+"ALLUSERSPROFILE",
+"APPDATA",
+"LOCALAPPDATA",
+"USERDNSDOMAIN",
+"USERDOMAIN",
+"USERNAME",
+"USERPROFILE",
+"USERDOMAIN_ROAMINGPROFILE",
+"COMPUTERNAME",
+"ProgramData",
+]:
+if v in os.environ:
+    config.environment[v] = os.environ[v]

``




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


[Lldb-commits] [lldb] [lldb][tests] Transfer some environment variables into API tests on Windows platform. (PR #93366)

2024-05-24 Thread Vladimir Vereschaka via lldb-commits

https://github.com/vvereschaka created 
https://github.com/llvm/llvm-project/pull/93366

These environment variables avoid some side effects during execution of the 
remote API tests on Windows platform.

One of the side effect is a creating of weird folders, such as 
`\%SystemDrive%\...`, within the test directory.

>From 5f79f5fbf6679da020266d655ced91389215d851 Mon Sep 17 00:00:00 2001
From: Vladimir Vereschaka 
Date: Fri, 24 May 2024 20:19:54 -0700
Subject: [PATCH] [lldb][tests] Transfer some environment variables into API
 tests on Windows platform.

These environment variables avoid some side effects during execution of the 
remote API tests
on Windows platform.

One of the side effect is a creating of weird folders, such as 
\%SystemDrive%\...,
within the test directory.
---
 lldb/test/API/lit.cfg.py | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index d934349fe3ca3..7d38ee0ec098c 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -313,3 +313,22 @@ def delete_module_cache(path):
 # Propagate XDG_CACHE_HOME
 if "XDG_CACHE_HOME" in os.environ:
 config.environment["XDG_CACHE_HOME"] = os.environ["XDG_CACHE_HOME"]
+
+# Transfer some environment variables into the tests on Windows build host.
+if platform.system() == "Windows":
+for v in [
+"SystemDrive",
+"SystemRoot",
+"ALLUSERSPROFILE",
+"APPDATA",
+"LOCALAPPDATA",
+"USERDNSDOMAIN",
+"USERDOMAIN",
+"USERNAME",
+"USERPROFILE",
+"USERDOMAIN_ROAMINGPROFILE",
+"COMPUTERNAME",
+"ProgramData",
+]:
+    if v in os.environ:
+config.environment[v] = os.environ[v]

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


[clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Profile profraw generation for GPU instrumentation #76587 (PR #93365)

2024-05-24 Thread via cfe-commits

github-actions[bot] wrote:




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



You can test this locally with the following command:


``bash
git-clang-format --diff d63764718c93a40d25cf4ae62b6ea6cb8eda6435 
67f3009173d815295f36e2b37e85add1347e3bf9 -- 
offload/DeviceRTL/include/Profiling.h offload/DeviceRTL/src/Profiling.cpp 
offload/test/offloading/pgo1.c clang/lib/CodeGen/CodeGenPGO.cpp 
compiler-rt/lib/profile/InstrProfiling.h 
compiler-rt/lib/profile/InstrProfilingFile.c 
llvm/include/llvm/ProfileData/InstrProf.h llvm/lib/ProfileData/InstrProf.cpp 
llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp 
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp 
offload/plugins-nextgen/common/include/GlobalHandler.h 
offload/plugins-nextgen/common/src/GlobalHandler.cpp 
offload/plugins-nextgen/common/src/PluginInterface.cpp
``





View the diff from clang-format here.


``diff
diff --git a/offload/plugins-nextgen/common/include/GlobalHandler.h 
b/offload/plugins-nextgen/common/include/GlobalHandler.h
index 017d7e994f..1d7b9f80f9 100644
--- a/offload/plugins-nextgen/common/include/GlobalHandler.h
+++ b/offload/plugins-nextgen/common/include/GlobalHandler.h
@@ -64,12 +64,10 @@ struct __llvm_profile_data {
 };
 
 extern "C" {
-extern int __attribute__((weak))
-__llvm_write_custom_profile(const char *Target,
-const __llvm_profile_data *DataBegin,
-const __llvm_profile_data *DataEnd,
-const char *CountersBegin, const char *CountersEnd,
-const char *NamesBegin, const char *NamesEnd);
+extern int __attribute__((weak)) __llvm_write_custom_profile(
+const char *Target, const __llvm_profile_data *DataBegin,
+const __llvm_profile_data *DataEnd, const char *CountersBegin,
+const char *CountersEnd, const char *NamesBegin, const char *NamesEnd);
 }
 
 /// PGO profiling data extracted from a GPU device

``




https://github.com/llvm/llvm-project/pull/93365
___
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] Profile profraw generation for GPU instrumentation #76587 (PR #93365)

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

https://github.com/EthanLuisMcDonough created 
https://github.com/llvm/llvm-project/pull/93365

This pull request is the second part of an ongoing effort to extends PGO 
instrumentation to GPU device code and depends on #76587. This PR makes the 
following changes:

- Introduces `__llvm_write_custom_profile` to PGO compiler-rt library. This is 
an external function that can be used to write profiles with custom data to 
target-specific files.
- Adds `__llvm_write_custom_profile` as weak symbol to libomptarget so that it 
can write the collected data to a profraw file.

>From 530eb982b9770190377bb0bd09c5cb715f34d484 Mon Sep 17 00:00:00 2001
From: Ethan Luis McDonough 
Date: Fri, 15 Dec 2023 20:38:38 -0600
Subject: [PATCH 01/27] Add profiling functions to libomptarget

---
 .../include/llvm/Frontend/OpenMP/OMPKinds.def |  3 +++
 openmp/libomptarget/DeviceRTL/CMakeLists.txt  |  2 ++
 .../DeviceRTL/include/Profiling.h | 21 +++
 .../libomptarget/DeviceRTL/src/Profiling.cpp  | 19 +
 4 files changed, 45 insertions(+)
 create mode 100644 openmp/libomptarget/DeviceRTL/include/Profiling.h
 create mode 100644 openmp/libomptarget/DeviceRTL/src/Profiling.cpp

diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def 
b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
index d22d2a8e948b0..1d887d5cb5812 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
@@ -503,6 +503,9 @@ __OMP_RTL(__kmpc_barrier_simple_generic, false, Void, 
IdentPtr, Int32)
 __OMP_RTL(__kmpc_warp_active_thread_mask, false, Int64,)
 __OMP_RTL(__kmpc_syncwarp, false, Void, Int64)
 
+__OMP_RTL(__llvm_profile_register_function, false, Void, VoidPtr)
+__OMP_RTL(__llvm_profile_register_names_function, false, Void, VoidPtr, Int64)
+
 __OMP_RTL(__last, false, Void, )
 
 #undef __OMP_RTL
diff --git a/openmp/libomptarget/DeviceRTL/CMakeLists.txt 
b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
index 1ce3e1e40a80a..55ee15d068c67 100644
--- a/openmp/libomptarget/DeviceRTL/CMakeLists.txt
+++ b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
@@ -89,6 +89,7 @@ set(include_files
   ${include_directory}/Interface.h
   ${include_directory}/LibC.h
   ${include_directory}/Mapping.h
+  ${include_directory}/Profiling.h
   ${include_directory}/State.h
   ${include_directory}/Synchronization.h
   ${include_directory}/Types.h
@@ -104,6 +105,7 @@ set(src_files
   ${source_directory}/Mapping.cpp
   ${source_directory}/Misc.cpp
   ${source_directory}/Parallelism.cpp
+  ${source_directory}/Profiling.cpp
   ${source_directory}/Reduction.cpp
   ${source_directory}/State.cpp
   ${source_directory}/Synchronization.cpp
diff --git a/openmp/libomptarget/DeviceRTL/include/Profiling.h 
b/openmp/libomptarget/DeviceRTL/include/Profiling.h
new file mode 100644
index 0..68c7744cd6075
--- /dev/null
+++ b/openmp/libomptarget/DeviceRTL/include/Profiling.h
@@ -0,0 +1,21 @@
+//=== Profiling.h - OpenMP interface -- C++ 
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+//
+//
+//===--===//
+
+#ifndef OMPTARGET_DEVICERTL_PROFILING_H
+#define OMPTARGET_DEVICERTL_PROFILING_H
+
+extern "C" {
+
+void __llvm_profile_register_function(void *ptr);
+void __llvm_profile_register_names_function(void *ptr, long int i);
+}
+
+#endif
diff --git a/openmp/libomptarget/DeviceRTL/src/Profiling.cpp 
b/openmp/libomptarget/DeviceRTL/src/Profiling.cpp
new file mode 100644
index 0..799477f5e47d2
--- /dev/null
+++ b/openmp/libomptarget/DeviceRTL/src/Profiling.cpp
@@ -0,0 +1,19 @@
+//===--- Profiling.cpp  C++ 
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "Profiling.h"
+
+#pragma omp begin declare target device_type(nohost)
+
+extern "C" {
+
+void __llvm_profile_register_function(void *ptr) {}
+void __llvm_profile_register_names_function(void *ptr, long int i) {}
+}
+
+#pragma omp end declare target

>From fb067d4ffe604fd68cf90b705db1942bce49dbb1 Mon Sep 17 00:00:00 2001
From: Ethan Luis McDonough 
Date: Sat, 16 Dec 2023 01:18:41 -0600
Subject: [PATCH 02/27] Fix PGO instrumentation for GPU targets

---
 clang/lib/CodeGen/CodeGenPGO.cpp  | 10 --
 .../lib/Transforms/Instrumentation/InstrProfiling.cpp | 11 ---
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp 

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

2024-05-24 Thread Gábor Horváth via cfe-commits

https://github.com/Xazax-hun approved this pull request.


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


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

2024-05-24 Thread Owen Pan via cfe-commits


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

owenca wrote:

No, because the single-argument version of `verifyFormat` is a more stringent 
test than `verifyNoChange` as the former also tests the input with all optional 
whitespace characters between tokens removed.

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


[jenkins-infra/jenkins-infra] 8c9832: chore: Update Docker Image tag for jenkinsciinfra/...

2024-05-24 Thread 'jenkins-infra-bot' via Jenkins Commits
  Branch: 
refs/heads/updatecli_production_dcbbec40f9af8939db81814533c67efa7b9791d2a05c5f4ffc7523d342c32d7d
  Home:   https://github.com/jenkins-infra/jenkins-infra
  Commit: 8c9832ea087ee7e0cd486ef5344c2a282cc5f83c
  
https://github.com/jenkins-infra/jenkins-infra/commit/8c9832ea087ee7e0cd486ef5344c2a282cc5f83c
  Author: Jenkins Infra Bot (updatecli) 
<60776566+jenkins-infra-...@users.noreply.github.com>
  Date:   2024-05-25 (Sat, 25 May 2024)

  Changed paths:
M hieradata/common.yaml

  Log Message:
  ---
  chore: Update Docker Image tag for jenkinsciinfra/openvpn:latest

Made with ❤️️ by updatecli



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

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Owen Pan via cfe-commits


@@ -1488,12 +1488,247 @@ TEST_F(TokenAnnotatorTest, 
RequiresDoesNotChangeParsingOfTheRest) {
 
 TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
   auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
-  ASSERT_EQ(Tokens.size(), 7u) << Tokens;
+ "\"a\":\n"
+ ": x\n"
+ ":};");

owenca wrote:

Is the unquoted `a:` in assembly code invalid? If not, please add your test 
instead of editing the existing one.

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Owen Pan via cfe-commits
+
+  Tokens = annotate("__asm (\n"
+"\"a_label:\"\n"
+": x\n"
+":\n"
+": y);");
+  ASSERT_EQ(Tokens.size(), 11u) << Tokens;
+  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
+  EXPECT_TOKEN(Tokens[3], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
+
+  Tokens = annotate("asm (\n"
+"\"a_label:\"\n"
+": x\n"
+":\n"
+": y);");
+  ASSERT_EQ(Tokens.size(), 11u) << Tokens;
+  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
+  EXPECT_TOKEN(Tokens[3], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
+
+  Tokens = annotate("__asm__ (\n"
+"\"a_label:\"\n"
+": x\n"
+":\n"
+": y);");
+  ASSERT_EQ(Tokens.size(), 11u) << Tokens;
+  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
+  EXPECT_TOKEN(Tokens[3], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
+
+  Tokens = annotate("__asm volatile (\n"
+"\"a_label:\"\n"
+"\"a b c(%%x)\"\n"
+":\n"
+": x\n"
+":);");
+  ASSERT_EQ(Tokens.size(), 12u) << Tokens;
+  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
+  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[8], tok::colon, TT_InlineASMColon);
+
+  Tokens = annotate("__asm volatile (\n"
+"\"a_label:\"\n"
+"\"a b c(%%x)\"\n"
+":\n"
+": x\n"
+":);");
+  ASSERT_EQ(Tokens.size(), 12u) << Tokens;
+  EXPECT_TOKEN(Tokens[0], tok::kw_asm, TT_Unknown);
+  EXPECT_TOKEN(Tokens[5], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[6], tok::colon, TT_InlineASMColon);
+  EXPECT_TOKEN(Tokens[8], tok::colon, TT_InlineASMColon);

owenca wrote:

They look exactly the same.

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Owen Pan via cfe-commits

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


[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Owen Pan via cfe-commits

https://github.com/owenca commented:

It seems that you used 5 different assembly snippets and repeated each 3-6 
times. Instead, we can have something like the following:
```
asm{Snippet 1};

__asm(Snippet 2);

__asm__(Snippet 3);

asm volatile (Snippet 4);

__asm volatile (Snippet 5);
```
Also, no space between `tok::asm` (i.e. `asm`, `__asm`, or `__asm__`) and `(`.

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


[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-24 Thread Artem Dergachev via cfe-commits

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


[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-24 Thread Artem Dergachev via cfe-commits


@@ -11,16 +11,134 @@
 #include "PtrTypesSemantics.h"
 #include "clang/AST/CXXInheritance.h"
 #include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
 #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/Checker.h"
+#include "llvm/ADT/DenseSet.h"
+#include "llvm/ADT/SetVector.h"
 #include 
 
 using namespace clang;
 using namespace ento;
 
 namespace {
+
+class DerefAnalysisVisitor
+: public ConstStmtVisitor {
+  // Returns true if any of child statements return true.
+  bool VisitChildren(const Stmt *S) {
+for (const Stmt *Child : S->children()) {
+  if (Child && Visit(Child))
+return true;
+}
+return false;
+  }
+
+  bool VisitBody(const Stmt *Body) {
+if (!Body)
+  return false;
+
+auto [It, IsNew] = VisitedBody.insert(Body);
+if (!IsNew) // This body is recursive

haoNoQ wrote:

Oh ok it's a one-shot visitor that scans one function and dies. But if it is 
instantiated again to scan another function that calls a previously visited 
function, it'll re-scan it from scratch.

So like, this probably ensures termination but there's also probably room for 
major optimizations there. We don't really have strict performance 
requirements, esp. for project-specific checks, but at a glance this could 
matter on some TUs, so it may be a good idea to keep an eye on performance.

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


[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-24 Thread Artem Dergachev via cfe-commits


@@ -11,16 +11,118 @@
 #include "PtrTypesSemantics.h"
 #include "clang/AST/CXXInheritance.h"
 #include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
 #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/Checker.h"
+#include "llvm/ADT/DenseSet.h"
+#include "llvm/ADT/SetVector.h"
 #include 
 
 using namespace clang;
 using namespace ento;
 
 namespace {
+
+class DerefFuncDeleteExprVisitor
+: public ConstStmtVisitor {
+  // Returns true if any of child statements return true.
+  bool VisitChildren(const Stmt *S) {
+for (const Stmt *Child : S->children()) {
+  if (Child && Visit(Child))
+return true;
+}
+return false;
+  }
+
+  bool VisitBody(const Stmt *Body) {
+if (!Body)
+  return false;
+
+auto [It, IsNew] = VisitedBody.insert(Body);
+if (!IsNew) // This body is recursive
+  return false;
+
+return Visit(Body);
+  }
+
+public:
+  DerefFuncDeleteExprVisitor(const TemplateArgumentList ,
+ const CXXRecordDecl *ClassDecl)
+  : ArgList(), ClassDecl(ClassDecl) {}
+
+  DerefFuncDeleteExprVisitor(const CXXRecordDecl *ClassDecl)
+  : ClassDecl(ClassDecl) {}
+
+  std::optional HasSpecializedDelete(CXXMethodDecl *Decl) {
+if (auto *Body = Decl->getBody())
+  return VisitBody(Body);
+if (auto *Tmpl = Decl->getTemplateInstantiationPattern())
+  return std::nullopt; // Indeterminate. There was no concrete instance.
+return false;
+  }
+
+  bool VisitCallExpr(const CallExpr *CE) {
+const Decl *D = CE->getCalleeDecl();
+if (D && D->hasBody())
+  return VisitBody(D->getBody());
+return false;
+  }
+
+  bool VisitCXXDeleteExpr(const CXXDeleteExpr *E) {
+auto *Arg = E->getArgument();
+while (Arg) {
+  if (auto *Paren = dyn_cast(Arg))
+Arg = Paren->getSubExpr();
+  else if (auto *Cast = dyn_cast(Arg)) {
+Arg = Cast->getSubExpr();
+auto CastType = Cast->getType();
+if (auto *PtrType = dyn_cast(CastType)) {
+  auto PointeeType = PtrType->getPointeeType();
+  while (auto *ET = dyn_cast(PointeeType)) {
+if (ET->isSugared())
+  PointeeType = ET->desugar();
+  }
+  if (auto *ParmType = dyn_cast(PointeeType)) {
+if (ArgList) {
+  auto ParmIndex = ParmType->getIndex();
+  auto Type = ArgList->get(ParmIndex).getAsType();
+  if (auto *RD = dyn_cast(Type)) {

haoNoQ wrote:

`Type->getAsCXXRecordDecl() == ClassDecl` is a bit shorter, and you probably 
don't even need to null-check, because `ClassDecl` is never null anyway.

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


[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-24 Thread Artem Dergachev via cfe-commits

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

LGTM now!

I have one style comment but that's it, everything looks good.

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


[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-24 Thread Artem Dergachev via cfe-commits

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


[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-05-24 Thread Jon Chesterfield via cfe-commits


@@ -115,7 +115,13 @@ void AMDGPUABIInfo::computeInfo(CGFunctionInfo ) const {
 
 Address AMDGPUABIInfo::EmitVAArg(CodeGenFunction , Address VAListAddr,
  QualType Ty) const {
-  llvm_unreachable("AMDGPU does not support varargs");
+  const bool IsIndirect = false;
+  const bool AllowHigherAlign = true;
+  // Would rather not naturally align values
+  // Splitting {char, short} into two separate arguments makes that difficult.

JonChesterfield wrote:

^structs < 8 bytes are packed into integers, but structs larger than that are 
spread across multiple parameters in a discarding-padding sense. Better testing 
revealed that one byte aligning things does not work out robustly, have had to 
take a different strategy to make all the cases work. However that does mean 
everything is 4 byte aligned now.

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


[clang] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-05-24 Thread Jon Chesterfield via cfe-commits


@@ -197,12 +206,20 @@ ABIArgInfo 
AMDGPUABIInfo::classifyKernelArgumentType(QualType Ty) const {
   return ABIArgInfo::getDirect(LTy, 0, nullptr, false);
 }
 
-ABIArgInfo AMDGPUABIInfo::classifyArgumentType(QualType Ty,
+ABIArgInfo AMDGPUABIInfo::classifyArgumentType(QualType Ty, bool Variadic,
unsigned ) const {

JonChesterfield wrote:

This was subtle. Structs that aren't packed into integers and passed in 
registers fall through to default handling which sets CanBeFlattened, saying 
that it's OK to spread the struct across multiple arguments. This is then very 
difficult to reassemble robustly using the va_arg(x, type) interface - one 
needs to compute how type is likely to have been spread out across part of the 
call frame.

Noting that these values aren't being usefully passed in registers anyway, the 
`if (Variadic) {}` sets up call instructions that pass values by value (not 
byval) and declares that every value shall be exactly four byte aligned 
(including doubles, as that's something Matt suggested for amdgpu some time 
ago). This means the frame setup implementation and the case analysis for 
testing are very straightforward.

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


[clang] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-05-24 Thread via cfe-commits

github-actions[bot] wrote:




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



You can test this locally with the following command:


``bash
git-clang-format --diff 560c2fd3d427a5e2dc2361abde1142f3fda40253 
6d00264803682d44cb68a8be6a6ad605ea439bd6 -- clang/test/CodeGen/voidptr-vaarg.c 
clang/test/CodeGenCXX/inline-then-fold-variadics.cpp 
llvm/include/llvm/Transforms/IPO/ExpandVariadics.h 
llvm/lib/Transforms/IPO/ExpandVariadics.cpp 
clang/lib/CodeGen/Targets/AMDGPU.cpp llvm/include/llvm/InitializePasses.h 
llvm/lib/Passes/PassBuilder.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
``





View the diff from clang-format here.


``diff
diff --git a/llvm/lib/Transforms/IPO/ExpandVariadics.cpp 
b/llvm/lib/Transforms/IPO/ExpandVariadics.cpp
index 65b53d2f49..cc97d3e27e 100644
--- a/llvm/lib/Transforms/IPO/ExpandVariadics.cpp
+++ b/llvm/lib/Transforms/IPO/ExpandVariadics.cpp
@@ -116,7 +116,7 @@ public:
   // initialized contiguous memory region.
   // Return the value to pass as the va_list argument
   virtual Value *initializeVaList(LLVMContext , IRBuilder<> ,
-  AllocaInst * VaList, Value * Buffer) = 0;
+  AllocaInst *VaList, Value *Buffer) = 0;
 
   struct VAArgSlotInfo {
 Align Align;   // With respect to the call frame

``




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


[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-05-24 Thread Jon Chesterfield via cfe-commits

JonChesterfield wrote:

I think the comments here are fed into 
https://github.com/llvm/llvm-project/pull/93362 successfully, will go through 
the list again to check.

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


[clang] [llvm] [IPO] Optimise variadic functions (PR #92850)

2024-05-24 Thread Jon Chesterfield via cfe-commits

JonChesterfield wrote:

Dropping this in favour of 
[93362](https://github.com/llvm/llvm-project/pull/93362) on risk assessment 
grounds.

This commit enabled ad hoc testing from wasm, x64, and aarch64. However if it's 
buggy, it'll show up on those targets, which should make the code owners 
reluctant to land it.

Going with pure amdgpu first is not great from the perspective of finding 
errors in this pass - since va_arg is currently a fatal_error, existing 
software on amdgpu doesn't tend to use variadic functions - but it does 
completely derisk the initial commit.

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


[clang] [llvm] [IPO] Optimise variadic functions (PR #92850)

2024-05-24 Thread Jon Chesterfield via cfe-commits

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


[clang] [CMake] Update CMake cache file for the Win-to-Arm cross toolchains. NFC. (PR #93363)

2024-05-24 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Vladimir Vereschaka (vvereschaka)


Changes

* allow configuration for the target specific compiler flags.
* allow lld linker for all linker outputs: shared, module and exe.
* allow configuration of libc++ ABI version.
* set MSVC runtime library to MultiThreadedDLL/MultiThreadedDebugDLL on Windows 
build hosts.
* install UCRT libraries on Windows build hosts

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


1 Files Affected:

- (modified) clang/cmake/caches/CrossWinToARMLinux.cmake (+35-3) 


``diff
diff --git a/clang/cmake/caches/CrossWinToARMLinux.cmake 
b/clang/cmake/caches/CrossWinToARMLinux.cmake
index 736a54ece550c..62e87c6c62f85 100644
--- a/clang/cmake/caches/CrossWinToARMLinux.cmake
+++ b/clang/cmake/caches/CrossWinToARMLinux.cmake
@@ -89,6 +89,13 @@ endif()
 
 message(STATUS "Toolchain target to build: ${LLVM_TARGETS_TO_BUILD}")
 
+# Allow to override libc++ ABI version. Use 2 by default.
+if (NOT DEFINED LIBCXX_ABI_VERSION)
+  set(LIBCXX_ABI_VERSION 2)
+endif()
+
+message(STATUS "Toolchain's Libc++ ABI version: ${LIBCXX_ABI_VERSION}")
+
 if (NOT DEFINED CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE "Release" CACHE STRING "")
 endif()
@@ -109,8 +116,15 @@ set(CLANG_DEFAULT_OBJCOPY   "llvm-objcopy" 
CACHE STRING "")
 set(CLANG_DEFAULT_RTLIB "compiler-rt" CACHE STRING "")
 set(CLANG_DEFAULT_UNWINDLIB "libunwind" CACHE STRING "")
 
-if(WIN32)
-  set(CMAKE_MSVC_RUNTIME_LIBRARY"MultiThreaded" CACHE STRING "")
+if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY AND WIN32)
+  #Note: Always specify MT DLL for the LLDB build configurations on Windows 
host.
+  if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+set(CMAKE_MSVC_RUNTIME_LIBRARY"MultiThreadedDebugDLL" CACHE 
STRING "")
+  else()
+set(CMAKE_MSVC_RUNTIME_LIBRARY"MultiThreadedDLL" CACHE STRING 
"")
+  endif()
+  # Grab all ucrt/vcruntime related DLLs into the binary installation folder.
+  set(CMAKE_INSTALL_UCRT_LIBRARIES  ON CACHE BOOL "")
 endif()
 
 # Set up RPATH for the target runtime/builtin libraries.
@@ -127,6 +141,15 @@ set(BUILTINS_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_INSTALL_RPATH
 set(BUILTINS_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_BUILD_WITH_INSTALL_RPATH 
   ON  CACHE BOOL "")
 set(BUILTINS_${TOOLCHAIN_TARGET_TRIPLE}_LLVM_CMAKE_DIR 
   "${LLVM_PROJECT_DIR}/llvm/cmake/modules" CACHE PATH "")
 
+if (DEFINED TOOLCHAIN_TARGET_COMPILER_FLAGS)
+  foreach(lang C;CXX;ASM)
+set(BUILTINS_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_${lang}_FLAGS 
"${TOOLCHAIN_TARGET_COMPILER_FLAGS}" CACHE STRING "")
+  endforeach()
+endif()
+foreach(type SHARED;MODULE;EXE)
+  set(BUILTINS_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_${type}_LINKER_FLAGS
"-fuse-ld=lld" CACHE STRING "")
+endforeach()
+
 set(LLVM_RUNTIME_TARGETS"${TOOLCHAIN_TARGET_TRIPLE}" CACHE 
STRING "")
 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR  ON CACHE BOOL "")
 
@@ -137,6 +160,15 @@ set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_SYSROOT
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_INSTALL_RPATH
   "${RUNTIMES_INSTALL_RPATH}"  CACHE STRING "")
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_BUILD_WITH_INSTALL_RPATH 
   ON  CACHE BOOL "")
 
+if (DEFINED TOOLCHAIN_TARGET_COMPILER_FLAGS)
+  foreach(lang C;CXX;ASM)
+set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_${lang}_FLAGS 
"${TOOLCHAIN_TARGET_COMPILER_FLAGS}" CACHE STRING "")
+  endforeach()
+endif()
+foreach(type SHARED;MODULE;EXE)
+  set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_${type}_LINKER_FLAGS
"-fuse-ld=lld" CACHE STRING "")
+endforeach()
+
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_COMPILER_RT_BUILD_BUILTINS 
   ON CACHE BOOL "")
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_COMPILER_RT_BUILD_SANITIZERS   
   OFF CACHE BOOL "")
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_COMPILER_RT_BUILD_XRAY 
   OFF CACHE BOOL "")
@@ -164,7 +196,7 @@ 
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_ENABLE_SHARED
 
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_USE_COMPILER_RT 
   ON CACHE BOOL "")
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ENABLE_SHARED   
   OFF CACHE BOOL "")
-set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ABI_VERSION 
   2 CACHE STRING "")
+set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ABI_VERSION     
   ${LIBCXX_ABI_VERSION} CACHE STRING "")
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_CXX_ABI 
   "libcxxabi" CACHE STRING "")#!!!
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS   
   ON CACHE BOOL "")
 

``




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


[clang] [CMake] Update CMake cache file for the Win-to-Arm cross toolchains. NFC. (PR #93363)

2024-05-24 Thread Vladimir Vereschaka via cfe-commits
ENABLE_SHARED
 
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_USE_COMPILER_RT 
   ON CACHE BOOL "")
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ENABLE_SHARED   
   OFF CACHE BOOL "")
-set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ABI_VERSION 
   2 CACHE STRING "")
+set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ABI_VERSION 
   ${LIBCXX_ABI_VERSION} CACHE STRING "")
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_CXX_ABI 
   "libcxxabi" CACHE STRING "")#!!!
 set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS   
   ON CACHE BOOL "")
 

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


[clang] [analyzer] Allow recursive functions to be trivial. (PR #91876)

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

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


[clang] 1c90de5 - [analyzer] Allow recursive functions to be trivial. (#91876)

2024-05-24 Thread via cfe-commits
@@ class RefCounted {
   void method();
   void someFunction();
   int otherFunction();
+  unsigned recursiveTrivialFunction(int n) { return !n ? 1 : 
recursiveTrivialFunction(n - 1);  }
+  unsigned recursiveComplexFunction(int n) { return !n ? otherFunction() : 
recursiveComplexFunction(n - 1);  }
+  unsigned mutuallyRecursiveFunction1(int n) { return n < 0 ? 1 : (n % 2 ? 
mutuallyRecursiveFunction2(n - 2) : mutuallyRecursiveFunction1(n - 1)); }
+  unsigned mutuallyRecursiveFunction2(int n) { return n < 0 ? 1 : (n % 3 ? 
mutuallyRecursiveFunction2(n - 3) : mutuallyRecursiveFunction1(n - 2)); }
+  unsigned mutuallyRecursiveFunction3(int n) { return n < 0 ? 1 : (n % 5 ? 
mutuallyRecursiveFunction3(n - 5) : mutuallyRecursiveFunction4(n - 3)); }
+  unsigned mutuallyRecursiveFunction4(int n) { return n < 0 ? 1 : (n % 7 ? 
otherFunction() : mutuallyRecursiveFunction3(n - 3)); }
+  unsigned recursiveFunction5(unsigned n) { return n > 100 ? 2 : (n % 2 ? 
recursiveFunction5(n + 1) : recursiveFunction6(n + 2)); }
+  unsigned recursiveFunction6(unsigned n) { return n > 100 ? 3 : (n % 2 ? 
recursiveFunction6(n % 7) : recursiveFunction7(n % 5)); }
+  unsigned recursiveFunction7(unsigned n) { return n > 100 ? 5 : 
recursiveFunction7(n * 5); }
+
+  void mutuallyRecursive8() { mutuallyRecursive9(); someFunction(); }
+  void mutuallyRecursive9() { mutuallyRecursive8(); }
 
   int trivial1() { return 123; }
   float trivial2() { return 0.3; }
@@ -498,6 +510,24 @@ class UnrelatedClass {
 RefCounted::singleton().trivial18(); // no-warning
 RefCounted::singleton().someFunction(); // no-warning
 
+getFieldTrivial().recursiveTrivialFunction(7); // no-warning
+getFieldTrivial().recursiveComplexFunction(9);
+// expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
+getFieldTrivial().mutuallyRecursiveFunction1(11); // no-warning
+getFieldTrivial().mutuallyRecursiveFunction2(13); // no-warning
+getFieldTrivial().mutuallyRecursiveFunction3(17);
+// expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
+getFieldTrivial().mutuallyRecursiveFunction4(19);
+// expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
+getFieldTrivial().recursiveFunction5(23); // no-warning
+getFieldTrivial().recursiveFunction6(29); // no-warning
+getFieldTrivial().recursiveFunction7(31); // no-warning
+
+getFieldTrivial().mutuallyRecursive8();
+// expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
+getFieldTrivial().mutuallyRecursive9();
+// expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
+
 getFieldTrivial().someFunction();
 // expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
 getFieldTrivial().nonTrivial1();


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


[clang] [analyzer] Allow recursive functions to be trivial. (PR #91876)

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

rniwa wrote:

Thanks for the review!

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


[clang] [llvm] [WebAssembly] Implement all f16x8 binary instructions. (PR #93360)

2024-05-24 Thread Brendan Dahl via cfe-commits

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


[clang] [llvm] [WebAssembly] Implement all f16x8 binary instructions. (PR #93360)

2024-05-24 Thread via cfe-commits
cause v128_t is an integer vector.
-foreach vec = [F32x4, F64x2] in {
+foreach vec = [F32x4, F64x2, F16x8] in {
 defvar pmin = !cast("PMIN_"#vec);
 defvar pmax = !cast("PMAX_"#vec);
 def : Pat<(vec.int_vt (vselect
@@ -1266,6 +1281,10 @@ def : Pat<(v2f64 (int_wasm_pmin (v2f64 V128:$lhs), 
(v2f64 V128:$rhs))),
   (PMIN_F64x2 V128:$lhs, V128:$rhs)>;
 def : Pat<(v2f64 (int_wasm_pmax (v2f64 V128:$lhs), (v2f64 V128:$rhs))),
   (PMAX_F64x2 V128:$lhs, V128:$rhs)>;
+def : Pat<(v8f16 (int_wasm_pmin (v8f16 V128:$lhs), (v8f16 V128:$rhs))),
+  (PMIN_F16x8 V128:$lhs, V128:$rhs)>;
+def : Pat<(v8f16 (int_wasm_pmax (v8f16 V128:$lhs), (v8f16 V128:$rhs))),
+  (PMAX_F16x8 V128:$lhs, V128:$rhs)>;
 
 
//===--===//
 // Conversions
diff --git a/llvm/test/CodeGen/WebAssembly/half-precision.ll 
b/llvm/test/CodeGen/WebAssembly/half-precision.ll
index d9d3f6be800fd..73ccea8d652db 100644
--- a/llvm/test/CodeGen/WebAssembly/half-precision.ll
+++ b/llvm/test/CodeGen/WebAssembly/half-precision.ll
@@ -35,3 +35,71 @@ define float @extract_lane_v8f16(<8 x half> %v) {
   %r = call float @llvm.wasm.extract.lane.f16x8(<8 x half> %v, i32 1)
   ret float %r
 }
+
+; CHECK-LABEL: add_v8f16:
+; CHECK:   f16x8.add $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+define <8 x half> @add_v8f16(<8 x half> %a, <8 x half> %b) {
+  %r = fadd <8 x half> %a, %b
+  ret <8 x half> %r
+}
+
+; CHECK-LABEL: sub_v8f16:
+; CHECK:   f16x8.sub $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+define <8 x half> @sub_v8f16(<8 x half> %a, <8 x half> %b) {
+  %r = fsub <8 x half> %a, %b
+  ret <8 x half> %r
+}
+
+; CHECK-LABEL: mul_v8f16:
+; CHECK:   f16x8.mul $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+define <8 x half> @mul_v8f16(<8 x half> %a, <8 x half> %b) {
+  %r = fmul <8 x half> %a, %b
+  ret <8 x half> %r
+}
+
+; CHECK-LABEL: div_v8f16:
+; CHECK:   f16x8.div $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+define <8 x half> @div_v8f16(<8 x half> %a, <8 x half> %b) {
+  %r = fdiv <8 x half> %a, %b
+  ret <8 x half> %r
+}
+
+; CHECK-LABEL: min_intrinsic_v8f16:
+; CHECK:   f16x8.min $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+declare <8 x half> @llvm.minimum.v8f16(<8 x half>, <8 x half>)
+define <8 x half> @min_intrinsic_v8f16(<8 x half> %x, <8 x half> %y) {
+  %a = call <8 x half> @llvm.minimum.v8f16(<8 x half> %x, <8 x half> %y)
+  ret <8 x half> %a
+}
+
+; CHECK-LABEL: max_intrinsic_v8f16:
+; CHECK:   f16x8.max $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+declare <8 x half> @llvm.maximum.v8f16(<8 x half>, <8 x half>)
+define <8 x half> @max_intrinsic_v8f16(<8 x half> %x, <8 x half> %y) {
+  %a = call <8 x half> @llvm.maximum.v8f16(<8 x half> %x, <8 x half> %y)
+  ret <8 x half> %a
+}
+
+; CHECK-LABEL: pmin_intrinsic_v8f16:
+; CHECK:   f16x8.pmin $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+declare <8 x half> @llvm.wasm.pmin.v8f16(<8 x half>, <8 x half>)
+define <8 x half> @pmin_intrinsic_v8f16(<8 x half> %a, <8 x half> %b) {
+  %v = call <8 x half> @llvm.wasm.pmin.v8f16(<8 x half> %a, <8 x half> %b)
+  ret <8 x half> %v
+}
+
+; CHECK-LABEL: pmax_intrinsic_v8f16:
+; CHECK:   f16x8.pmax $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+declare <8 x half> @llvm.wasm.pmax.v8f16(<8 x half>, <8 x half>)
+define <8 x half> @pmax_intrinsic_v8f16(<8 x half> %a, <8 x half> %b) {
+  %v = call <8 x half> @llvm.wasm.pmax.v8f16(<8 x half> %a, <8 x half> %b)
+  ret <8 x half> %v
+}
diff --git a/llvm/test/MC/WebAssembly/simd-encodings.s 
b/llvm/test/MC/WebAssembly/simd-encodings.s
index d397188a9882e..113a23da776fa 100644
--- a/llvm/test/MC/WebAssembly/simd-encodings.s
+++ b/llvm/test/MC/WebAssembly/simd-encodings.s
@@ -851,4 +851,28 @@ main:
 # CHECK: f16x8.extract_lane 1 # encoding: [0xfd,0xa1,0x02,0x01]
 f16x8.extract_lane 1
 
+# CHECK: f16x8.add # encoding: [0xfd,0xb4,0x02]
+f16x8.add
+
+# CHECK: f16x8.sub # encoding: [0xfd,0xb5,0x02]
+f16x8.sub
+
+# CHECK: f16x8.mul # encoding: [0xfd,0xb6,0x02]
+f16x8.mul
+
+# CHECK: f16x8.div # encoding: [0xfd,0xb7,0x02]
+f16x8.div
+
+# CHECK: f16x8.min # encoding: [0xfd,0xb8,0x02]
+f16x8.min
+
+# CHECK: f16x8.max # encoding: [0xfd,0xb9,0x02]
+f16x8.max
+
+# CHECK: f16x8.pmin # encoding: [0xfd,0xba,0x02]
+f16x8.pmin
+
+# CHECK: f16x8.pmax # encoding: [0xfd,0xbb,0x02]
+f16x8.pmax
+
 end_function

``




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


[clang] [llvm] [WebAssembly] Implement all f16x8 binary instructions. (PR #93360)

2024-05-24 Thread Brendan Dahl via cfe-commits
,6 +1213,7 @@ def : Pat<(v2f64 (froundeven (v2f64 V128:$src))), 
(NEAREST_F64x2 V128:$src)>;
 multiclass SIMDBinaryFP 
baseInst> {
   defm "" : SIMDBinary;
   defm "" : SIMDBinary;
+  defm "" : SIMDBinary;
 }
 
 // Addition: add
@@ -1242,7 +1257,7 @@ defm PMAX : SIMDBinaryFP;
 // Also match the pmin/pmax cases where the operands are int vectors (but the
 // comparison is still a floating point comparison). This can happen when using
 // the wasm_simd128.h intrinsics because v128_t is an integer vector.
-foreach vec = [F32x4, F64x2] in {
+foreach vec = [F32x4, F64x2, F16x8] in {
 defvar pmin = !cast("PMIN_"#vec);
 defvar pmax = !cast("PMAX_"#vec);
 def : Pat<(vec.int_vt (vselect
@@ -1266,6 +1281,10 @@ def : Pat<(v2f64 (int_wasm_pmin (v2f64 V128:$lhs), 
(v2f64 V128:$rhs))),
   (PMIN_F64x2 V128:$lhs, V128:$rhs)>;
 def : Pat<(v2f64 (int_wasm_pmax (v2f64 V128:$lhs), (v2f64 V128:$rhs))),
   (PMAX_F64x2 V128:$lhs, V128:$rhs)>;
+def : Pat<(v8f16 (int_wasm_pmin (v8f16 V128:$lhs), (v8f16 V128:$rhs))),
+  (PMIN_F16x8 V128:$lhs, V128:$rhs)>;
+def : Pat<(v8f16 (int_wasm_pmax (v8f16 V128:$lhs), (v8f16 V128:$rhs))),
+  (PMAX_F16x8 V128:$lhs, V128:$rhs)>;
 
 
//===--===//
 // Conversions
diff --git a/llvm/test/CodeGen/WebAssembly/half-precision.ll 
b/llvm/test/CodeGen/WebAssembly/half-precision.ll
index d9d3f6be800fd..73ccea8d652db 100644
--- a/llvm/test/CodeGen/WebAssembly/half-precision.ll
+++ b/llvm/test/CodeGen/WebAssembly/half-precision.ll
@@ -35,3 +35,71 @@ define float @extract_lane_v8f16(<8 x half> %v) {
   %r = call float @llvm.wasm.extract.lane.f16x8(<8 x half> %v, i32 1)
   ret float %r
 }
+
+; CHECK-LABEL: add_v8f16:
+; CHECK:   f16x8.add $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+define <8 x half> @add_v8f16(<8 x half> %a, <8 x half> %b) {
+  %r = fadd <8 x half> %a, %b
+  ret <8 x half> %r
+}
+
+; CHECK-LABEL: sub_v8f16:
+; CHECK:   f16x8.sub $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+define <8 x half> @sub_v8f16(<8 x half> %a, <8 x half> %b) {
+  %r = fsub <8 x half> %a, %b
+  ret <8 x half> %r
+}
+
+; CHECK-LABEL: mul_v8f16:
+; CHECK:   f16x8.mul $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+define <8 x half> @mul_v8f16(<8 x half> %a, <8 x half> %b) {
+  %r = fmul <8 x half> %a, %b
+  ret <8 x half> %r
+}
+
+; CHECK-LABEL: div_v8f16:
+; CHECK:   f16x8.div $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+define <8 x half> @div_v8f16(<8 x half> %a, <8 x half> %b) {
+  %r = fdiv <8 x half> %a, %b
+  ret <8 x half> %r
+}
+
+; CHECK-LABEL: min_intrinsic_v8f16:
+; CHECK:   f16x8.min $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+declare <8 x half> @llvm.minimum.v8f16(<8 x half>, <8 x half>)
+define <8 x half> @min_intrinsic_v8f16(<8 x half> %x, <8 x half> %y) {
+  %a = call <8 x half> @llvm.minimum.v8f16(<8 x half> %x, <8 x half> %y)
+  ret <8 x half> %a
+}
+
+; CHECK-LABEL: max_intrinsic_v8f16:
+; CHECK:   f16x8.max $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+declare <8 x half> @llvm.maximum.v8f16(<8 x half>, <8 x half>)
+define <8 x half> @max_intrinsic_v8f16(<8 x half> %x, <8 x half> %y) {
+  %a = call <8 x half> @llvm.maximum.v8f16(<8 x half> %x, <8 x half> %y)
+  ret <8 x half> %a
+}
+
+; CHECK-LABEL: pmin_intrinsic_v8f16:
+; CHECK:   f16x8.pmin $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+declare <8 x half> @llvm.wasm.pmin.v8f16(<8 x half>, <8 x half>)
+define <8 x half> @pmin_intrinsic_v8f16(<8 x half> %a, <8 x half> %b) {
+  %v = call <8 x half> @llvm.wasm.pmin.v8f16(<8 x half> %a, <8 x half> %b)
+  ret <8 x half> %v
+}
+
+; CHECK-LABEL: pmax_intrinsic_v8f16:
+; CHECK:   f16x8.pmax $push0=, $0, $1
+; CHECK-NEXT:  return $pop0
+declare <8 x half> @llvm.wasm.pmax.v8f16(<8 x half>, <8 x half>)
+define <8 x half> @pmax_intrinsic_v8f16(<8 x half> %a, <8 x half> %b) {
+  %v = call <8 x half> @llvm.wasm.pmax.v8f16(<8 x half> %a, <8 x half> %b)
+  ret <8 x half> %v
+}
diff --git a/llvm/test/MC/WebAssembly/simd-encodings.s 
b/llvm/test/MC/WebAssembly/simd-encodings.s
index d397188a9882e..113a23da776fa 100644
--- a/llvm/test/MC/WebAssembly/simd-encodings.s
+++ b/llvm/test/MC/WebAssembly/simd-encodings.s
@@ -851,4 +851,28 @@ main:
 # CHECK: f16x8.extract_lane 1 # encoding: [0xfd,0xa1,0x02,0x01]
 f16x8.extract_lane 1
 
+# CHECK: f16x8.add # encoding: [0xfd,0xb4,0x02]
+f16x8.add
+
+# CHECK: f16x8.sub # encoding: [0xfd,0xb5,0x02]
+f16x8.sub
+
+# CHECK: f16x8.mul # encoding: [0xfd,0xb6,0x02]
+f16x8.mul
+
+# CHECK: f16x8.div # encoding: [0xfd,0xb7,0x02]
+f16x8.div
+
+# CHECK: f16x8.min # encoding: [0xfd,0xb8,0x02]
+f16x8.min
+
+# CHECK: f16x8.max # encoding: [0xfd,0xb9,0x02]
+f16x8.max
+
+# CHECK: f16x8.pmin # encoding: [0xfd,0xba,0x02]
+f16x8.pmin
+
+# CHECK: f16x8.pmax # encoding: [0xfd,0xbb,0x02]
+f16x8.pmax
+
 end_function

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


[clang] [analyzer] Allow recursive functions to be trivial. (PR #91876)

2024-05-24 Thread Artem Dergachev via cfe-commits

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

Ok LGTM then!

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


[Lldb-commits] [lldb] [lldb] Fixed PlatformPOSIX::DoLoadImage() in case of the Windows host (PR #93345)

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

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


[clang] [clang] In Sema use new parentEvaluationContext function (PR #93338)

2024-05-24 Thread Oleksandr T. via cfe-commits


@@ -17693,12 +17691,13 @@ void Sema::PopExpressionEvaluationContext() {
 
   // Append the collected materialized temporaries into previous context before
   // exit if the previous also is a lifetime extending context.
-  auto  = ExprEvalContexts[ExprEvalContexts.size() - 2];
+  auto  = parentEvaluationContext();
   if (getLangOpts().CPlusPlus23 && Rec.InLifetimeExtendingContext &&
   PrevRecord.InLifetimeExtendingContext &&
   !Rec.ForRangeLifetimeExtendTemps.empty()) {
-PrevRecord.ForRangeLifetimeExtendTemps.append(
-Rec.ForRangeLifetimeExtendTemps);
+const_cast &>(

a-tarasyuk wrote:

I'm uncertain about using `const_cast` in this case. While `EvaluationContext` 
contains properties that can be changed, `parentEvaluationContext` is declared 
as `const`. Maybe `const` shouldn't be used in this case, or we could create a 
new helper to return `ForRangeLifetimeExtendTemps` for parent eval context, or 
avoid applying `parentEvaluationContext` in this case. What do you think 
@Endilll, @Fznamznon?

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


[libcxx] [libcxxabi] [libunwind] [llvm] [runtimes] Correctly apply libdir subdir for multilib (PR #93354)

2024-05-24 Thread Petr Hosek via cfe-commits
UBDIR})
+string(APPEND LIBCXXABI_TARGET_SUBDIR /${LIBCXXABI_LIBDIR_SUBDIR})
   endif()
   set(LIBCXXABI_HEADER_DIR ${LLVM_BINARY_DIR})
-  set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${TARGET_DIR})
-  set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${TARGET_DIR} 
CACHE STRING
+  set(LIBCXXABI_LIBRARY_DIR 
${LLVM_LIBRARY_OUTPUT_INTDIR}/${LIBCXXABI_TARGET_SUBDIR})
+  set(LIBCXXABI_INSTALL_LIBRARY_DIR 
lib${LLVM_LIBDIR_SUFFIX}/${LIBCXXABI_TARGET_SUBDIR} CACHE STRING
   "Path where built libc++abi libraries should be installed.")
-  unset(TARGET_DIR)
+  unset(LIBCXXABI_TARGET_SUBDIR)
 else()
   if(LLVM_LIBRARY_OUTPUT_INTDIR)
 set(LIBCXXABI_HEADER_DIR ${LLVM_BINARY_DIR})
diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index 24acb3fd40d0d..23b567d5c8161 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -129,14 +129,14 @@ set(LIBUNWIND_SHARED_OUTPUT_NAME "unwind" CACHE STRING 
"Output name for the shar
 set(LIBUNWIND_STATIC_OUTPUT_NAME "unwind" CACHE STRING "Output name for the 
static libunwind runtime library.")
 
 if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-  set(TARGET_DIR ${LLVM_DEFAULT_TARGET_TRIPLE})
+  set(LIBUNWIND_TARGET_SUBDIR ${LLVM_DEFAULT_TARGET_TRIPLE})
   if(LIBUNWIND_LIBDIR_SUBDIR)
-string(APPEND TARGET_DIR /${LIBUNWIND_LIBDIR_SUBDIR})
+string(APPEND LIBUNWIND_TARGET_SUBDIR /${LIBUNWIND_LIBDIR_SUBDIR})
   endif()
-  set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${TARGET_DIR})
-  set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${TARGET_DIR} 
CACHE STRING
+  set(LIBUNWIND_LIBRARY_DIR 
${LLVM_LIBRARY_OUTPUT_INTDIR}/${LIBUNWIND_TARGET_SUBDIR})
+  set(LIBUNWIND_INSTALL_LIBRARY_DIR 
lib${LLVM_LIBDIR_SUFFIX}/${LIBUNWIND_TARGET_SUBDIR} CACHE STRING
   "Path where built libunwind libraries should be installed.")
-  unset(TARGET_DIR)
+  unset(LIBUNWIND_TARGET_SUBDIR)
 else()
   if(LLVM_LIBRARY_OUTPUT_INTDIR)
 set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
diff --git a/llvm-libgcc/CMakeLists.txt b/llvm-libgcc/CMakeLists.txt
index 76b3e3f6f7ddb..8e9685fab9feb 100644
--- a/llvm-libgcc/CMakeLists.txt
+++ b/llvm-libgcc/CMakeLists.txt
@@ -61,14 +61,14 @@ endif()
 
#===
 
 if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-  set(TARGET_DIR ${LLVM_DEFAULT_TARGET_TRIPLE})
+  set(TARGET_SUBDIR ${LLVM_DEFAULT_TARGET_TRIPLE})
   if(LLVM_LIBGCC_LIBDIR_SUBDIR)
-string(APPEND TARGET_DIR /${LLVM_LIBGCC_LIBDIR_SUBDIR})
+string(APPEND TARGET_SUBDIR /${LLVM_LIBGCC_LIBDIR_SUBDIR})
   endif()
-  set(LLVM_LIBGCC_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${TARGET_DIR})
-  set(LLVM_LIBGCC_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${TARGET_DIR} 
CACHE PATH
+  set(LLVM_LIBGCC_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${TARGET_SUBDIR})
+  set(LLVM_LIBGCC_INSTALL_LIBRARY_DIR 
lib${LLVM_LIBDIR_SUFFIX}/${TARGET_SUBDIR} CACHE PATH
   "Path where built llvm-libgcc libraries should be installed.")
-  unset(TARGET_DIR)
+  unset(TARGET_SUBDIR)
 else()
   if(LLVM_LIBRARY_OUTPUT_INTDIR)
 set(LLVM_LIBGCC_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})

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


[libcxx] [libcxxabi] [libunwind] [llvm] [runtimes] Correctly apply libdir subdir for multilib (PR #93354)

2024-05-24 Thread via cfe-commits
TRIPLE})
+  if(LIBUNWIND_LIBDIR_SUBDIR)
+string(APPEND TARGET_DIR /${LIBUNWIND_LIBDIR_SUBDIR})
   endif()
+  set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${TARGET_DIR})
+  set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${TARGET_DIR} 
CACHE STRING
+  "Path where built libunwind libraries should be installed.")
+  unset(TARGET_DIR)
 else()
   if(LLVM_LIBRARY_OUTPUT_INTDIR)
 set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
diff --git a/llvm-libgcc/CMakeLists.txt b/llvm-libgcc/CMakeLists.txt
index 013c9ca2e3307..76b3e3f6f7ddb 100644
--- a/llvm-libgcc/CMakeLists.txt
+++ b/llvm-libgcc/CMakeLists.txt
@@ -61,13 +61,14 @@ endif()
 
#===
 
 if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-  set(LLVM_LIBGCC_LIBRARY_DIR 
${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
-  set(LLVM_LIBGCC_INSTALL_LIBRARY_DIR 
lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
-  "Path where built llvm-libgcc libraries should be installed.")
-  if(LIBCXX_LIBDIR_SUBDIR)
-string(APPEND LLVM_LIBGCC_LIBRARY_DIR /${LLVM_LIBGCC_LIBDIR_SUBDIR})
-string(APPEND LLVM_LIBGCC_INSTALL_LIBRARY_DIR 
/${LLVM_LIBGCC_LIBDIR_SUBDIR})
+  set(TARGET_DIR ${LLVM_DEFAULT_TARGET_TRIPLE})
+  if(LLVM_LIBGCC_LIBDIR_SUBDIR)
+string(APPEND TARGET_DIR /${LLVM_LIBGCC_LIBDIR_SUBDIR})
   endif()
+  set(LLVM_LIBGCC_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${TARGET_DIR})
+  set(LLVM_LIBGCC_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${TARGET_DIR} 
CACHE PATH
+  "Path where built llvm-libgcc libraries should be installed.")
+  unset(TARGET_DIR)
 else()
   if(LLVM_LIBRARY_OUTPUT_INTDIR)
 set(LLVM_LIBGCC_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})

``




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


[Lldb-commits] [lldb] [lldb] Fixed PlatformPOSIX::DoLoadImage() in case of the Windows host (PR #93345)

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

https://github.com/slydiman updated 
https://github.com/llvm/llvm-project/pull/93345

>From 8701bfc715168168ca04d86f134ef362d5e89173 Mon Sep 17 00:00:00 2001
From: Dmitry Vasilyev 
Date: Sat, 25 May 2024 00:39:05 +0400
Subject: [PATCH] [lldb] Fixed PlatformPOSIX::DoLoadImage() in case of the
 Windows host

Do not denormalize the path. This patch fixes #93092.

BTW, it would be great to be able to pass the style or triple to SBFileSpec. 
Currently it is impossible to create a posix FileSpec on the Windows host.
---
 lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp 
b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
index b4f1b76c39dbe..588b19dac6165 100644
--- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -678,8 +678,8 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process 
*process,
 loaded_image->Clear();
 
   std::string path;
-  path = remote_file.GetPath();
-  
+  path = remote_file.GetPath(false);
+
   ThreadSP thread_sp = process->GetThreadList().GetExpressionExecutionThread();
   if (!thread_sp) {
 error.SetErrorString("dlopen error: no thread available to call dlopen.");

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


[libcxx] [libcxxabi] [libunwind] [llvm] [runtimes] Correctly apply libdir subdir for multilib (PR #93354)

2024-05-24 Thread Petr Hosek via cfe-commits
GET_TRIPLE})
-  set(LIBUNWIND_INSTALL_LIBRARY_DIR 
lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE STRING
-  "Path where built libunwind libraries should be installed.")
-  if(LIBCXX_LIBDIR_SUBDIR)
-string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR})
-string(APPEND LIBUNWIND_INSTALL_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR})
+  set(TARGET_DIR ${LLVM_DEFAULT_TARGET_TRIPLE})
+  if(LIBUNWIND_LIBDIR_SUBDIR)
+string(APPEND TARGET_DIR /${LIBUNWIND_LIBDIR_SUBDIR})
   endif()
+  set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${TARGET_DIR})
+  set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${TARGET_DIR} 
CACHE STRING
+  "Path where built libunwind libraries should be installed.")
+  unset(TARGET_DIR)
 else()
   if(LLVM_LIBRARY_OUTPUT_INTDIR)
 set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
diff --git a/llvm-libgcc/CMakeLists.txt b/llvm-libgcc/CMakeLists.txt
index 013c9ca2e3307..76b3e3f6f7ddb 100644
--- a/llvm-libgcc/CMakeLists.txt
+++ b/llvm-libgcc/CMakeLists.txt
@@ -61,13 +61,14 @@ endif()
 
#===
 
 if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
-  set(LLVM_LIBGCC_LIBRARY_DIR 
${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
-  set(LLVM_LIBGCC_INSTALL_LIBRARY_DIR 
lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
-  "Path where built llvm-libgcc libraries should be installed.")
-  if(LIBCXX_LIBDIR_SUBDIR)
-string(APPEND LLVM_LIBGCC_LIBRARY_DIR /${LLVM_LIBGCC_LIBDIR_SUBDIR})
-string(APPEND LLVM_LIBGCC_INSTALL_LIBRARY_DIR 
/${LLVM_LIBGCC_LIBDIR_SUBDIR})
+  set(TARGET_DIR ${LLVM_DEFAULT_TARGET_TRIPLE})
+  if(LLVM_LIBGCC_LIBDIR_SUBDIR)
+string(APPEND TARGET_DIR /${LLVM_LIBGCC_LIBDIR_SUBDIR})
   endif()
+  set(LLVM_LIBGCC_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${TARGET_DIR})
+  set(LLVM_LIBGCC_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${TARGET_DIR} 
CACHE PATH
+  "Path where built llvm-libgcc libraries should be installed.")
+  unset(TARGET_DIR)
 else()
   if(LLVM_LIBRARY_OUTPUT_INTDIR)
 set(LLVM_LIBGCC_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})

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


[Lldb-commits] [lldb] [lldb] Add RegisterContextPOSIXCore for RISC-V 64 (PR #93297)

2024-05-24 Thread Jason Molenda via lldb-commits


@@ -0,0 +1,84 @@
+//===-- RegisterContextPOSIXCore_riscv64.cpp 
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "RegisterContextPOSIXCore_riscv64.h"
+
+#include "lldb/Utility/DataBufferHeap.h"
+
+using namespace lldb_private;
+
+std::unique_ptr
+RegisterContextCorePOSIX_riscv64::Create(
+lldb_private::Thread , const lldb_private::ArchSpec ,
+const lldb_private::DataExtractor ,
+llvm::ArrayRef notes) {
+  Flags flags = 0;
+
+  auto register_info_up =
+  std::make_unique(arch, flags);
+  return std::unique_ptr(
+  new RegisterContextCorePOSIX_riscv64(thread, std::move(register_info_up),
+   gpregset, notes));
+}
+
+RegisterContextCorePOSIX_riscv64::RegisterContextCorePOSIX_riscv64(
+Thread , std::unique_ptr register_info,
+const DataExtractor , llvm::ArrayRef notes)
+: RegisterContextPOSIX_riscv64(thread, std::move(register_info)) {
+
+  m_gpr_buffer = std::make_shared(gpregset.GetDataStart(),
+  gpregset.GetByteSize());
+  m_gpr.SetData(m_gpr_buffer);
+  m_gpr.SetByteOrder(gpregset.GetByteOrder());
+
+  ArchSpec arch = m_register_info_up->GetTargetArchitecture();
+  DataExtractor fpregset = getRegset(notes, arch.GetTriple(), FPR_Desc);
+  m_fpr_buffer = std::make_shared(fpregset.GetDataStart(),

jasonmolenda wrote:

I see in the aarch64 elf core plugin that it checks the size of the 
DataExtractor object before setting the buffer to its contents, with a "must be 
bigger than the smallest possible size", e.g. 

```
  DataExtractor mte_data = getRegset(notes, arch.GetTriple(), AARCH64_MTE_Desc);
  if (mte_data.GetByteSize() >= sizeof(uint64_t))
opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskMTE);
```

Is it possible this could be called without a floating point register context?  
I know in RISC-V nearly anything is possible :) but maybe realistically we're 
always going to have an fpr.

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


[Lldb-commits] [lldb] [lldb] Add RegisterContextPOSIXCore for RISC-V 64 (PR #93297)

2024-05-24 Thread Jason Molenda via lldb-commits

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

This looks good to me, I'd like to see the std::make_unique in 
`RegisterContextCorePOSIX_riscv64::Create` and a sanity check for fetching the 
fpr, but maybe that's just unnecessary I don't work with RV64 targets myself, 
if you're comfortable with it as-is, that's fine.

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


[Lldb-commits] [lldb] [lldb] Add RegisterContextPOSIXCore for RISC-V 64 (PR #93297)

2024-05-24 Thread Jason Molenda via lldb-commits

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


[Lldb-commits] [lldb] [lldb] Fixed PlatformPOSIX::DoLoadImage() in case of the Windows host (PR #93345)

2024-05-24 Thread via lldb-commits

github-actions[bot] wrote:




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



You can test this locally with the following command:


``bash
git-clang-format --diff b91b8fea8c58e9b414e291df677b12ca44197784 
76a35a6ca5302aef5033d5ae297667e416921d7d -- 
lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
``





View the diff from clang-format here.


``diff
diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp 
b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
index edad606e2e..588b19dac6 100644
--- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -679,7 +679,7 @@ uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process 
*process,
 
   std::string path;
   path = remote_file.GetPath(false);
-  
+
   ThreadSP thread_sp = process->GetThreadList().GetExpressionExecutionThread();
   if (!thread_sp) {
 error.SetErrorString("dlopen error: no thread available to call dlopen.");

``




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


[Lldb-commits] [lldb] [lldb] Fixed PlatformPOSIX::DoLoadImage() in case of the Windows host (PR #93345)

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

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


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