[clang] [CIR] Add support for accessing members of base classes (PR #143195)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 6 13:14:35 PDT 2025


================
@@ -1677,6 +1678,34 @@ bool CIRGenModule::verifyModule() const {
   return mlir::verify(theModule).succeeded();
 }
 
+// TODO(cir): this can be shared with LLVM codegen.
+CharUnits CIRGenModule::computeNonVirtualBaseClassOffset(
+    const CXXRecordDecl *derivedClass, CastExpr::path_const_iterator start,
+    CastExpr::path_const_iterator end) {
+  CharUnits offset = CharUnits::Zero();
+
+  const ASTContext &astContext = getASTContext();
+  const CXXRecordDecl *rd = derivedClass;
+
+  for (CastExpr::path_const_iterator i = start; i != end; ++i) {
----------------
erichkeane wrote:

Is there a good reason to not do range-for?

https://github.com/llvm/llvm-project/pull/143195


More information about the cfe-commits mailing list