diff options
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 6d2123a7b0e..675df309e3f 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -810,10 +810,6 @@ llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) { return DBuilder.createBasicType(BTName, Size, Encoding); } -llvm::DIType *CGDebugInfo::CreateType(const AutoType *Ty) { - return DBuilder.createUnspecifiedType("auto"); -} - llvm::DIType *CGDebugInfo::CreateType(const ComplexType *Ty) { // Bit size and offset of the type. llvm::dwarf::TypeKind Encoding = llvm::dwarf::DW_ATE_complex_float; @@ -1461,18 +1457,16 @@ void CGDebugInfo::CollectRecordFields( llvm::DISubroutineType * CGDebugInfo::getOrCreateMethodType(const CXXMethodDecl *Method, - llvm::DIFile *Unit, bool decl) { + llvm::DIFile *Unit) { const FunctionProtoType *Func = Method->getType()->getAs<FunctionProtoType>(); if (Method->isStatic()) return cast_or_null<llvm::DISubroutineType>( getOrCreateType(QualType(Func, 0), Unit)); - return getOrCreateInstanceMethodType(Method->getThisType(), Func, Unit, decl); + return getOrCreateInstanceMethodType(Method->getThisType(), Func, Unit); } -llvm::DISubroutineType * -CGDebugInfo::getOrCreateInstanceMethodType(QualType ThisPtr, - const FunctionProtoType *Func, - llvm::DIFile *Unit, bool decl) { +llvm::DISubroutineType *CGDebugInfo::getOrCreateInstanceMethodType( + QualType ThisPtr, const FunctionProtoType *Func, llvm::DIFile *Unit) { // Add "this" pointer. llvm::DITypeRefArray Args( cast<llvm::DISubroutineType>(getOrCreateType(QualType(Func, 0), Unit)) @@ -1480,12 +1474,9 @@ CGDebugInfo::getOrCreateInstanceMethodType(QualType ThisPtr, assert(Args.size() && "Invalid number of arguments!"); SmallVector<llvm::Metadata *, 16> Elts; + // First element is always return type. For 'void' functions it is NULL. - QualType temp = Func->getReturnType(); - if (temp->getTypeClass() == Type::Auto && decl) - Elts.push_back(CreateType(cast<AutoType>(temp))); - else - Elts.push_back(Args[0]); + Elts.push_back(Args[0]); // "this" pointer is always first argument. const CXXRecordDecl *RD = ThisPtr->getPointeeCXXRecordDecl(); @@ -1544,7 +1535,7 @@ llvm::DISubprogram *CGDebugInfo::CreateCXXMemberFunction( isa<CXXConstructorDecl>(Method) || isa<CXXDestructorDecl>(Method); StringRef MethodName = getFunctionName(Method); - llvm::DISubroutineType *MethodTy = getOrCreateMethodType(Method, Unit, true); + llvm::DISubroutineType *MethodTy = getOrCreateMethodType(Method, Unit); // Since a single ctor/dtor corresponds to multiple functions, it doesn't // make sense to give a single ctor/dtor a linkage name. @@ -2763,7 +2754,7 @@ llvm::DIType *CGDebugInfo::CreateType(const MemberPointerType *Ty, return DBuilder.createMemberPointerType( getOrCreateInstanceMethodType( CXXMethodDecl::getThisType(FPT, Ty->getMostRecentCXXRecordDecl()), - FPT, U, false), + FPT, U), ClassType, Size, /*Align=*/0, Flags); } @@ -3538,7 +3529,7 @@ llvm::DISubroutineType *CGDebugInfo::getOrCreateFunctionType(const Decl *D, return DBuilder.createSubroutineType(DBuilder.getOrCreateTypeArray(None)); if (const auto *Method = dyn_cast<CXXMethodDecl>(D)) - return getOrCreateMethodType(Method, F, false); + return getOrCreateMethodType(Method, F); const auto *FTy = FnType->getAs<FunctionType>(); CallingConv CC = FTy ? FTy->getCallConv() : CallingConv::CC_C; |