forked from OSchip/llvm-project
[CodeGen] Add param info for ctors with ABI args.
This fixes a few assertion failures. Please see the added test case. llvm-svn: 295894
This commit is contained in:
parent
db56e5a89a
commit
75b34a9610
|
@ -288,7 +288,17 @@ CodeGenTypes::arrangeCXXStructorDeclaration(const CXXMethodDecl *MD,
|
|||
if (PassParams)
|
||||
appendParameterTypes(*this, argTypes, paramInfos, FTP, MD);
|
||||
|
||||
TheCXXABI.buildStructorSignature(MD, Type, argTypes);
|
||||
CGCXXABI::AddedStructorArgs AddedArgs =
|
||||
TheCXXABI.buildStructorSignature(MD, Type, argTypes);
|
||||
if (!paramInfos.empty()) {
|
||||
// Note: prefix implies after the first param.
|
||||
if (AddedArgs.Prefix)
|
||||
paramInfos.insert(paramInfos.begin() + 1, AddedArgs.Prefix,
|
||||
FunctionProtoType::ExtParameterInfo{});
|
||||
if (AddedArgs.Suffix)
|
||||
paramInfos.append(AddedArgs.Suffix,
|
||||
FunctionProtoType::ExtParameterInfo{});
|
||||
}
|
||||
|
||||
RequiredArgs required =
|
||||
(PassParams && MD->isVariadic() ? RequiredArgs(argTypes.size())
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
// RUN: %clang_cc1 -triple x86_64-apple -emit-llvm -fobjc-arc -o - %s
|
||||
// RUN: %clang_cc1 -triple x86_64-windows -emit-llvm -fobjc-arc -o - %s
|
||||
//
|
||||
// Test caess where we weren't properly adding parameter infos declarations,
|
||||
// which caused assertions to fire. Hence, no CHECKs.
|
||||
|
||||
struct VirtualBase {
|
||||
VirtualBase(__attribute__((ns_consumed)) id x);
|
||||
};
|
||||
struct WithVirtualBase : virtual VirtualBase {
|
||||
WithVirtualBase(__attribute__((ns_consumed)) id x);
|
||||
};
|
||||
|
||||
WithVirtualBase::WithVirtualBase(__attribute__((ns_consumed)) id x)
|
||||
: VirtualBase(x) {}
|
Loading…
Reference in New Issue