This is an archive of the discontinued LLVM Phabricator instance.

Fix address space for function types with AS qualifier
ClosedPublic

Authored by eandrews on Feb 4 2022, 4:07 PM.

Details

Summary

This patch fixes a bug introduced in commit 4eaf5846d0e7 - https://reviews.llvm.org/D111566

Commit 4eaf5846d0e7 sets address space of function type as program address space unconditionally. This breaks types which have address space qualifiers. E.g. __ptr32.

This patch fixes the bug by using address space qualifiers if present.

Diff Detail

Event Timeline

eandrews requested review of this revision.Feb 4 2022, 4:07 PM
eandrews created this revision.
aaron.ballman accepted this revision.Feb 7 2022, 11:49 AM
aaron.ballman added a subscriber: aaron.ballman.

LGTM aside from some nits

clang/lib/AST/ASTContext.cpp
11962–11969

How about something like that?

clang/test/CodeGen/address-space-ptr32.c
4
This revision is now accepted and ready to land.Feb 7 2022, 11:49 AM
This revision was landed with ongoing or failed builds.Feb 7 2022, 12:54 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2022, 12:54 PM

LGTM aside from some nits

Thanks! Fixed the nits in commit.