Skip to content

Commit aaec5a6

Browse files
AmrDevelopermahesh-attarde
authored andcommitted
[CIR] Upstream RTTI Builder & RTTI for VTable Definitions (llvm#160002)
Upstream the RTTI builder with helpers and used them in the VTable Definitions Issue llvm#154992
1 parent 87be6a1 commit aaec5a6

File tree

10 files changed

+1633
-421
lines changed

10 files changed

+1633
-421
lines changed

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ struct MissingFeatures {
3737
static bool opGlobalDLLImportExport() { return false; }
3838
static bool opGlobalPartition() { return false; }
3939
static bool opGlobalUsedOrCompilerUsed() { return false; }
40+
static bool setDSOLocal() { return false; }
41+
static bool setComdat() { return false; }
4042

4143
static bool supportIFuncAttr() { return false; }
4244
static bool supportVisibility() { return false; }

clang/lib/CIR/CodeGen/CIRGenBuilder.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
8989
return cir::ConstRecordAttr::get(sTy, arrayAttr);
9090
}
9191

92+
cir::TypeInfoAttr getTypeInfo(mlir::ArrayAttr fieldsAttr) {
93+
cir::ConstRecordAttr anonRecord = getAnonConstRecord(fieldsAttr);
94+
return cir::TypeInfoAttr::get(anonRecord.getType(), fieldsAttr);
95+
}
96+
9297
std::string getUniqueAnonRecordName() { return getUniqueRecordName("anon"); }
9398

9499
std::string getUniqueRecordName(const std::string &baseName) {

clang/lib/CIR/CodeGen/CIRGenCXXABI.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ class CIRGenCXXABI {
114114

115115
virtual void emitRethrow(CIRGenFunction &cgf, bool isNoReturn) = 0;
116116

117+
virtual mlir::Attribute getAddrOfRTTIDescriptor(mlir::Location loc,
118+
QualType ty) = 0;
119+
117120
/// Get the type of the implicit "this" parameter used by a method. May return
118121
/// zero if no specific type is applicable, e.g. if the ABI expects the "this"
119122
/// parameter to point to some artificial offset in a complete object due to

0 commit comments

Comments
 (0)