Page MenuHomePhabricator

[OpaquePtr] Track pointee types in Clang
Needs ReviewPublic

Authored by aeubanks on Tue, Jun 1, 9:04 AM.

Details

Reviewers
dblaikie
rsmith
Summary

With pointee types going away in llvm::PointerType, the frontend needs
to keep track of pointee types.

Add a PointeeType to Address and LValue.

Diff Detail

Unit TestsFailed

TimeTest
160 msx64 windows > Clang-Unit.CodeGen/_/ClangCodeGenTests_exe::BufferSourceTest.EmitCXXGlobalInitFunc
Script: -- C:\ws\w5\llvm-project\premerge-checks\build\tools\clang\unittests\CodeGen\.\ClangCodeGenTests.exe --gtest_filter=BufferSourceTest.EmitCXXGlobalInitFunc
180 msx64 windows > Clang-Unit.CodeGen/_/ClangCodeGenTests_exe::TBAAMetadataTest.ArrayFields
Script: -- C:\ws\w5\llvm-project\premerge-checks\build\tools\clang\unittests\CodeGen\.\ClangCodeGenTests.exe --gtest_filter=TBAAMetadataTest.ArrayFields
180 msx64 windows > Clang-Unit.CodeGen/_/ClangCodeGenTests_exe::TBAAMetadataTest.BaseClass
Script: -- C:\ws\w5\llvm-project\premerge-checks\build\tools\clang\unittests\CodeGen\.\ClangCodeGenTests.exe --gtest_filter=TBAAMetadataTest.BaseClass
130 msx64 windows > Clang-Unit.CodeGen/_/ClangCodeGenTests_exe::TBAAMetadataTest.BasicTypes
Script: -- C:\ws\w5\llvm-project\premerge-checks\build\tools\clang\unittests\CodeGen\.\ClangCodeGenTests.exe --gtest_filter=TBAAMetadataTest.BasicTypes
170 msx64 windows > Clang-Unit.CodeGen/_/ClangCodeGenTests_exe::TBAAMetadataTest.CFields
Script: -- C:\ws\w5\llvm-project\premerge-checks\build\tools\clang\unittests\CodeGen\.\ClangCodeGenTests.exe --gtest_filter=TBAAMetadataTest.CFields
View Full Test Results (3,172 Failed)

Event Timeline

aeubanks created this revision.Tue, Jun 1, 9:04 AM
aeubanks published this revision for review.Tue, Jun 1, 9:04 AM
aeubanks added reviewers: dblaikie, rsmith.

This is definitely WIP, but I'd like to make sure that this is the right direction before continuing. And are there any other obvious places that also require this?

Herald added a project: Restricted Project. · View Herald TranscriptTue, Jun 1, 9:06 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

The changes look like the right direction to me - though I don't know/couldn't confirm whether more changes will be needed in other places.

clang/lib/CodeGen/Address.h
29–30

At some point will this include an assertion that 'pointer' isn't a PointerType? I guess some uses of PointerTyped values won't need to know their pointee type?

(or are all values in Address PointerTyped? (owing to them being "addresses"))?

56–57

hey, someone wrote a handy comment here - could possibly delete this comment now that that reality has come to pass

clang/lib/CodeGen/CGExpr.cpp
159

Could potentially pull these sort of changes out as a separate patch/commit without pre-commit review, since they rely on the existing API.

clang/lib/CodeGen/CGValue.h
230–231

Maybe this could use some assertions added to check the PointeeType is correct?