ahatanak created this revision.
ahatanak added a subscriber: cfe-commits.
This patch fixes a warning that is issued when -Wpadded is on clang's command
line. The following warning is from the build log of
http://lab.llvm.org:8080/green/view/Libcxx/job/libcxx_abi/554/consoleText (note
that I see
ahatanak added a comment.
ping
http://reviews.llvm.org/D15599
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ahatanak added a comment.
ping
http://reviews.llvm.org/D15097
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ahatanak added a comment.
OK, thank you for the review.
I'll commit this patch in a day or two unless someone comes up with a better
solution.
http://reviews.llvm.org/D15097
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257357: [Sema] Issue a warning for integer overflow in
struct initializer (authored by ahatanak).
Changed prior to commit:
http://reviews.llvm.org/D15097?vs=41451&id=44521#toc
Repository:
rL LLVM
ht
Author: ahatanak
Date: Mon Jan 11 11:22:01 2016
New Revision: 257357
URL: http://llvm.org/viewvc/llvm-project?rev=257357&view=rev
Log:
[Sema] Issue a warning for integer overflow in struct initializer
Clang wasn't issuing a warning when compiling the following code:
struct s {
unsigned x;
} s
It triggers in dead branches and so does an initialization of an integer
variable declared in a function.
I’ll look into fixing it.
> On Jan 11, 2016, at 9:54 AM, Joerg Sonnenberger via cfe-commits
> wrote:
>
> On Mon, Jan 11, 2016 at 05:22:01PM -, Akira Hatanaka via cfe-comm
ahatanak added a comment.
In http://reviews.llvm.org/D15599#325113, @hans wrote:
> Just out of curiosity, where does this come up in practice?
I only have a short test case a user provided so t's not really clear whether
it was necessary to mark a member function naked or there were other ways
ahatanak added a comment.
Ping.
The same pragma is being used in other places (regex.cpp and locale.cpp) to
silence the warning.
http://reviews.llvm.org/D15897
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/m
Author: ahatanak
Date: Thu Jan 14 21:34:06 2016
New Revision: 257865
URL: http://llvm.org/viewvc/llvm-project?rev=257865&view=rev
Log:
[CodeGen] Attach attributes to thread local wrapper function.
This commit is a follow-up to r251734, r251476, and r249735, which fixes
a bug where function attrib
ahatanak added reviewers: mclow.lists, EricWF, joerg, howard.hinnant.
ahatanak added a comment.
Adding reviewers
http://reviews.llvm.org/D15897
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cf
ahatanak added a subscriber: ahatanak.
ahatanak added a comment.
This looks LGTM.
http://reviews.llvm.org/D12664
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ahatanak added a comment.
ping
http://reviews.llvm.org/D15599
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ahatanak added inline comments.
Comment at: lib/CodeGen/CodeGenFunction.cpp:1962
@@ +1961,3 @@
+for (auto *U : I->users())
+ InstrsToRemove.push_back(cast(U));
+
manmanren wrote:
> Do we need to check if the user has been erased? I am not sure if the same
ahatanak added inline comments.
Comment at: lib/CodeGen/CodeGenFunction.cpp:1954
@@ +1953,3 @@
+ // Erase all allocas and their users.
+ for (auto I = EntryBB->begin(); &*I != &*AllocaInsertPt; ++I)
+if (auto Alloca = dyn_cast(&*I))
hans wrote:
> would decla
ahatanak updated this revision to Diff 45910.
ahatanak added a comment.
Address review comments from Hans and Manman.
http://reviews.llvm.org/D15599
Files:
lib/CodeGen/CGCall.cpp
lib/CodeGen/CGStmt.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenFunction.h
test/CodeGen/attr-nak
ahatanak added a comment.
Maybe we can just remove -Wpadded from buildit's command line for now? If we
decide in the future it's worthwhile to use -Wpadded, we can put it back and
commit this patch. Also in that case we should make sure cmake uses the option
too.
http://reviews.llvm.org/D1589
ahatanak added a comment.
Do you mean "-Wpadded -Wno-error=padded" instead of padding?
I'm looking for a way to silence the warning, so that isn't enough. If we need
more time to decide whether we want to use -Wpadded (for both buildit and
cmake), I think I'll just remove -Wpadded from buildit'
ahatanak added a comment.
There is also a PR about splitting -Wpadded into two options: one warns about
padding in the middle of a struct and the other warns about padding at the end.
If the former option is used instead of -Wpadded, I believe it's possible to
remove the pragmas that are curren
ahatanak added inline comments.
Comment at: lib/CodeGen/ModuleBuilder.cpp:219
@@ -211,2 +218,3 @@
+ }
}
Is it possible to avoid the code duplication if the condition is inverted as
shown below?
if (!Diags.hasErrorOccurred())
// call Builder->Releas
Author: ahatanak
Date: Tue Jan 26 19:55:11 2016
New Revision: 258900
URL: http://llvm.org/viewvc/llvm-project?rev=258900&view=rev
Log:
[libcxx] Remove -Wpadded from buildit script.
Per discussion with Eric and Joerg, this commit removes -Wpadded to
silence the warning about the padding inserted a
ahatanak abandoned this revision.
ahatanak added a comment.
Abandoning this patch as I've removed -Wpadded in r258900.
http://reviews.llvm.org/D15897
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listi
Author: ahatanak
Date: Thu Jan 28 00:13:36 2016
New Revision: 259023
URL: http://llvm.org/viewvc/llvm-project?rev=259023&view=rev
Log:
[libcxx] Remove pragmas that were needed to suppress warnings produced
by -Wpadded.
We don't need these pragmas anymore because -Wpadded was removed from
buildit
ahatanak updated this revision to Diff 40060.
ahatanak marked 2 inline comments as done.
ahatanak added a comment.
Added "expected-no-diagnostics" to test case.
http://reviews.llvm.org/D12547
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
lib/CodeGen/CGCall.cpp
lib/S
Author: ahatanak
Date: Thu Nov 12 11:21:22 2015
New Revision: 252912
URL: http://llvm.org/viewvc/llvm-project?rev=252912&view=rev
Log:
Add support for driver option -mno-ms-bitfields.
This option is used to cancel -mms-bitfields on the command line.
rdar://problem/15898553
Added:
cfe/trunk/
ahatanak marked an inline comment as done.
ahatanak added a comment.
I'll commit this patch shortly. Thank you for the review.
http://reviews.llvm.org/D12547
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailm
Author: ahatanak
Date: Thu Nov 12 18:42:21 2015
New Revision: 252986
URL: http://llvm.org/viewvc/llvm-project?rev=252986&view=rev
Log:
Add support for function attribute 'disable_tail_calls'.
The ``disable_tail_calls`` attribute instructs the backend to not
perform tail call optimization inside t
This revision was automatically updated to reflect the committed changes.
Closed by commit rL252986: Add support for function attribute
'disable_tail_calls'. (authored by ahatanak).
Changed prior to commit:
http://reviews.llvm.org/D12547?vs=40060&id=40099#toc
Repository:
rL LLVM
http://revi
ahatanak added a comment.
> If you can get the CPU name, return it. If not, return "native". If you're on
> AArch64 and you can't get the CPU name, that's a bug that needs fixing. If
> it's always "generic", that's another piece of code that needs fixing. If
> whatever getCPU function you use d
ahatanak added a comment.
Thanks, I'll commit this patch shortly.
If it makes the code cleaner, I can define enums in TargetInfo and change
validateGlobalRegisterVariable to return one of them in a follow-up patch.
http://reviews.llvm.org/D13834
_
This revision was automatically updated to reflect the committed changes.
Closed by commit rL253405: Produce a better diagnostic for global register
variables. (authored by ahatanak).
Changed prior to commit:
http://reviews.llvm.org/D13834?vs=39774&id=40451#toc
Repository:
rL LLVM
http://re
Author: ahatanak
Date: Tue Nov 17 18:15:28 2015
New Revision: 253405
URL: http://llvm.org/viewvc/llvm-project?rev=253405&view=rev
Log:
Produce a better diagnostic for global register variables.
Currently, when there is a global register variable in a program that
is bound to an invalid register,
ahatanak created this revision.
ahatanak added a subscriber: cfe-commits.
Issue a warning if an initializing integer expression overflows.
For example, clang should issue a warning when compiling the following code
because 4 * 1024 * 1024 * 1024 doesn't fit into a 32-bit integer:
struct s {
uns
ahatanak created this revision.
ahatanak added a subscriber: cfe-commits.
This patch fixes a crash that occurs when __kindof is incorrectly used in the
type parameter list of an interface. The crash occurs because
ObjCTypeParamList::back() is called in checkTypeParamListConsistency on an
empty
On Mon, Dec 14, 2015 at 10:39 AM, Justin Bogner
wrote:
> Akira Hatanaka via cfe-commits writes:
> > ahatanak created this revision.
> > ahatanak added a subscriber: cfe-commits.
> >
> > This patch fixes a crash that occurs when __kindof is incorrectly used
> >
ping
On Mon, Nov 30, 2015 at 4:30 PM, Akira Hatanaka wrote:
> ahatanak created this revision.
> ahatanak added a subscriber: cfe-commits.
>
> Issue a warning if an initializing integer expression overflows.
>
> For example, clang should issue a warning when compiling the following
> code because
On Tue, Dec 15, 2015 at 12:55 PM, Justin Bogner
wrote:
> Akira Hatanaka writes:
> > On Mon, Dec 14, 2015 at 10:39 AM, Justin Bogner
> > wrote:
> >
> >> Akira Hatanaka via cfe-commits writes:
> >> > ahatanak created this revision.
>
Author: ahatanak
Date: Wed Dec 16 00:25:38 2015
New Revision: 255754
URL: http://llvm.org/viewvc/llvm-project?rev=255754&view=rev
Log:
[Objective-c] Fix a crash that occurs when ObjCTypeParamList::back() is
called on an empty list.
This commit makes Parser::parseObjCTypeParamListOrProtocolRefs re
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255754: [Objective-c] Fix a crash that occurs when
ObjCTypeParamList::back() is (authored by ahatanak).
Changed prior to commit:
http://reviews.llvm.org/D15463?vs=42560&id=42962#toc
Repository:
rL LL
gt; wrote:
> >
> >> Akira Hatanaka writes:
> >> > On Mon, Dec 14, 2015 at 10:39 AM, Justin Bogner <
> m...@justinbogner.com>
> >> > wrote:
> >> >
> >> >> Akira Hatanaka via cfe-commits writes:
> >> >> > ahat
ahatanak created this revision.
ahatanak added a subscriber: cfe-commits.
clang crashes when it compiles a member function or a lambda is marked as
"naked":
struct S {
__attribute__((naked)) S() {}
}
To fix this bug, this patch defines a function that cleans up the naked
function removing al
ahatanak wrote:
I think I've addressed all the feedback I got. Are there any other comments?
https://github.com/llvm/llvm-project/pull/67454
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com
@@ -2220,6 +2220,11 @@ llvm::Constant
*ConstantLValueEmitter::emitPointerAuthPointer(const Expr *E) {
// The assertions here are all checked by Sema.
assert(Result.Val.isLValue());
+ auto *Base = Result.Val.getLValueBase().get();
+ if (auto *Decl = dyn_cast_or_null(Base
@@ -3140,6 +3140,269 @@
ASTContext::getPointerAuthVTablePointerDiscriminator(const CXXRecordDecl *RD) {
return llvm::getPointerAuthStableSipHash(Str);
}
+/// Encode a function type for use in the discriminator of a function pointer
+/// type. We can't use the itanium scheme
@@ -2220,6 +2220,11 @@ llvm::Constant
*ConstantLValueEmitter::emitPointerAuthPointer(const Expr *E) {
// The assertions here are all checked by Sema.
assert(Result.Val.isLValue());
+ auto *Base = Result.Val.getLValueBase().get();
+ if (auto *Decl = dyn_cast_or_null(Base
ahatanak wrote:
Sorry, I didn't remember that I had to set `BLOCK_HAS_SIGNATURE` to 0.
https://github.com/llvm/llvm-project/pull/96944
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ahatanak updated
https://github.com/llvm/llvm-project/pull/96944
>From d21bdaec94a169b27e7f7bace399e77bf99fd572 Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Tue, 25 Jun 2024 19:37:46 -0700
Subject: [PATCH 1/2] [CodeGen] Add a flag to disable emitting block signature
s
@@ -5,55 +5,65 @@
// RUN: -fptrauth-vtable-pointer-address-discrimination \
// RUN: -fptrauth-vtable-pointer-type-discrimination \
// RUN: -fptrauth-init-fini | \
-// RUN: FileCheck %s
--check-prefixes=INTRIN,CALLS,RETS,VPTR_ADDR_DISCR,VPTR_TYPE_DISCR,INITFINI
+// RUN:
https://github.com/ahatanak updated
https://github.com/llvm/llvm-project/pull/96992
>From cf22a4be007f7e6fdc6e4c17c1f32fa70440b123 Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Wed, 26 Jun 2024 13:02:31 -0700
Subject: [PATCH 1/4] [clang] Implement function pointer type discrimination
Giv
ahatanak wrote:
@rjmccall sent an RFC for upstreaming pointer authentication work to llvm-dev
in 2019, which mentions the `__ptrauth` qualifier.
https://discourse.llvm.org/t/rfc-pointer-authentication-for-arm64e/53433
I don't think we sent an RFC for adding support for the `__ptrauth` qualifie
ahatanak wrote:
I'll try to come up with an RFC for the qualifier today.
https://github.com/llvm/llvm-project/pull/100830
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ahatanak wrote:
RFC for `__ptrauth`: https://discourse.llvm.org/t/rfc-ptrauth-qualifier/80710
https://github.com/llvm/llvm-project/pull/100830
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c
https://github.com/ahatanak created
https://github.com/llvm/llvm-project/pull/94515
VarDecl::isNull() doesn't tell whether the VarDecl has an initializer as
methods like ensureEvaluatedStmt can create an EvaluatedStmt even when there
isn't an initializer.
Revert e1c3e16d24b5cc097ff08e9283f533
https://github.com/ahatanak updated
https://github.com/llvm/llvm-project/pull/94515
>From 22a8fa09e81337f45c2ed94e229f06e9aaa32c0e Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Wed, 5 Jun 2024 11:02:31 -0700
Subject: [PATCH] Check whether EvaluatedStmt::Value is valid in
VarDecl::hasInit
https://github.com/ahatanak ready_for_review
https://github.com/llvm/llvm-project/pull/94515
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ahatanak approved this pull request.
https://github.com/llvm/llvm-project/pull/94377
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -201,14 +211,26 @@ template <> struct DominatingValue {
class saved_type {
enum Kind { ScalarLiteral, ScalarAddress, AggregateLiteral,
AggregateAddress, ComplexAddress };
-
-llvm::Value *Value;
-llvm::Type *ElementType;
+union {
+ struc
@@ -201,14 +211,26 @@ template <> struct DominatingValue {
class saved_type {
enum Kind { ScalarLiteral, ScalarAddress, AggregateLiteral,
AggregateAddress, ComplexAddress };
-
-llvm::Value *Value;
-llvm::Type *ElementType;
+union {
+ struc
https://github.com/ahatanak created
https://github.com/llvm/llvm-project/pull/95165
Prior to 84780af4b02cb3b86e4cb724f996bf8e02f2f2e7, the class didn't have any
information about whether the saved value was volatile.
This is NFC as far as I can tell.
>From 09faa416eb234ab3bf8e1babb3a7c206968e
https://github.com/ahatanak ready_for_review
https://github.com/llvm/llvm-project/pull/95165
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ahatanak closed
https://github.com/llvm/llvm-project/pull/95165
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -201,14 +211,26 @@ template <> struct DominatingValue {
class saved_type {
enum Kind { ScalarLiteral, ScalarAddress, AggregateLiteral,
AggregateAddress, ComplexAddress };
-
-llvm::Value *Value;
-llvm::Type *ElementType;
+union {
+ struc
https://github.com/ahatanak updated
https://github.com/llvm/llvm-project/pull/94515
>From 22a8fa09e81337f45c2ed94e229f06e9aaa32c0e Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Wed, 5 Jun 2024 11:02:31 -0700
Subject: [PATCH 1/2] Check whether EvaluatedStmt::Value is valid in
VarDecl::has
https://github.com/ahatanak closed
https://github.com/llvm/llvm-project/pull/94515
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ahatanak closed
https://github.com/llvm/llvm-project/pull/93906
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ahatanak wrote:
> I think my last comment/question is still open? How/why did the symbol name
> end up dropping any llvm/clang component to avoid collisions with other names?
I dropped llvm/clang because I didn't think it would cause any collision in
practice, but I don't think we have to try
https://github.com/ahatanak updated
https://github.com/llvm/llvm-project/pull/79230
>From 95200f3bb3859738981240a9d8c503a13ede9601 Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Tue, 16 Jan 2024 13:18:09 -0800
Subject: [PATCH 01/17] Add support for builtin_verbose_trap
The builtin causes
@@ -27,6 +27,9 @@ namespace llvm {
}
}
+// Prefix for __builtin_verbose_trap.
+#define CLANG_VERBOSE_TRAP_PREFIX "__llvm_verbose_trap"
ahatanak wrote:
I don't have any preference, but according to people working on lldb, macro
would make it marginally easi
https://github.com/ahatanak created
https://github.com/llvm/llvm-project/pull/93749
`Eval->Value.get` returns a null pointer when the variable doesn't have an
initializer.
This fixes https://github.com/llvm/llvm-project/issues/93625.
rdar://128482541
>From 4648f46f5e15d5747596347feaef85069a8
ahatanak wrote:
Note that the call to `hasInit` at the beginning of function `VarDecl::getInit`
returns true even when the variable doesn't have an initializer if
`VarDecl::ensureEvaluatedStmt` is called before that.
https://github.com/llvm/llvm-project/pull/93749
_
https://github.com/ahatanak updated
https://github.com/llvm/llvm-project/pull/93749
>From 4648f46f5e15d5747596347feaef85069a8ce4df Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Wed, 29 May 2024 15:19:58 -0700
Subject: [PATCH 1/2] Use cast_or_null instead of cast
`Eval->Value.get` returns
https://github.com/ahatanak edited
https://github.com/llvm/llvm-project/pull/93749
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ahatanak updated
https://github.com/llvm/llvm-project/pull/93749
>From 4648f46f5e15d5747596347feaef85069a8ce4df Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Wed, 29 May 2024 15:19:58 -0700
Subject: [PATCH 1/3] Use cast_or_null instead of cast
`Eval->Value.get` returns
https://github.com/ahatanak updated
https://github.com/llvm/llvm-project/pull/93749
>From 4648f46f5e15d5747596347feaef85069a8ce4df Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Wed, 29 May 2024 15:19:58 -0700
Subject: [PATCH 1/3] Use cast_or_null instead of cast
`Eval->Value.get` returns
ahatanak wrote:
`hasInit` checks whether `VarDecl::Init`'s pointer is null. But
`VarDecl::ensureEvaluatedStmt` creates an `EvaluatedStmt` if there isn't one
already, after which `hasInit` returns true.
https://github.com/llvm/llvm-project/blob/3af717d661e9fe8d562181b933a373ca58e41b27/clang/li
ahatanak wrote:
I can see if we can make `hasInit` check that too or rename the function after
committing this patch.
https://github.com/llvm/llvm-project/pull/93749
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bi
https://github.com/ahatanak closed
https://github.com/llvm/llvm-project/pull/93749
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ahatanak approved this pull request.
https://github.com/llvm/llvm-project/pull/93901
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ahatanak updated
https://github.com/llvm/llvm-project/pull/79230
>From 95200f3bb3859738981240a9d8c503a13ede9601 Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Tue, 16 Jan 2024 13:18:09 -0800
Subject: [PATCH 01/12] Add support for builtin_verbose_trap
The builtin causes
@@ -3424,6 +3445,26 @@ llvm::DIMacroFile
*CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent,
return DBuilder.createTempMacroFile(Parent, Line, FName);
}
+llvm::DILocation *CGDebugInfo::CreateTrapFailureMessageFor(
ahatanaka wrote:
OK, I'll make it
@@ -3424,6 +3445,26 @@ llvm::DIMacroFile
*CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent,
return DBuilder.createTempMacroFile(Parent, Line, FName);
}
+llvm::DILocation *CGDebugInfo::CreateTrapFailureMessageFor(
ahatanak wrote:
@dwblaikie 's com
https://github.com/ahatanak created
https://github.com/llvm/llvm-project/pull/100204
The builtin computes the discriminator for a type, which can be used to
sign/authenticate function pointers and member function pointers.
If the type passed to the builtin is a C++ member function pointer type
@@ -0,0 +1,64 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++17 -Wno-vla -fsyntax-only
-verify -fptrauth-intrinsics %s
+// RUN: %clang_cc1 -triple aarch64-linux-gnu -std=c++17 -Wno-vla -fsyntax-only
-verify -fptrauth-intrinsics %s
+
+// RUN: not %clang_cc1 -triple arm64-
https://github.com/ahatanak updated
https://github.com/llvm/llvm-project/pull/100204
>From 4cbbf9ee2c5afaa3818c10ab6f2645353da94a8c Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Tue, 23 Jul 2024 11:55:57 -0700
Subject: [PATCH 1/2] [PAC] Define __builtin_ptrauth_type_discriminator
The bui
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple
%itanium_abi_triple -verify %s -DN=1
// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple
%itanium_abi_triple -verify %s -DN=2
+// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple
%i
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple
%itanium_abi_triple -verify %s -DN=1
// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple
%itanium_abi_triple -verify %s -DN=2
+// RUN: %clang_cc1 -emit-llvm-only -x c++ -std=c++11 -triple
%i
@@ -588,12 +588,6 @@ bool EmitAssemblyHelper::AddEmitPasses(legacy::PassManager
&CodeGenPasses,
// this also adds codegenerator level optimization passes.
CodeGenFileType CGFT = getCodeGenFileType(Action);
- // Add ObjC ARC final-cleanup optimizations. This is done as pa
@@ -2373,7 +2373,9 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
DestLV.setTBAAInfo(TBAAAccessInfo::getMayAliasInfo());
return EmitLoadOfLValue(DestLV, CE->getExprLoc());
}
-return Builder.CreateBitCast(Src, DstTy);
+
+llvm::Value *Result =
@@ -3126,3 +3137,57 @@ CodeGenFunction::EmitPointerAuthAuth(const
CGPointerAuthInfo &PointerAuth,
return EmitPointerAuthCommon(*this, PointerAuth, Pointer,
llvm::Intrinsic::ptrauth_auth);
}
+
+llvm::Value *CodeGenFunction::EmitPointerAuthSign(Q
@@ -165,6 +166,88 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static bool isZeroConstant(llvm::Value *value) {
ahatanak wrote:
I fixed the names of variables and functions add
@@ -165,6 +166,88 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static bool isZeroConstant(llvm::Value *value) {
+ if (auto ci = dyn_cast(value))
+return ci->isZero();
+ return false;
+}
+
@@ -165,6 +166,88 @@ CGPointerAuthInfo
CodeGenModule::getPointerAuthInfoForType(QualType T) {
return ::getPointerAuthInfoForType(*this, T);
}
+static bool isZeroConstant(llvm::Value *value) {
+ if (auto ci = dyn_cast(value))
+return ci->isZero();
+ return false;
+}
+
@@ -0,0 +1,77 @@
+// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple
arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - |
FileCheck -check-prefix=CHECK -check-prefix=NOPCH %s
ahatanak wrote:
Sorry, I just realized th
@@ -351,3 +434,125 @@ CodeGenModule::getVTablePointerAuthInfo(CodeGenFunction
*CGF,
/* IsIsaPointer */ false,
/* AuthenticatesNullValues */ false, Discriminator);
}
+
+llvm::Value *CodeGenFunction::AuthPointerToPointerCast(
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -fptrauth-calls
-fptrauth-intrinsics -emit-llvm -o-
-fptrauth-function-pointer-type-discrimination | FileCheck %s
ahatanak wrote:
Thanks! Please add a line to test linux after this PR is merged
https://github.com/ahatanak updated
https://github.com/llvm/llvm-project/pull/85886
>From d39667c7e65c10babb478d8f8d54fecb66d90568 Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Tue, 19 Mar 2024 15:50:00 -0700
Subject: [PATCH 1/5] [Sema] Don't drop weak_import from a declaration that
foll
https://github.com/ahatanak closed
https://github.com/llvm/llvm-project/pull/85886
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ahatanak closed
https://github.com/llvm/llvm-project/pull/98847
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ahatanak created
https://github.com/llvm/llvm-project/pull/99590
The function pointer needs to be authenticated before doing the type checks.
>From c44fbc480f8632a178633637010ab6953ed3e50d Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Thu, 18 Jul 2024 16:54:09 -0700
Su
https://github.com/ahatanak created
https://github.com/llvm/llvm-project/pull/99595
Use type int as the underlying type when the enum type is incomplete.
>From 14612f84704edbcc3b3bcb20d6e114890e1c3998 Mon Sep 17 00:00:00 2001
From: Akira Hatanaka
Date: Thu, 18 Jul 2024 17:59:46 -0700
Subject:
801 - 900 of 1077 matches
Mail list logo