#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "clang/CodeGen/CodeGenABITypes.h"
#include "clang/CodeGen/ConstantInitBuilder.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Support/SipHash.h"
usingnamespaceclang;
usingnamespaceCodeGen;
llvm::ConstantInt *CodeGenModule::getPointerAuthOtherDiscriminator(
const PointerAuthSchema &Schema, GlobalDecl Decl, QualType Type) { … }
uint16_t CodeGen::getPointerAuthTypeDiscriminator(CodeGenModule &CGM,
QualType FunctionType) { … }
uint16_t CodeGen::getPointerAuthDeclDiscriminator(CodeGenModule &CGM,
GlobalDecl Declaration) { … }
uint16_t
CodeGenModule::getPointerAuthDeclDiscriminator(GlobalDecl Declaration) { … }
CGPointerAuthInfo CodeGenModule::getFunctionPointerAuthInfo(QualType T) { … }
llvm::Value *
CodeGenFunction::EmitPointerAuthBlendDiscriminator(llvm::Value *StorageAddress,
llvm::Value *Discriminator) { … }
CGPointerAuthInfo CodeGenFunction::EmitPointerAuthInfo(
const PointerAuthSchema &Schema, llvm::Value *StorageAddress,
GlobalDecl SchemaDecl, QualType SchemaType) { … }
static CGPointerAuthInfo
getPointerAuthInfoForPointeeType(CodeGenModule &CGM, QualType PointeeType) { … }
CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForPointeeType(QualType T) { … }
static CGPointerAuthInfo getPointerAuthInfoForType(CodeGenModule &CGM,
QualType PointerType) { … }
CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForType(QualType T) { … }
static bool isZeroConstant(const llvm::Value *Value) { … }
static bool equalAuthPolicies(const CGPointerAuthInfo &Left,
const CGPointerAuthInfo &Right) { … }
static llvm::Value *getDiscriminatorOrZero(const CGPointerAuthInfo &Info,
CGBuilderTy &Builder) { … }
llvm::Value *
CodeGenFunction::emitPointerAuthResignCall(llvm::Value *Value,
const CGPointerAuthInfo &CurAuth,
const CGPointerAuthInfo &NewAuth) { … }
llvm::Value *CodeGenFunction::emitPointerAuthResign(
llvm::Value *Value, QualType Type, const CGPointerAuthInfo &CurAuthInfo,
const CGPointerAuthInfo &NewAuthInfo, bool IsKnownNonNull) { … }
llvm::Constant *
CodeGenModule::getConstantSignedPointer(llvm::Constant *Pointer, unsigned Key,
llvm::Constant *StorageAddress,
llvm::ConstantInt *OtherDiscriminator) { … }
bool CodeGenModule::shouldSignPointer(const PointerAuthSchema &Schema) { … }
llvm::Constant *CodeGenModule::getConstantSignedPointer(
llvm::Constant *Pointer, const PointerAuthSchema &Schema,
llvm::Constant *StorageAddress, GlobalDecl SchemaDecl,
QualType SchemaType) { … }
llvm::Constant *CodeGenModule::getFunctionPointer(llvm::Constant *Pointer,
QualType FunctionType) { … }
llvm::Constant *CodeGenModule::getFunctionPointer(GlobalDecl GD,
llvm::Type *Ty) { … }
CGPointerAuthInfo CodeGenModule::getMemberFunctionPointerAuthInfo(QualType FT) { … }
llvm::Constant *CodeGenModule::getMemberFunctionPointer(llvm::Constant *Pointer,
QualType FT) { … }
llvm::Constant *CodeGenModule::getMemberFunctionPointer(const FunctionDecl *FD,
llvm::Type *Ty) { … }
std::optional<PointerAuthQualifier>
CodeGenModule::computeVTPointerAuthentication(const CXXRecordDecl *ThisClass) { … }
std::optional<PointerAuthQualifier>
CodeGenModule::getVTablePointerAuthentication(const CXXRecordDecl *Record) { … }
std::optional<CGPointerAuthInfo>
CodeGenModule::getVTablePointerAuthInfo(CodeGenFunction *CGF,
const CXXRecordDecl *Record,
llvm::Value *StorageAddress) { … }
llvm::Value *CodeGenFunction::authPointerToPointerCast(llvm::Value *ResultPtr,
QualType SourceType,
QualType DestType) { … }
Address CodeGenFunction::authPointerToPointerCast(Address Ptr,
QualType SourceType,
QualType DestType) { … }
Address CodeGenFunction::getAsNaturalAddressOf(Address Addr,
QualType PointeeTy) { … }
Address Address::getResignedAddress(const CGPointerAuthInfo &NewInfo,
CodeGenFunction &CGF) const { … }
llvm::Value *Address::emitRawPointerSlow(CodeGenFunction &CGF) const { … }
llvm::Value *LValue::getPointer(CodeGenFunction &CGF) const { … }
llvm::Value *LValue::emitResignedPointer(QualType PointeeTy,
CodeGenFunction &CGF) const { … }
llvm::Value *LValue::emitRawPointer(CodeGenFunction &CGF) const { … }