diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 99133047..22b2b31 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -609,6 +609,13 @@ private: std::pair<std::unique_ptr<CodeGenFunction>, const TopLevelStmtDecl *> GlobalTopLevelStmtBlockInFlight; + llvm::DenseMap<GlobalDecl, uint16_t> PtrAuthDiscriminatorHashes; + + llvm::DenseMap<const CXXRecordDecl *, std::optional<PointerAuthQualifier>> + VTablePtrAuthInfos; + std::optional<PointerAuthQualifier> + computeVTPointerAuthentication(const CXXRecordDecl *ThisClass); + public: CodeGenModule(ASTContext &C, IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS, const HeaderSearchOptions &headersearchopts, @@ -957,11 +964,33 @@ public: CGPointerAuthInfo getFunctionPointerAuthInfo(QualType T); + bool shouldSignPointer(const PointerAuthSchema &Schema); + llvm::Constant *getConstantSignedPointer(llvm::Constant *Pointer, + const PointerAuthSchema &Schema, + llvm::Constant *StorageAddress, + GlobalDecl SchemaDecl, + QualType SchemaType); + llvm::Constant * getConstantSignedPointer(llvm::Constant *Pointer, unsigned Key, llvm::Constant *StorageAddress, llvm::ConstantInt *OtherDiscriminator); + llvm::ConstantInt * + getPointerAuthOtherDiscriminator(const PointerAuthSchema &Schema, + GlobalDecl SchemaDecl, QualType SchemaType); + + uint16_t getPointerAuthDeclDiscriminator(GlobalDecl GD); + std::optional<CGPointerAuthInfo> + getVTablePointerAuthInfo(CodeGenFunction *Context, + const CXXRecordDecl *Record, + llvm::Value *StorageAddress); + + std::optional<PointerAuthQualifier> + getVTablePointerAuthentication(const CXXRecordDecl *thisClass); + + CGPointerAuthInfo EmitPointerAuthInfo(const RecordDecl *RD); + // Return whether RTTI information should be emitted for this target. bool shouldEmitRTTI(bool ForEH = false) { return (ForEH || getLangOpts().RTTI) && !getLangOpts().CUDAIsDevice && |