diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-01-26 19:30:26 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-01-26 19:30:26 +0000 |
| commit | 202433cccd87a4e7d1e277f80be6b179165bcb8d (patch) | |
| tree | 794ca3cf264b45b2a9b29938357bc0d0fe8fa10c /lib/CodeGen/ModuleBuilder.cpp | |
| parent | 491046d014bcb4c8a260df15e64ea0eb09f91425 (diff) | |
| download | clang-202433cccd87a4e7d1e277f80be6b179165bcb8d.tar.gz | |
[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
Diffstat (limited to 'lib/CodeGen/ModuleBuilder.cpp')
| -rw-r--r-- | lib/CodeGen/ModuleBuilder.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/ModuleBuilder.cpp b/lib/CodeGen/ModuleBuilder.cpp index bce19ab2fd..9428bdf1db 100644 --- a/lib/CodeGen/ModuleBuilder.cpp +++ b/lib/CodeGen/ModuleBuilder.cpp @@ -210,6 +210,13 @@ namespace { Builder->Release(); } + void AssignInheritanceModel(CXXRecordDecl *RD) override { + if (Diags.hasErrorOccurred()) + return; + + Builder->RefreshTypeCacheForClass(RD); + } + void CompleteTentativeDefinition(VarDecl *D) override { if (Diags.hasErrorOccurred()) return; |
