]> granicus.if.org Git - clang/commit
[MS ABI] Allow a member pointers' converted type to change
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 26 Jan 2016 19:30:26 +0000 (19:30 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 26 Jan 2016 19:30:26 +0000 (19:30 +0000)
commit202433cccd87a4e7d1e277f80be6b179165bcb8d
tree794ca3cf264b45b2a9b29938357bc0d0fe8fa10c
parent491046d014bcb4c8a260df15e64ea0eb09f91425
[MS ABI] Allow a member pointers' converted type to change

Member pointers in the MS ABI are tricky for a variety of reasons.
The size of a member pointer is indeterminate until the program reaches
a point where the representation is required to be known.  However,
*pointers* to member pointers may exist without knowing the pointee
type's representation.  In these cases, we synthesize an opaque LLVM
type for the pointee type.

However, we can be in a situation where the underlying member pointer's
representation became known mid-way through the program.  To account for
this, we attempted to manicure CodeGen's type-cache so that we can
replace the opaque member pointer type with the real deal while leaving
the pointer types unperturbed.  This, unfortunately, is a problematic
approach to take as we will violate CodeGen's invariants.

These violations are mostly harmless but let's do the right thing
instead: invalidate the type-cache if a member pointer's LLVM
representation changes.

This fixes PR26313.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258839 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/clang/AST/ASTConsumer.h
include/clang/Frontend/MultiplexConsumer.h
lib/CodeGen/CodeGenAction.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
lib/CodeGen/CodeGenTypes.cpp
lib/CodeGen/CodeGenTypes.h
lib/CodeGen/ModuleBuilder.cpp
lib/Frontend/MultiplexConsumer.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaType.cpp
test/CodeGenCXX/microsoft-abi-member-pointers.cpp