[llvm-branch-commits] [clang] [clang] Define ptrauth_string_discriminator builtin. (PR #93903)

Anton Korobeynikov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 3 12:14:18 PDT 2024


================
@@ -2156,6 +2156,24 @@ static ExprResult PointerAuthAuthAndResign(Sema &S, CallExpr *Call) {
   return Call;
 }
 
+static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *call) {
+  if (checkPointerAuthEnabled(S, call)) return ExprError();
+
+  // We've already performed normal call type-checking.
+  Expr *arg = call->getArgs()[0]->IgnoreParenImpCasts();
+
+  // Operand must be an ordinary or UTF-8 string literal.
+  auto literal = dyn_cast<StringLiteral>(arg);
----------------
asl wrote:

```suggestion
  const auto *Literal = dyn_cast<StringLiteral>(Arg);
```

https://github.com/llvm/llvm-project/pull/93903


More information about the llvm-branch-commits mailing list