Merge Clang r202185:
Debug info: Generate debug info for variadic functions. Paired commit with LLVM. rdar://problem/13690847 This merege includes changes to use the Clang 3.4 API (revisions 199686 and 200082) in lib/CodeGen/CGDebugInfo.cpp: getParamType -> getArgType getNumParams -> getNumArgs getReturnType -> getResultType Sponsored by: DARPA, AFRL
This commit is contained in:
parent
f7a2594032
commit
68c01aed8e
@ -760,6 +760,8 @@ llvm::DIType CGDebugInfo::CreateType(const FunctionType *Ty,
|
||||
else if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(Ty)) {
|
||||
for (unsigned i = 0, e = FPT->getNumArgs(); i != e; ++i)
|
||||
EltTys.push_back(getOrCreateType(FPT->getArgType(i), Unit));
|
||||
if (FPT->isVariadic())
|
||||
EltTys.push_back(DBuilder.createUnspecifiedParameter());
|
||||
}
|
||||
|
||||
llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(EltTys);
|
||||
@ -2420,6 +2422,20 @@ llvm::DICompositeType CGDebugInfo::getOrCreateFunctionType(const Decl *D,
|
||||
llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(Elts);
|
||||
return DBuilder.createSubroutineType(F, EltTypeArray);
|
||||
}
|
||||
|
||||
// Variadic function.
|
||||
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
|
||||
if (FD->isVariadic()) {
|
||||
SmallVector<llvm::Value *, 16> EltTys;
|
||||
EltTys.push_back(getOrCreateType(FD->getResultType(), F));
|
||||
if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(FnType))
|
||||
for (unsigned i = 0, e = FPT->getNumArgs(); i != e; ++i)
|
||||
EltTys.push_back(getOrCreateType(FPT->getArgType(i), F));
|
||||
EltTys.push_back(DBuilder.createUnspecifiedParameter());
|
||||
llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(EltTys);
|
||||
return DBuilder.createSubroutineType(F, EltTypeArray);
|
||||
}
|
||||
|
||||
return llvm::DICompositeType(getOrCreateType(FnType, F));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user