clang: lib/CodeGen/CGPointerAuth.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
18#include "llvm/Analysis/ValueTracking.h"
19#include "llvm/Support/SipHash.h"
20
21using namespace clang;
23
24
25
30 return nullptr;
31
33 assert(.isNull() && "type not provided for type-discriminated schema");
34 return llvm::ConstantInt::get(
36
38 assert(Decl.getDecl() &&
39 "declaration not provided for decl-discriminated schema");
40 return llvm::ConstantInt::get(IntPtrTy,
42
45 }
46 llvm_unreachable("bad discrimination kind");
47}
48
53
58
59
60uint16_t
62 uint16_t &EntityHash = PtrAuthDiscriminatorHashes[Declaration];
63
64 if (EntityHash == 0) {
66 EntityHash = llvm::getPointerAuthStableSipHash(Name);
67 }
68
69 return EntityHash;
70}
71
72
73
76 if (!Schema)
78
79 assert(!Schema.isAddressDiscriminated() &&
80 "function pointers cannot use address-specific discrimination");
81
82 llvm::Constant *Discriminator = nullptr;
83 if (T->isFunctionPointerType() || T->isFunctionReferenceType())
85 if (T->isFunctionType())
87
88 return CGPointerAuthInfo(Schema.getKey(), Schema.getAuthenticationMode(),
89 false, false,
90 Discriminator);
91}
92
93llvm::Value *
95 llvm::Value *Discriminator) {
96 StorageAddress = Builder.CreatePtrToInt(StorageAddress, IntPtrTy);
97 auto Intrinsic = CGM.getIntrinsic(llvm::Intrinsic::ptrauth_blend);
98 return Builder.CreateCall(Intrinsic, {StorageAddress, Discriminator});
99}
100
101
102
106 if (!Schema)
108
109 llvm::Value *Discriminator =
110 CGM.getPointerAuthOtherDiscriminator(Schema, SchemaDecl, SchemaType);
111
113 assert(StorageAddress &&
114 "address not provided for address-discriminated schema");
115
116 if (Discriminator)
117 Discriminator =
119 else
120 Discriminator = Builder.CreatePtrToInt(StorageAddress, IntPtrTy);
121 }
122
126}
127
130 Address StorageAddress) {
131 assert(Qual && "don't call this if you don't know that the Qual is present");
134
135 llvm::Value *Discriminator = nullptr;
137 Discriminator = llvm::ConstantInt::get(IntPtrTy, Extra);
138
140 assert(StorageAddress.isValid() &&
141 "address discrimination without address");
142 llvm::Value *StoragePtr = StorageAddress.emitRawPointer(*this);
143 if (Discriminator)
144 Discriminator =
146 else
147 Discriminator = Builder.CreatePtrToInt(StoragePtr, IntPtrTy);
148 }
149
152 Discriminator);
153}
154
155
156
159 if (PointeeType.isNull())
161
162
165
166
168}
169
171 return ::getPointerAuthInfoForPointeeType(*this, T);
172}
173
174
175
179
180
183
185
186 if (PointeeType.isNull())
188
189 return ::getPointerAuthInfoForPointeeType(CGM, PointeeType);
190}
191
193 return ::getPointerAuthInfoForType(*this, T);
194}
195
196static std::pair<llvm::Value *, CGPointerAuthInfo>
203 else
205 return {Value, AuthInfo};
206}
207
208
209
210std::pair<llvm::Value *, CGPointerAuthInfo>
213
215 if (const auto *Load = dyn_cast(E)) {
216 if (Load->getCastKind() == CK_LValueToRValue) {
217 E = Load->getSubExpr()->IgnoreParens();
218
219
220 if (const auto *RefExpr = dyn_cast(E)) {
222
223 if (.isReference())
224 return {Result.getValue(),
226
227
228 LValue LV = Result.getReferenceLValue(*this, RefExpr);
230 }
231 }
232
233
236 }
237 }
238
239
242}
243
244llvm::Value *
246 const Expr *E,
247 Address DestStorageAddress) {
248 assert(DestQualifier);
250
255}
256
260 assert(DestQualifier);
261
266 IsKnownNonNull);
267}
268
271 Address CurStorageAddress, bool IsKnownNonNull) {
272 assert(CurQualifier);
273
278 IsKnownNonNull);
279}
280
282 if (const auto *CI = dyn_castllvm::ConstantInt(Value))
283 return CI->isZero();
284 return false;
285}
286
289 assert((Left.isSigned() || Right.isSigned()) &&
290 "shouldn't be called if neither is signed");
291 if (Left.isSigned() != Right.isSigned())
292 return false;
293 return Left.getKey() == Right.getKey() &&
294 Left.getAuthenticationMode() == Right.getAuthenticationMode() &&
295 Left.isIsaPointer() == Right.isIsaPointer() &&
296 Left.authenticatesNullValues() == Right.authenticatesNullValues() &&
297 Left.getDiscriminator() == Right.getDiscriminator();
298}
299
300
304 return Discriminator ? Discriminator : Builder.getSize(0);
305}
306
307llvm::Value *
311 assert(CurAuth && NewAuth);
312
319 }
320
323
324 auto *CurKey = Builder.getInt32(CurAuth.getKey());
325 auto *NewKey = Builder.getInt32(NewAuth.getKey());
326
329
330
331
332
333 auto *Intrinsic = CGM.getIntrinsic(llvm::Intrinsic::ptrauth_resign);
335 Intrinsic, {Value, CurKey, CurDiscriminator, NewKey, NewDiscriminator});
336
337
340}
341
345
346 if (!CurAuthInfo && !NewAuthInfo)
348
349 llvm::Value *Null = nullptr;
350
351 if (auto *PointerValue = dyn_castllvm::PointerType(Value->getType())) {
352 Null = CGM.getNullPointer(PointerValue, Type);
353 } else {
355 Null = llvm::ConstantInt::get(IntPtrTy, 0);
356 }
357 if (Value == Null)
359
360
364 if (CurD == NewD)
366
370 }
371
372 llvm::BasicBlock *InitBB = Builder.GetInsertBlock();
373 llvm::BasicBlock *ResignBB = nullptr, *ContBB = nullptr;
374
375
376
377 if (!IsKnownNonNull && !llvm::isKnownNonZero(Value, CGM.getDataLayout())) {
380
381 auto *IsNonNull = Builder.CreateICmpNE(Value, Null);
382 Builder.CreateCondBr(IsNonNull, ResignBB, ContBB);
384 }
385
386
387 if (!NewAuthInfo)
389 else if (!CurAuthInfo)
391 else
393
394
395 if (ContBB) {
398 Phi->addIncoming(Null, InitBB);
399 Phi->addIncoming(Value, ResignBB);
401 }
402
404}
405
409 assert(Qual);
410 llvm::Value *Value = Builder.CreateLoad(SrcAddress);
411
412
417 false);
418 }
419
421}
422
423llvm::Constant *
425 llvm::Constant *StorageAddress,
426 llvm::ConstantInt *OtherDiscriminator) {
427 llvm::Constant *AddressDiscriminator;
428 if (StorageAddress) {
429 assert(StorageAddress->getType() == DefaultPtrTy);
430 AddressDiscriminator = StorageAddress;
431 } else {
432 AddressDiscriminator = llvm::Constant::getNullValue(DefaultPtrTy);
433 }
434
435 llvm::ConstantInt *IntegerDiscriminator;
436 if (OtherDiscriminator) {
437 assert(OtherDiscriminator->getType() == Int64Ty);
438 IntegerDiscriminator = OtherDiscriminator;
439 } else {
440 IntegerDiscriminator = llvm::ConstantInt::get(Int64Ty, 0);
441 }
442
443 return llvm::ConstantPtrAuth::get(
444 Pointer, llvm::ConstantInt::get(Int32Ty, Key), IntegerDiscriminator,
445 AddressDiscriminator,
446 llvm::Constant::getNullValue(DefaultPtrTy));
447}
448
449
455
456
457
460 llvm::Constant *StorageAddress, GlobalDecl SchemaDecl,
463 llvm::ConstantInt *OtherDiscriminator =
465
467 OtherDiscriminator);
468}
469
470llvm::Constant *
472 unsigned Key, llvm::Constant *StorageAddress,
473 llvm::ConstantInt *OtherDiscriminator) {
475 OtherDiscriminator);
476}
477
478
479
485
488 Pointer, PointerAuth.getKey(), nullptr,
489 cast_or_nullllvm::ConstantInt(PointerAuth.getDiscriminator()));
490
492}
493
495 llvm::Type *Ty) {
497 QualType FuncType = FD->getType();
498
499
500
501 if (!FD->hasPrototype())
503 FuncType = Context.getFunctionNoProtoType(Proto->getReturnType(),
504 Proto->getExtInfo());
505
507}
508
512 if (!Schema)
514
515 assert(!Schema.isAddressDiscriminated() &&
516 "function pointers cannot use address-specific discrimination");
517
518 llvm::ConstantInt *Discriminator =
520 return CGPointerAuthInfo(Schema.getKey(), Schema.getAuthenticationMode(),
521 false,
522 false, Discriminator);
523}
524
529 Pointer, PointerAuth.getKey(), nullptr,
530 cast_or_nullllvm::ConstantInt(PointerAuth.getDiscriminator()));
531
532 if (const auto *MFT = dyn_cast(FT.getTypePtr())) {
533 if (MFT->hasPointeeToCFIUncheckedCalleeFunctionType())
535 }
536
538}
539
541 llvm::Type *Ty) {
546}
547
548std::optional
549CodeGenModule::computeVTPointerAuthentication(const CXXRecordDecl *ThisClass) {
551 if (!DefaultAuthentication)
552 return std::nullopt;
554 Context.baseForVTableAuthentication(ThisClass);
555
556 unsigned Key = DefaultAuthentication.getKey();
557 bool AddressDiscriminated = DefaultAuthentication.isAddressDiscriminated();
558 auto DefaultDiscrimination = DefaultAuthentication.getOtherDiscrimination();
559 unsigned TypeBasedDiscriminator =
560 Context.getPointerAuthVTablePointerDiscriminator(PrimaryBase);
561 unsigned Discriminator;
563 Discriminator = TypeBasedDiscriminator;
564 } else if (DefaultDiscrimination ==
566 Discriminator = DefaultAuthentication.getConstantDiscrimination();
567 } else {
569 Discriminator = 0;
570 }
571 if (auto ExplicitAuthentication =
572 PrimaryBase->getAttr()) {
573 auto ExplicitAddressDiscrimination =
574 ExplicitAuthentication->getAddressDiscrimination();
575 auto ExplicitDiscriminator =
576 ExplicitAuthentication->getExtraDiscrimination();
577
578 unsigned ExplicitKey = ExplicitAuthentication->getKey();
579 if (ExplicitKey == VTablePointerAuthenticationAttr::NoKey)
580 return std::nullopt;
581
582 if (ExplicitKey != VTablePointerAuthenticationAttr::DefaultKey) {
583 if (ExplicitKey == VTablePointerAuthenticationAttr::ProcessIndependent)
585 else {
586 assert(ExplicitKey ==
587 VTablePointerAuthenticationAttr::ProcessDependent);
589 }
590 }
591
592 if (ExplicitAddressDiscrimination !=
593 VTablePointerAuthenticationAttr::DefaultAddressDiscrimination)
594 AddressDiscriminated =
595 ExplicitAddressDiscrimination ==
596 VTablePointerAuthenticationAttr::AddressDiscrimination;
597
598 if (ExplicitDiscriminator ==
599 VTablePointerAuthenticationAttr::TypeDiscrimination)
600 Discriminator = TypeBasedDiscriminator;
601 else if (ExplicitDiscriminator ==
602 VTablePointerAuthenticationAttr::CustomDiscrimination)
603 Discriminator = ExplicitAuthentication->getCustomDiscriminationValue();
604 else if (ExplicitDiscriminator ==
605 VTablePointerAuthenticationAttr::NoExtraDiscrimination)
606 Discriminator = 0;
607 }
610 false,
611 false);
612}
613
614std::optional
616 if (->getDefinition() ||
->isPolymorphic())
617 return std::nullopt;
618
619 auto Existing = VTablePtrAuthInfos.find(Record);
620 std::optional Authentication;
621 if (Existing != VTablePtrAuthInfos.end()) {
622 Authentication = Existing->getSecond();
623 } else {
624 Authentication = computeVTPointerAuthentication(Record);
625 VTablePtrAuthInfos.insert(std::make_pair(Record, Authentication));
626 }
627 return Authentication;
628}
629
630std::optional
633 llvm::Value *StorageAddress) {
635 if (!Authentication)
636 return std::nullopt;
637
638 llvm::Value *Discriminator = nullptr;
639 if (auto ExtraDiscriminator = Authentication->getExtraDiscriminator())
640 Discriminator = llvm::ConstantInt::get(IntPtrTy, ExtraDiscriminator);
641
642 if (Authentication->isAddressDiscriminated()) {
643 assert(StorageAddress &&
644 "address not provided for address-discriminated schema");
645 if (Discriminator)
646 Discriminator =
648 else
649 Discriminator = CGF->Builder.CreatePtrToInt(StorageAddress, IntPtrTy);
650 }
651
654 false,
655 false, Discriminator);
656}
657
664
667
668 if (!CurAuthInfo && !NewAuthInfo)
669 return ResultPtr;
670
671
672
674 CurAuthInfo = CGM.getFunctionPointerAuthInfo(SourceType);
675
677 NewAuthInfo = CGM.getFunctionPointerAuthInfo(DestType);
678
680 false);
681}
682
689
692
693 if (!CurAuthInfo && !NewAuthInfo)
694 return Ptr;
695
697
698
699
701 return Ptr;
702 }
703
705 NewAuthInfo = CGM.getFunctionPointerAuthInfo(DestType);
708 return Ptr;
709 }
710
711 return Ptr;
712}
713
718 : CGM.getPointerAuthInfoForPointeeType(PointeeTy);
719 return Addr.getResignedAddress(Info, *this);
720}
721
724 assert(isValid() && "pointer isn't valid");
726 llvm::Value *Val;
727
728
732
733 assert(ElementType && "Effective type has to be set");
734 assert(!Offset && "unexpected non-null offset");
735
736
737
738 if (CurInfo == NewInfo && ())
740 else
743
746}
747
748llvm::Value *Address::emitRawPointerSlow(CodeGenFunction &CGF) const {
750}
751
756
762
765 return Addr.isValid() ? Addr.emitRawPointer(CGF) : nullptr;
766}
static std::pair< llvm::Value *, CGPointerAuthInfo > emitLoadOfOrigPointerRValue(CodeGenFunction &CGF, const LValue &LV, SourceLocation Loc)
Definition CGPointerAuth.cpp:197
static bool isZeroConstant(const llvm::Value *Value)
Definition CGPointerAuth.cpp:281
static llvm::Value * getDiscriminatorOrZero(const CGPointerAuthInfo &Info, CGBuilderTy &Builder)
Definition CGPointerAuth.cpp:301
static bool equalAuthPolicies(const CGPointerAuthInfo &Left, const CGPointerAuthInfo &Right)
Definition CGPointerAuth.cpp:287
static CGPointerAuthInfo getPointerAuthInfoForPointeeType(CodeGenModule &CGM, QualType PointeeType)
Return the natural pointer authentication for values of the given pointee type.
Definition CGPointerAuth.cpp:158
static CGPointerAuthInfo getPointerAuthInfoForType(CodeGenModule &CGM, QualType PointerType)
Return the natural pointer authentication for values of the given pointer type.
Definition CGPointerAuth.cpp:176
llvm::MachO::Record Record
QualType getMemberPointerType(QualType T, NestedNameSpecifier Qualifier, const CXXRecordDecl *Cls) const
Return the uniqued reference to the type for a member pointer to the specified type in the specified ...
uint16_t getPointerAuthTypeDiscriminator(QualType T)
Return the "other" type-specific discriminator for the given type.
Represents a C++ struct/union/class.
PointerAuthOptions PointerAuth
Configuration for pointer-signing.
Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...
llvm::Value * getBasePointer() const
llvm::Value * emitRawPointer(CodeGenFunction &CGF) const
Return the pointer contained in this class after authenticating it and adding offset to it if necessa...
CharUnits getAlignment() const
llvm::Type * getElementType() const
Return the type of the values stored in this address.
void setPointerAuthInfo(const CGPointerAuthInfo &Info)
KnownNonNull_t isKnownNonNull() const
Whether the pointer is known not to be null.
Address getResignedAddress(const CGPointerAuthInfo &NewInfo, CodeGenFunction &CGF) const
Definition CGPointerAuth.cpp:722
const CGPointerAuthInfo & getPointerAuthInfo() const
PointerAuthenticationMode getAuthenticationMode() const
llvm::Value * getDiscriminator() const
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
llvm::Value * EmitPointerAuthQualify(PointerAuthQualifier Qualifier, llvm::Value *Pointer, QualType ValueType, Address StorageAddress, bool IsKnownNonNull)
Definition CGPointerAuth.cpp:257
llvm::Value * getAsNaturalPointerTo(Address Addr, QualType PointeeType)
llvm::Value * emitPointerAuthResignCall(llvm::Value *Pointer, const CGPointerAuthInfo &CurInfo, const CGPointerAuthInfo &NewInfo)
Definition CGPointerAuth.cpp:308
llvm::BasicBlock * createBasicBlock(const Twine &name="", llvm::Function *parent=nullptr, llvm::BasicBlock *before=nullptr)
createBasicBlock - Create an LLVM basic block.
bool isPointerKnownNonNull(const Expr *E)
llvm::Value * EmitPointerAuthUnqualify(PointerAuthQualifier Qualifier, llvm::Value *Pointer, QualType PointerType, Address StorageAddress, bool IsKnownNonNull)
Definition CGPointerAuth.cpp:269
@ TCK_Load
Checking the operand of a load. Must be suitably sized and aligned.
llvm::Value * EmitPointerAuthSign(const CGPointerAuthInfo &Info, llvm::Value *Pointer)
Address getAsNaturalAddressOf(Address Addr, QualType PointeeTy)
Definition CGPointerAuth.cpp:714
CGPointerAuthInfo EmitPointerAuthInfo(const PointerAuthSchema &Schema, llvm::Value *StorageAddress, GlobalDecl SchemaDecl, QualType SchemaType)
Emit the concrete pointer authentication informaton for the given authentication schema.
Definition CGPointerAuth.cpp:103
void EmitPointerAuthCopy(PointerAuthQualifier Qualifier, QualType Type, Address DestField, Address SrcField)
Definition CGPointerAuth.cpp:406
llvm::Value * emitPointerAuthResign(llvm::Value *Pointer, QualType PointerType, const CGPointerAuthInfo &CurAuthInfo, const CGPointerAuthInfo &NewAuthInfo, bool IsKnownNonNull)
Definition CGPointerAuth.cpp:342
ASTContext & getContext() const
llvm::Value * EmitLoadOfScalar(Address Addr, bool Volatile, QualType Ty, SourceLocation Loc, AlignmentSource Source=AlignmentSource::Type, bool isNontemporal=false)
EmitLoadOfScalar - Load a scalar value from an address, taking care to appropriately convert from the...
llvm::CallInst * EmitRuntimeCall(llvm::FunctionCallee callee, const Twine &name="")
llvm::Value * authPointerToPointerCast(llvm::Value *ResultPtr, QualType SourceType, QualType DestType)
Definition CGPointerAuth.cpp:658
LValue EmitCheckedLValue(const Expr *E, TypeCheckKind TCK)
Same as EmitLValue but additionally we generate checking code to guard against undefined behavior.
llvm::Value * EmitPointerAuthBlendDiscriminator(llvm::Value *StorageAddress, llvm::Value *Discriminator)
Create the discriminator from the storage address and the entity hash.
Definition CGPointerAuth.cpp:94
llvm::Value * EmitScalarExpr(const Expr *E, bool IgnoreResultAssign=false)
EmitScalarExpr - Emit the computation of the specified expression of LLVM scalar type,...
ConstantEmission tryEmitAsConstant(const DeclRefExpr *RefExpr)
Try to emit a reference to the given value without producing it as an l-value.
std::pair< llvm::Value *, CGPointerAuthInfo > EmitOrigPointerRValue(const Expr *E)
Retrieve a pointer rvalue and its ptrauth info.
Definition CGPointerAuth.cpp:211
void EmitBlock(llvm::BasicBlock *BB, bool IsFinished=false)
EmitBlock - Emit the given block.
llvm::Value * EmitPointerAuthAuth(const CGPointerAuthInfo &Info, llvm::Value *Pointer)
This class organizes the cross-function state that is used while generating LLVM code.
llvm::Constant * getRawFunctionPointer(GlobalDecl GD, llvm::Type *Ty=nullptr)
Return a function pointer for a reference to the given function.
llvm::Constant * getFunctionPointer(GlobalDecl GD, llvm::Type *Ty=nullptr)
Return the ABI-correct function pointer value for a reference to the given function.
Definition CGPointerAuth.cpp:494
CGPointerAuthInfo getMemberFunctionPointerAuthInfo(QualType FT)
Definition CGPointerAuth.cpp:509
llvm::ConstantInt * getPointerAuthOtherDiscriminator(const PointerAuthSchema &Schema, GlobalDecl SchemaDecl, QualType SchemaType)
Given a pointer-authentication schema, return a concrete "other" discriminator for it.
Definition CGPointerAuth.cpp:26
CGPointerAuthInfo getPointerAuthInfoForPointeeType(QualType type)
Definition CGPointerAuth.cpp:170
CGPointerAuthInfo getFunctionPointerAuthInfo(QualType T)
Return the abstract pointer authentication schema for a pointer to the given function type.
Definition CGPointerAuth.cpp:74
llvm::Constant * getMemberFunctionPointer(const FunctionDecl *FD, llvm::Type *Ty=nullptr)
Definition CGPointerAuth.cpp:540
std::optional< PointerAuthQualifier > getVTablePointerAuthentication(const CXXRecordDecl *thisClass)
Definition CGPointerAuth.cpp:615
uint16_t getPointerAuthDeclDiscriminator(GlobalDecl GD)
Return the "other" decl-specific discriminator for the given decl.
Definition CGPointerAuth.cpp:61
ASTContext & getContext() const
const CodeGenOptions & getCodeGenOpts() const
StringRef getMangledName(GlobalDecl GD)
std::optional< CGPointerAuthInfo > getVTablePointerAuthInfo(CodeGenFunction *Context, const CXXRecordDecl *Record, llvm::Value *StorageAddress)
Definition CGPointerAuth.cpp:631
llvm::Constant * getConstantSignedPointer(llvm::Constant *Pointer, const PointerAuthSchema &Schema, llvm::Constant *StorageAddress, GlobalDecl SchemaDecl, QualType SchemaType)
Sign a constant pointer using the given scheme, producing a constant with the same IR type.
Definition CGPointerAuth.cpp:458
bool shouldSignPointer(const PointerAuthSchema &Schema)
Does a given PointerAuthScheme require us to sign a value.
Definition CGPointerAuth.cpp:450
CGPointerAuthInfo getPointerAuthInfoForType(QualType type)
Definition CGPointerAuth.cpp:192
LValue - This represents an lvalue references.
llvm::Value * emitResignedPointer(QualType PointeeTy, CodeGenFunction &CGF) const
Definition CGPointerAuth.cpp:757
llvm::Value * getPointer(CodeGenFunction &CGF) const
Definition CGPointerAuth.cpp:752
llvm::Value * emitRawPointer(CodeGenFunction &CGF) const
Definition CGPointerAuth.cpp:763
This represents one expression.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Represents a function declaration or definition.
Represents a prototype with parameter type info, e.g.
FunctionType - C99 6.7.5.3 - Function Declarators.
GlobalDecl - represents a global declaration.
const Decl * getDecl() const
A pointer to member type per C++ 8.3.3 - Pointers to members.
Pointer-authentication qualifiers.
bool isIsaPointer() const
static PointerAuthQualifier Create(unsigned Key, bool IsAddressDiscriminated, unsigned ExtraDiscriminator, PointerAuthenticationMode AuthenticationMode, bool IsIsaPointer, bool AuthenticatesNullValues)
bool authenticatesNullValues() const
bool isAddressDiscriminated() const
unsigned getExtraDiscriminator() const
PointerAuthenticationMode getAuthenticationMode() const
Discrimination getOtherDiscrimination() const
bool isAddressDiscriminated() const
@ None
No additional discrimination.
@ Type
Include a hash of the entity's type.
@ Decl
Include a hash of the entity's identity.
@ Constant
Discriminate using a constant value.
bool authenticatesNullValues() const
PointerAuthenticationMode getAuthenticationMode() const
uint16_t getConstantDiscrimination() const
bool isIsaPointer() const
PointerType - C99 6.7.5.1 - Pointer Declarators.
QualType getPointeeType() const
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Encodes a location in the source.
bool isBlockPointerType() const
bool isFunctionReferenceType() const
bool isSignableType(const ASTContext &Ctx) const
bool isFunctionPointerType() const
bool isFunctionType() const
const T * getAs() const
Member-template getAs'.
@ Type
The l-value was considered opaque, so the alignment was determined from a type.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
uint16_t getPointerAuthDeclDiscriminator(CodeGenModule &CGM, GlobalDecl GD)
Return a declaration discriminator for the given global decl.
Definition CGPointerAuth.cpp:54
llvm::Constant * getConstantSignedPointer(CodeGenModule &CGM, llvm::Constant *Pointer, unsigned Key, llvm::Constant *StorageAddress, llvm::ConstantInt *OtherDiscriminator)
Return a signed constant pointer.
Definition CGPointerAuth.cpp:471
uint16_t getPointerAuthTypeDiscriminator(CodeGenModule &CGM, QualType FunctionType)
Return a type discriminator for the given function type.
Definition CGPointerAuth.cpp:49
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
const FunctionProtoType * T
U cast(CodeGen::Address addr)
llvm::IntegerType * Int64Ty
llvm::IntegerType * Int32Ty
llvm::IntegerType * IntPtrTy
llvm::PointerType * DefaultPtrTy
PointerAuthSchema CXXVTablePointers
The ABI for C++ virtual table pointers (the pointer to the table itself) as installed in an actual cl...
PointerAuthSchema FunctionPointers
The ABI for C function pointers.
PointerAuthSchema CXXMemberFunctionPointers
The ABI for C++ member function pointers.