[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)

2024-05-31 Thread via llvm-branch-commits

mikaelholmen wrote:

> > Hello @fmayer !
> > If I compile this patch with UBSan (-DLLVM_USE_SANITIZER='Undefined') and 
> > run tests, I see the following for many many lit tests:
> > ```
> > ../include/llvm/Support/CommandLine.h:601:13: runtime error: load of value 
> > 2, which is not a valid value for type 'const RecordStackHistoryMode'
> > SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior 
> > ../include/llvm/Support/CommandLine.h:601:13 in 
> > ```
> > 
> > 
> > 
> >   
> > 
> > 
> >   
> > 
> > 
> > 
> >   
> > Can e.g. be seen with
> > ```
> > llc -verify-machineinstrs -o - test/CodeGen/AArch64/ldst-unscaledimm.ll 
> > -mtriple=aarch64-linux-gnu
> > ```
> > 
> > 
> > 
> >   
> > 
> > 
> >   
> > 
> > 
> > 
> >   
> > if you compiled llc with UBSan.
> 
> should be fixed: 
> [973821c](https://github.com/llvm/llvm-project/commit/973821cb44cf2826e2aea1cd40ff40e6e975b9d6)

Thanks!

https://github.com/llvm/llvm-project/pull/86356
___
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] [libcxx] [libc++][chrono] Fixes leap seconds. (PR #90070)

2024-05-31 Thread S. B. Tam via llvm-branch-commits


@@ -626,29 +626,49 @@ static void __parse_leap_seconds(vector& 
__leap_seconds, istream&&
   // seconds since 1 January 1970.
   constexpr auto __offset = sys_days{1970y / January / 1} - sys_days{1900y / 
January / 1};
 
-  while (true) {
-switch (__input.peek()) {
-case istream::traits_type::eof():
-  return;
-
-case ' ':
-case '\t':
-case '\n':
-  __input.get();
-  continue;
+  struct __entry {
+sys_seconds __timestamp;
+seconds __value;
+  };
+  vector<__entry> __entries;
+  [&] {

cpplearner wrote:

What's the purpose of wrapping the loop in an IILE?

https://github.com/llvm/llvm-project/pull/90070
___
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] Implement pointer authentication for C++ virtual functions, v-tables, and VTTs. (PR #93907)

2024-05-31 Thread Oliver Hunt via llvm-branch-commits

ojhunt wrote:

Build fix is trivial

`diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 82c4a3c86645..e9a867ff67ba 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -9246,7 +9246,7 @@ static void handleVTablePointerAuthentication(Sema &S, 
Decl *D,
   AL.setInvalid();
 }
 
-if (!AL.isArgExpr(3) || !S.checkUInt32Argument(AL, AL.getArgAsExpr(3),
+if (!AL.isArgExpr(3) || !checkUInt32Argument(S, AL, AL.getArgAsExpr(3),
customDiscriminationValue)) 
{
   S.Diag(AL.getLoc(), diag::err_invalid_custom_discrimination);
   AL.setInvalid();`
   
Just the original PR being merged is dates to earlier checkUInt32Argument API

https://github.com/llvm/llvm-project/pull/93907
___
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] [AMDGPU] Fix gfx12 waitcnt type for image_msaa_load (#90201) (PR #90582)

2024-05-31 Thread Jay Foad via llvm-branch-commits

https://github.com/jayfoad closed 
https://github.com/llvm/llvm-project/pull/90582
___
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] [AMDGPU] Fix gfx12 waitcnt type for image_msaa_load (#90201) (PR #90582)

2024-05-31 Thread Jay Foad via llvm-branch-commits

jayfoad wrote:

Too late to backport - no more 18.x releases are planned.

https://github.com/llvm/llvm-project/pull/90582
___
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] [PGO] Generate __llvm_profile_raw_version only when instrumented (PR #93917)

2024-05-31 Thread Arthur Eubanks via llvm-branch-commits

aeubanks wrote:

What's the benefit to this change? From a compile time perspective, files 
containing no functions are essentially negligible. From a consistency 
perspective, not adding `__llvm_profile_raw_version` in some cases creates 
divergence between different source files (IIRC we do some checking of 
`__llvm_profile_raw_version` against the profile runtime library? which is good 
for checking that all your sources were compiled the same way)

https://github.com/llvm/llvm-project/pull/93917
___
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] Update use of checkUInt32Argument to match on main (PR #93984)

2024-05-31 Thread Oliver Hunt via llvm-branch-commits

https://github.com/ojhunt created 
https://github.com/llvm/llvm-project/pull/93984

Minor correction to match current API

>From 0262fdfddf50853d2f40ea86c37877168ad070a8 Mon Sep 17 00:00:00 2001
From: Oliver Hunt <4691426+ojh...@users.noreply.github.com>
Date: Fri, 31 May 2024 09:36:32 -0700
Subject: [PATCH] [clang] Update use of checkUInt32Argument to match on main

Minor correction to match current API
---
 clang/lib/Sema/SemaDeclAttr.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 82c4a3c866458..e9a867ff67ba1 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -9246,7 +9246,7 @@ static void handleVTablePointerAuthentication(Sema &S, 
Decl *D,
   AL.setInvalid();
 }
 
-if (!AL.isArgExpr(3) || !S.checkUInt32Argument(AL, AL.getArgAsExpr(3),
+if (!AL.isArgExpr(3) || !checkUInt32Argument(S, AL, AL.getArgAsExpr(3),
customDiscriminationValue)) 
{
   S.Diag(AL.getLoc(), diag::err_invalid_custom_discrimination);
   AL.setInvalid();

___
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] Update use of checkUInt32Argument to match on main (PR #93984)

2024-05-31 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Oliver Hunt (ojhunt)


Changes

Minor correction to match current API

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


1 Files Affected:

- (modified) clang/lib/Sema/SemaDeclAttr.cpp (+1-1) 


``diff
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 82c4a3c866458..e9a867ff67ba1 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -9246,7 +9246,7 @@ static void handleVTablePointerAuthentication(Sema &S, 
Decl *D,
   AL.setInvalid();
 }
 
-if (!AL.isArgExpr(3) || !S.checkUInt32Argument(AL, AL.getArgAsExpr(3),
+if (!AL.isArgExpr(3) || !checkUInt32Argument(S, AL, AL.getArgAsExpr(3),
customDiscriminationValue)) 
{
   S.Diag(AL.getLoc(), diag::err_invalid_custom_discrimination);
   AL.setInvalid();

``




https://github.com/llvm/llvm-project/pull/93984
___
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] Update use of checkUInt32Argument to match on main (PR #93984)

2024-05-31 Thread via llvm-branch-commits

github-actions[bot] wrote:

⚠️ We detected that you are using a GitHub private e-mail address to contribute 
to the repo. Please turn off [Keep my email addresses 
private](https://github.com/settings/emails) setting in your account. See 
[LLVM 
Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it)
 for more information.

https://github.com/llvm/llvm-project/pull/93984
___
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] [PGO] Generate __llvm_profile_raw_version only when instrumented (PR #93917)

2024-05-31 Thread Pavel Samolysov via llvm-branch-commits

samolisov wrote:

@aeubanks my intent is to get no  `__llvm_profile_raw_version` in modules where 
nothing was actually instrumented. Usually, in my cases, they are the modules 
for regular-LTO part in thin-LTO where split LTO Units are enabled. This is a 
good point about consistency and using the variable as a flag that a module had 
already been instrumented but when a split LTO unit contains the variable in 
both parts it makes problems for the linker: I know how to distinguish one 
module from another and change the linkage for the variable but I have no idea 
how to deal with two parts of the same module. May be this solution looks as a 
hack but I think it makes sense: nothing was instrumented and nothing makes a 
reason for the version variable to present. But I'm unfamiliar about details of 
the profile runtime library, if the absence of the version variable makes 
troubles it is a reason to preserve it. But actually I tried to link such 
modules, without the variable, and get some profile.

https://github.com/llvm/llvm-project/pull/93917
___
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] 8ce0932 - Revert "[CUDA] Fix a couple of driver tests that really weren't being run (#9…"

2024-05-31 Thread via llvm-branch-commits

Author: Paul T Robinson
Date: 2024-05-31T13:13:21-04:00
New Revision: 8ce093226b730338a8faacb4ef09f97bcbc17515

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

LOG: Revert "[CUDA] Fix a couple of driver tests that really weren't being run 
(#9…"

This reverts commit 97c34eb8df47543299500ee4cd0b877d184ed790.

Added: 


Modified: 
clang/test/Driver/offloading-interoperability.c
clang/test/Driver/openmp-offload-gpu.c

Removed: 




diff  --git a/clang/test/Driver/offloading-interoperability.c 
b/clang/test/Driver/offloading-interoperability.c
index 9193e12355024..6f6daf31a392e 100644
--- a/clang/test/Driver/offloading-interoperability.c
+++ b/clang/test/Driver/offloading-interoperability.c
@@ -1,7 +1,10 @@
+// REQUIRES: powerpc-registered-target
+// REQUIRES: nvptx-registered-target
+
 //
 // Verify that CUDA device commands do not get OpenMP flags.
 //
-// RUN: %clang -### -x cuda --target=powerpc64le-linux-gnu -std=c++11 
--cuda-gpu-arch=sm_35 --no-cuda-version-check -fopenmp=libomp %s 2>&1 \
+// RUN: not %clang -### -x cuda --target=powerpc64le-linux-gnu -std=c++11 
--cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \
 // RUN:   | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
 //
 // NO-OPENMP-FLAGS-FOR-CUDA-DEVICE:  "-cc1" "-triple" "nvptx64-nvidia-cuda"

diff  --git a/clang/test/Driver/openmp-offload-gpu.c 
b/clang/test/Driver/openmp-offload-gpu.c
index 0b98aaf6ba53c..d21db7019a1aa 100644
--- a/clang/test/Driver/openmp-offload-gpu.c
+++ b/clang/test/Driver/openmp-offload-gpu.c
@@ -2,6 +2,11 @@
 /// Perform several driver tests for OpenMP offloading
 ///
 
+// REQUIRES: x86-registered-target
+// REQUIRES: powerpc-registered-target
+// REQUIRES: nvptx-registered-target
+// REQUIRES: amdgpu-registered-target
+
 /// ###
 
 /// Check -Xopenmp-target uses one of the archs provided when several archs 
are used.
@@ -300,7 +305,6 @@
 // CHECK-EMIT-LLVM-IR-BC: "-cc1"{{.*}}"-triple" 
"nvptx64-nvidia-cuda"{{.*}}"-emit-llvm-bc"
 
 // RUN:   %clang -### -fopenmp=libomp --offload-arch=sm_89 \
-// RUN:  --no-cuda-version-check \
 // RUN:  -nogpulib %s -o openmp-offload-gpu 2>&1 \
 // RUN:   | FileCheck -check-prefix=DRIVER_EMBEDDING %s
 



___
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] [BOLT][BAT] Add support for three-way split functions (PR #93760)

2024-05-31 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/93760
___
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] Bump version to 18.1.7 (PR #93723)

2024-05-31 Thread Tom Stellard via llvm-branch-commits

tstellar wrote:

@whentojump Yes, but I'm only going to accept critical fixes or regressions for 
this one.

https://github.com/llvm/llvm-project/pull/93723
___
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] Bump version to 18.1.7 (PR #93723)

2024-05-31 Thread Wentao Zhang via llvm-branch-commits

whentojump wrote:

Thanks for the info.

Will you please consider 
https://github.com/llvm/llvm-project/compare/release/18.x...chapuni:llvm-project:release/18.x,
 which fixes an assertion violation? If so, I can do a PR.

cc @chapuni 

https://github.com/llvm/llvm-project/pull/93723
___
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] Update use of checkUInt32Argument to match on main (PR #93984)

2024-05-31 Thread Ahmed Bougacha via llvm-branch-commits

https://github.com/ahmedbougacha closed 
https://github.com/llvm/llvm-project/pull/93984
___
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] Bump version to 18.1.7 (PR #93723)

2024-05-31 Thread NAKAMURA Takumi via llvm-branch-commits

chapuni wrote:

@tstellar @whentojump They will make clang able to build and test clang itself 
with MC/DC instrumentation.
I really hope they could be pulled. Thank you.

https://github.com/llvm/llvm-project/pull/93723
___
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] Define ptrauth_sign_constant builtin. (PR #93904)

2024-05-31 Thread Ahmed Bougacha via llvm-branch-commits

ahmedbougacha wrote:

> Why do we want a separate builtin, as opposed to just constant-folding calls 
> to __builtin_ptrauth_sign?

That's a good question.  Mechanically, I assumed constant-evaluating 
`__builtin_ptrauth_sign_unauthenticated` would be a challenge, but looking 
around it doesn't seem particularly difficult.

Conceptually though, the distinction does seem useful, because we treat 
`__builtin_ptrauth_sign_unauthenticated` as dangerous (because in general we 
can't guarantee that it won't get lowered to a signing oracle), and only to be 
used carefully, when absolutely necessary (e.g., in a dynamic loader.)
`__builtin_ptrauth_sign_constant` is safe, because we do always have safe ways 
to materialize signed constants (with the constants in IR, and either 
relocations or safe pseudos in the backend.)   (but cc @rjmccall @ahatanak for 
the real clang perspective ;)

https://github.com/llvm/llvm-project/pull/93904
___
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] Implement pointer authentication for C++ virtual functions, v-tables, and VTTs (PR #94054)

2024-05-31 Thread Oliver Hunt via llvm-branch-commits

https://github.com/ojhunt converted_to_draft 
https://github.com/llvm/llvm-project/pull/94054
___
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] Implement pointer authentication for C++ virtual functions, v-tables, and VTTs (PR #94054)

2024-05-31 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-codegen

Author: Oliver Hunt (ojhunt)


Changes



---

Patch is 245.54 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/94054.diff


53 Files Affected:

- (modified) clang/include/clang/AST/ASTContext.h (+13) 
- (modified) clang/include/clang/AST/GlobalDecl.h (+4) 
- (modified) clang/include/clang/AST/Mangle.h (+5-6) 
- (modified) clang/include/clang/AST/VTableBuilder.h (+29) 
- (modified) clang/include/clang/Basic/Attr.td (+29) 
- (modified) clang/include/clang/Basic/DiagnosticSemaKinds.td (+31) 
- (modified) clang/include/clang/Basic/PointerAuthOptions.h (+25) 
- (modified) clang/include/clang/Basic/Thunk.h (+10-3) 
- (modified) clang/include/clang/CodeGen/CodeGenABITypes.h (+4) 
- (modified) clang/include/clang/CodeGen/ConstantInitBuilder.h (+15-1) 
- (modified) clang/include/clang/InstallAPI/Visitor.h (+2-2) 
- (modified) clang/include/clang/Sema/Sema.h (+4) 
- (modified) clang/lib/AST/ASTContext.cpp (+86) 
- (modified) clang/lib/AST/ItaniumMangle.cpp (+70-7) 
- (modified) clang/lib/AST/Mangle.cpp (+17-6) 
- (modified) clang/lib/AST/MicrosoftMangle.cpp (+16-7) 
- (modified) clang/lib/AST/VTableBuilder.cpp (+101-6) 
- (modified) clang/lib/CodeGen/CGCXX.cpp (+10-1) 
- (modified) clang/lib/CodeGen/CGCXXABI.h (+8-6) 
- (modified) clang/lib/CodeGen/CGClass.cpp (+30-1) 
- (modified) clang/lib/CodeGen/CGExpr.cpp (+5-2) 
- (modified) clang/lib/CodeGen/CGExprConstant.cpp (+76-1) 
- (modified) clang/lib/CodeGen/CGPointerAuth.cpp (+239) 
- (modified) clang/lib/CodeGen/CGVTT.cpp (+5) 
- (modified) clang/lib/CodeGen/CGVTables.cpp (+38-10) 
- (modified) clang/lib/CodeGen/CodeGenFunction.cpp (+27) 
- (modified) clang/lib/CodeGen/CodeGenFunction.h (+18-2) 
- (modified) clang/lib/CodeGen/CodeGenModule.h (+19) 
- (modified) clang/lib/CodeGen/ConstantEmitter.h (+3) 
- (modified) clang/lib/CodeGen/ItaniumCXXABI.cpp (+53-19) 
- (modified) clang/lib/CodeGen/MicrosoftCXXABI.cpp (+7-2) 
- (modified) clang/lib/Frontend/CompilerInvocation.cpp (+12) 
- (modified) clang/lib/Headers/ptrauth.h (+14) 
- (modified) clang/lib/InstallAPI/Visitor.cpp (+7-6) 
- (modified) clang/lib/Parse/ParseDecl.cpp (+29-1) 
- (modified) clang/lib/Sema/SemaDeclAttr.cpp (+116) 
- (modified) clang/lib/Sema/SemaDeclCXX.cpp (+46) 
- (modified) clang/lib/Sema/SemaExpr.cpp (+33) 
- (added) clang/test/CodeGen/ptrauth-ubsan-vptr.cpp (+30) 
- (modified) clang/test/CodeGenCXX/catch-undef-behavior.cpp (+4-3) 
- (added) clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-call-2.cpp (+105) 
- (added) clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-call.cpp (+42) 
- (added) 
clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-virtual-dtor-call.cpp (+50) 
- (added) clang/test/CodeGenCXX/ptrauth-explicit-vtable-pointer-control.cpp 
(+652) 
- (added) clang/test/CodeGenCXX/ptrauth-rtti-layout.cpp (+10) 
- (added) clang/test/CodeGenCXX/ptrauth-thunks.cpp (+28) 
- (added) clang/test/CodeGenCXX/ptrauth-virtual-function.cpp (+581) 
- (added) clang/test/CodeGenCXX/ptrauth-vtable-virtual-inheritance-thunk.cpp 
(+309) 
- (modified) clang/test/CodeGenCXX/ubsan-vtable-checks.cpp (+46-2) 
- (modified) clang/test/Misc/pragma-attribute-supported-attributes-list.test 
(+1) 
- (added) 
clang/test/SemaCXX/ptrauth-incomplete-virtual-member-function-return-arg-type.cpp
 (+50) 
- (added) clang/test/SemaCXX/vtable_pointer_authentication_attribute.cpp (+225) 
- (modified) clang/utils/TableGen/ClangAttrEmitter.cpp (+27) 


``diff
diff --git a/clang/include/clang/AST/ASTContext.h 
b/clang/include/clang/AST/ASTContext.h
index a1d1d1c51cd41..e601face9c2b6 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -37,6 +37,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/StringSet.h"
 #include "llvm/ADT/TinyPtrVector.h"
 #include "llvm/Support/TypeSize.h"
 #include 
@@ -1261,6 +1262,10 @@ class ASTContext : public RefCountedBase {
   /// space.
   QualType removeAddrSpaceQualType(QualType T) const;
 
+  /// Return the "other" type-specific discriminator for the given type.
+  uint16_t
+  getPointerAuthVTablePointerDiscriminator(const CXXRecordDecl *record);
+
   /// Apply Objective-C protocol qualifiers to the given type.
   /// \param allowOnPointerType specifies if we can apply protocol
   /// qualifiers on ObjCObjectPointerType. It can be set to true when
@@ -3418,12 +3423,20 @@ OPT_LIST(V)
   /// Whether a C++ static variable or CUDA/HIP kernel should be externalized.
   bool shouldExternalize(const Decl *D) const;
 
+  /// Resolve the root record to be used to derive the vtable pointer
+  /// authentication policy for the specified record.
+  const CXXRecordDecl *baseForVTableAuthentication(const CXXRecordDecl *);
+  bool useAbbreviatedThunkName(GlobalDecl virtualMethodDecl,
+   StringRef mangledName);
+
   StringRef getCUIDHash() const;
 
 private:
   /

[llvm-branch-commits] [clang] [clang] Implement pointer authentication for C++ virtual functions, v-tables, and VTTs (PR #94054)

2024-05-31 Thread Oliver Hunt via llvm-branch-commits

https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/94054
___
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] Implement pointer authentication for C++ virtual functions, v-tables, and VTTs. (PR #93907)

2024-05-31 Thread Ahmed Bougacha via llvm-branch-commits

https://github.com/ahmedbougacha closed 
https://github.com/llvm/llvm-project/pull/93907
___
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] e6c1256 - Revert "A few updates around "transcript" (#92843)"

2024-05-31 Thread via llvm-branch-commits

Author: gulfemsavrun
Date: 2024-05-31T20:05:03-07:00
New Revision: e6c1256867d6992d5affca539a8dab6541f8db9e

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

LOG: Revert "A few updates around "transcript" (#92843)"

This reverts commit ad884d97288c752ba9088d01cf7ab80b20e4d2a6.

Added: 


Modified: 
lldb/include/lldb/API/SBCommandInterpreter.h
lldb/include/lldb/Interpreter/CommandInterpreter.h
lldb/include/lldb/Target/Statistics.h
lldb/source/Commands/CommandObjectStats.cpp
lldb/source/Commands/Options.td
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/source/Target/Statistics.cpp
lldb/test/API/commands/statistics/basic/TestStats.py
lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py

Removed: 




diff  --git a/lldb/include/lldb/API/SBCommandInterpreter.h 
b/lldb/include/lldb/API/SBCommandInterpreter.h
index 639309aa32bfc..8ac36344b3a79 100644
--- a/lldb/include/lldb/API/SBCommandInterpreter.h
+++ b/lldb/include/lldb/API/SBCommandInterpreter.h
@@ -320,17 +320,10 @@ class SBCommandInterpreter {
 
   /// Returns a list of handled commands, output and error. Each element in
   /// the list is a dictionary with the following keys/values:
-  /// - "command" (string): The command that was given by the user.
-  /// - "commandName" (string): The name of the executed command.
-  /// - "commandArguments" (string): The arguments of the executed command.
+  /// - "command" (string): The command that was executed.
   /// - "output" (string): The output of the command. Empty ("") if no output.
   /// - "error" (string): The error of the command. Empty ("") if no error.
-  /// - "durationInSeconds" (float): The time it took to execute the command.
-  /// - "timestampInEpochSeconds" (int): The timestamp when the command is
-  ///   executed.
-  ///
-  /// Turn on settings `interpreter.save-transcript` for LLDB to populate
-  /// this list. Otherwise this list is empty.
+  /// - "seconds" (float): The time it took to execute the command.
   SBStructuredData GetTranscript();
 
 protected:

diff  --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h 
b/lldb/include/lldb/Interpreter/CommandInterpreter.h
index 8863523b2e31f..ccc30cf4f1a82 100644
--- a/lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -776,14 +776,10 @@ class CommandInterpreter : public Broadcaster,
 
   /// Contains a list of handled commands and their details. Each element in
   /// the list is a dictionary with the following keys/values:
-  /// - "command" (string): The command that was given by the user.
-  /// - "commandName" (string): The name of the executed command.
-  /// - "commandArguments" (string): The arguments of the executed command.
+  /// - "command" (string): The command that was executed.
   /// - "output" (string): The output of the command. Empty ("") if no output.
   /// - "error" (string): The error of the command. Empty ("") if no error.
-  /// - "durationInSeconds" (float): The time it took to execute the command.
-  /// - "timestampInEpochSeconds" (int): The timestamp when the command is
-  ///   executed.
+  /// - "seconds" (float): The time it took to execute the command.
   ///
   /// Turn on settings `interpreter.save-transcript` for LLDB to populate
   /// this list. Otherwise this list is empty.

diff  --git a/lldb/include/lldb/Target/Statistics.h 
b/lldb/include/lldb/Target/Statistics.h
index c04d529290fff..c4f17b503a1f9 100644
--- a/lldb/include/lldb/Target/Statistics.h
+++ b/lldb/include/lldb/Target/Statistics.h
@@ -133,7 +133,6 @@ struct ConstStringStats {
 struct StatisticsOptions {
   bool summary_only = false;
   bool load_all_debug_info = false;
-  bool include_transcript = false;
 };
 
 /// A class that represents statistics for a since lldb_private::Target.

diff  --git a/lldb/source/Commands/CommandObjectStats.cpp 
b/lldb/source/Commands/CommandObjectStats.cpp
index 1935b0fdfadfb..a92bb5d1165ee 100644
--- a/lldb/source/Commands/CommandObjectStats.cpp
+++ b/lldb/source/Commands/CommandObjectStats.cpp
@@ -81,9 +81,6 @@ class CommandObjectStatsDump : public CommandObjectParsed {
   case 'f':
 m_stats_options.load_all_debug_info = true;
 break;
-  case 't':
-m_stats_options.include_transcript = true;
-break;
   default:
 llvm_unreachable("Unimplemented option");
   }

diff  --git a/lldb/source/Commands/Options.td b/lldb/source/Commands/Options.td
index 194902abdce49..62bbfdc117834 100644
--- a/lldb/source/Commands/Options.td
+++ b/lldb/source/Commands/Options.td
@@ -1425,8 +1425,4 @@ let Command = "statistics dump" in {
 Desc<"Dump the total possible debug info statistics. "
 "Force loading all the debug information 

[llvm-branch-commits] [clang] release/18.x: [clang-format] Don't always break before << between str… (PR #94091)

2024-05-31 Thread Owen Pan via llvm-branch-commits

https://github.com/owenca created 
https://github.com/llvm/llvm-project/pull/94091

…ing literals (#92214)

>From 88711473d2affcb21703e7b4f78420c512192acf Mon Sep 17 00:00:00 2001
From: Owen Pan 
Date: Fri, 31 May 2024 20:13:27 -0700
Subject: [PATCH] release/18.x: [clang-format] Don't always break before <<
 between string literals (#92214)

---
 clang/lib/Format/TokenAnnotator.cpp   |  8 +---
 clang/unittests/Format/FormatTest.cpp | 11 +++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/clang/lib/Format/TokenAnnotator.cpp 
b/clang/lib/Format/TokenAnnotator.cpp
index c1f1662481922..628fe46cc348e 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -5159,9 +5159,11 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine 
&Line,
 return true;
   if (Left.IsUnterminatedLiteral)
 return true;
-  if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) &&
-  Right.Next->is(tok::string_literal)) {
-return true;
+  if (const auto *BeforeLeft = Left.Previous, *AfterRight = Right.Next;
+  BeforeLeft && BeforeLeft->is(tok::lessless) &&
+  Left.is(tok::string_literal) && Right.is(tok::lessless) && AfterRight &&
+  AfterRight->is(tok::string_literal)) {
+return Right.NewlinesBefore > 0;
   }
   if (Right.is(TT_RequiresClause)) {
 switch (Style.RequiresClausePosition) {
diff --git a/clang/unittests/Format/FormatTest.cpp 
b/clang/unittests/Format/FormatTest.cpp
index 0161a1685eb12..d69632f7f0f8c 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -10426,6 +10426,17 @@ TEST_F(FormatTest, KeepStringLabelValuePairsOnALine) {
   "  bbb);");
 }
 
+TEST_F(FormatTest, WrapBeforeInsertionOperatorbetweenStringLiterals) {
+  verifyFormat("QStringList() << \"foo\" << \"bar\";");
+
+  verifyNoChange("QStringList() << \"foo\"\n"
+ "  << \"bar\";");
+
+  verifyFormat("log_error(log, \"foo\" << \"bar\");",
+   "log_error(log, \"foo\"\n"
+   "   << \"bar\");");
+}
+
 TEST_F(FormatTest, UnderstandsEquals) {
   verifyFormat(
   "a =\n"

___
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] release/18.x: [clang-format] Don't always break before << between str… (PR #94091)

2024-05-31 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-format

Author: Owen Pan (owenca)


Changes

…ing literals (#92214)

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


2 Files Affected:

- (modified) clang/lib/Format/TokenAnnotator.cpp (+5-3) 
- (modified) clang/unittests/Format/FormatTest.cpp (+11) 


``diff
diff --git a/clang/lib/Format/TokenAnnotator.cpp 
b/clang/lib/Format/TokenAnnotator.cpp
index c1f1662481922..628fe46cc348e 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -5159,9 +5159,11 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine 
&Line,
 return true;
   if (Left.IsUnterminatedLiteral)
 return true;
-  if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) &&
-  Right.Next->is(tok::string_literal)) {
-return true;
+  if (const auto *BeforeLeft = Left.Previous, *AfterRight = Right.Next;
+  BeforeLeft && BeforeLeft->is(tok::lessless) &&
+  Left.is(tok::string_literal) && Right.is(tok::lessless) && AfterRight &&
+  AfterRight->is(tok::string_literal)) {
+return Right.NewlinesBefore > 0;
   }
   if (Right.is(TT_RequiresClause)) {
 switch (Style.RequiresClausePosition) {
diff --git a/clang/unittests/Format/FormatTest.cpp 
b/clang/unittests/Format/FormatTest.cpp
index 0161a1685eb12..d69632f7f0f8c 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -10426,6 +10426,17 @@ TEST_F(FormatTest, KeepStringLabelValuePairsOnALine) {
   "  bbb);");
 }
 
+TEST_F(FormatTest, WrapBeforeInsertionOperatorbetweenStringLiterals) {
+  verifyFormat("QStringList() << \"foo\" << \"bar\";");
+
+  verifyNoChange("QStringList() << \"foo\"\n"
+ "  << \"bar\";");
+
+  verifyFormat("log_error(log, \"foo\" << \"bar\");",
+   "log_error(log, \"foo\"\n"
+   "   << \"bar\");");
+}
+
 TEST_F(FormatTest, UnderstandsEquals) {
   verifyFormat(
   "a =\n"

``




https://github.com/llvm/llvm-project/pull/94091
___
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] release/18.x: [clang-format] Don't always break before << between str… (PR #94091)

2024-05-31 Thread Owen Pan via llvm-branch-commits

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