forked from OSchip/llvm-project
parent
a6002fd920
commit
19329c402f
|
@ -692,7 +692,6 @@ CGDebugInfo::getOrCreateMethodType(const CXXMethodDecl *Method,
|
||||||
Unit);
|
Unit);
|
||||||
|
|
||||||
// Add "this" pointer.
|
// Add "this" pointer.
|
||||||
|
|
||||||
llvm::DIArray Args = llvm::DICompositeType(FnTy).getTypeArray();
|
llvm::DIArray Args = llvm::DICompositeType(FnTy).getTypeArray();
|
||||||
assert (Args.getNumElements() && "Invalid number of arguments!");
|
assert (Args.getNumElements() && "Invalid number of arguments!");
|
||||||
|
|
||||||
|
@ -701,16 +700,15 @@ CGDebugInfo::getOrCreateMethodType(const CXXMethodDecl *Method,
|
||||||
// First element is always return type. For 'void' functions it is NULL.
|
// First element is always return type. For 'void' functions it is NULL.
|
||||||
Elts.push_back(Args.getElement(0));
|
Elts.push_back(Args.getElement(0));
|
||||||
|
|
||||||
if (!Method->isStatic())
|
if (!Method->isStatic()) {
|
||||||
{
|
// "this" pointer is always first argument.
|
||||||
// "this" pointer is always first argument.
|
QualType ThisPtr = Method->getThisType(CGM.getContext());
|
||||||
QualType ThisPtr = Method->getThisType(CGM.getContext());
|
llvm::DIType ThisPtrType =
|
||||||
llvm::DIType ThisPtrType =
|
DBuilder.createArtificialType(getOrCreateType(ThisPtr, Unit));
|
||||||
DBuilder.createArtificialType(getOrCreateType(ThisPtr, Unit));
|
|
||||||
|
|
||||||
TypeCache[ThisPtr.getAsOpaquePtr()] = ThisPtrType;
|
TypeCache[ThisPtr.getAsOpaquePtr()] = ThisPtrType;
|
||||||
Elts.push_back(ThisPtrType);
|
Elts.push_back(ThisPtrType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy rest of the arguments.
|
// Copy rest of the arguments.
|
||||||
for (unsigned i = 1, e = Args.getNumElements(); i != e; ++i)
|
for (unsigned i = 1, e = Args.getNumElements(); i != e; ++i)
|
||||||
|
|
Loading…
Reference in New Issue