Skip to content

Conversation

@lanza
Copy link
Member

@lanza lanza commented Nov 27, 2025

Stack from ghstack (oldest at bottom):

This patch implements full support for generating non-virtual thunks in
ClangIR to handle C++ multiple inheritance scenarios where the same virtual
function must be accessible through different base class pointers with
different this-pointer offsets.

[ghstack-poisoned]
lanza added a commit that referenced this pull request Nov 27, 2025
This patch implements full support for generating non-virtual thunks in
ClangIR to handle C++ multiple inheritance scenarios where the same virtual
function must be accessible through different base class pointers with
different this-pointer offsets.


ghstack-source-id: 2ff8aae
Pull-Request: #2029
}

if (ShouldXRayInstrumentFunction()) {
if (d && ShouldXRayInstrumentFunction()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this matter?

assert(builder.getInsertionBlock() && "Should be valid");

auto fnEndLoc = getLoc(fd->getBody()->getEndLoc());
auto fnEndLoc = (fd && fd->getBody()) ? getLoc(fd->getBody()->getEndLoc())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These several extra changes on locations don't seem necessary (though probably good to have) and are very distracting

func.setGlobalVisibilityAttr(getGlobalVisibilityAttrFromDecl(decl));
getTargetCIRGenInfo().setTargetAttributes(funcDecl, func, *this);

if (const auto *_ = funcDecl->getAttr<CodeSegAttr>())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should both of these NYI assertions be "assert on missing feature" instead? or not handling them cause horrible miscompilations?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems unnecessary? We need missing feature functionality when the control requires that we can enter a region that requires it and we're just exluding the feature. Both branches here we have never executed in clangir and it's safe to ignore.

assert(!cir::MissingFeatures::ABIArgInfo());
const CIRGenFunctionInfo &callFnInfo = CGM.getTypes().arrangeCXXMethodCall(
callArgs, fpt, RequiredArgs::forPrototypePlus(fpt, 1), prefixArgs);
// assert(callFnInfo.getRegParm() == CurFnInfo->getRegParm() &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the story with these commented pieces?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually just my preference. I prefer leaving extra detail about what we're currently missing if possible.

[ghstack-poisoned]
lanza added a commit that referenced this pull request Dec 3, 2025
This patch implements full support for generating non-virtual thunks in
ClangIR to handle C++ multiple inheritance scenarios where the same virtual
function must be accessible through different base class pointers with
different this-pointer offsets.

ghstack-source-id: 777e0cb
Pull-Request: #2029
lanza added a commit that referenced this pull request Dec 3, 2025
This patch implements full support for generating non-virtual thunks in
ClangIR to handle C++ multiple inheritance scenarios where the same virtual
function must be accessible through different base class pointers with
different this-pointer offsets.

ghstack-source-id: 777e0cb
Pull-Request: #2029
@lanza lanza deleted the branch gh/lanza/19/base December 3, 2025 01:13
@lanza lanza closed this Dec 3, 2025
@lanza lanza deleted the gh/lanza/19/head branch December 3, 2025 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants