diff options
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.h')
-rw-r--r-- | clang/lib/CIR/CodeGen/CIRGenModule.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.h b/clang/lib/CIR/CodeGen/CIRGenModule.h index 073e8d9..2c4c6dd 100644 --- a/clang/lib/CIR/CodeGen/CIRGenModule.h +++ b/clang/lib/CIR/CodeGen/CIRGenModule.h @@ -256,6 +256,24 @@ public: mlir::Attribute getAddrOfRTTIDescriptor(mlir::Location loc, QualType ty, bool forEH = false); + static mlir::SymbolTable::Visibility getMLIRVisibility(Visibility v) { + switch (v) { + case DefaultVisibility: + return mlir::SymbolTable::Visibility::Public; + case HiddenVisibility: + return mlir::SymbolTable::Visibility::Private; + case ProtectedVisibility: + // The distinction between ProtectedVisibility and DefaultVisibility is + // that symbols with ProtectedVisibility, while visible to the dynamic + // linker like DefaultVisibility, are guaranteed to always dynamically + // resolve to a symbol in the current shared object. There is currently no + // equivalent MLIR visibility, so we fall back on the fact that the symbol + // is visible. + return mlir::SymbolTable::Visibility::Public; + } + llvm_unreachable("unknown visibility!"); + } + /// Return a constant array for the given string. mlir::Attribute getConstantArrayFromStringLiteral(const StringLiteral *e); @@ -408,6 +426,13 @@ public: void emitGlobalVarDefinition(const clang::VarDecl *vd, bool isTentative = false); + /// Emit the function that initializes the specified global + void emitCXXGlobalVarDeclInit(const VarDecl *varDecl, cir::GlobalOp addr, + bool performInit); + + void emitCXXGlobalVarDeclInitFunc(const VarDecl *vd, cir::GlobalOp addr, + bool performInit); + void emitGlobalOpenACCDecl(const clang::OpenACCConstructDecl *cd); // C++ related functions. |