diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 0ff0b09ee36f03068a448da9601ad5b7df8c9e6e..48fe6687d985dc15e4c737238650a34242d79e02 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -139,7 +139,7 @@ void CGDebugInfo::setLocation(SourceLocation Loc) { } /// getContextDescriptor - Get context info for the decl. -llvm::DIScope CGDebugInfo::getContextDescriptor(const Decl *Context) { +llvm::MDScope *CGDebugInfo::getContextDescriptor(const Decl *Context) { if (!Context) return TheCU; @@ -841,11 +841,11 @@ static unsigned getAccessFlag(AccessSpecifier Access, const RecordDecl *RD) { llvm::DIType CGDebugInfo::createFieldType( StringRef name, QualType type, uint64_t sizeInBitsOverride, SourceLocation loc, AccessSpecifier AS, uint64_t offsetInBits, - llvm::DIFile tunit, llvm::DIScope scope, const RecordDecl *RD) { - llvm::DIType debugType = getOrCreateType(type, tunit); + llvm::MDFile *tunit, llvm::MDScope *scope, const RecordDecl *RD) { + llvm::MDType *debugType = getOrCreateType(type, tunit); // Get the location for the field. - llvm::DIFile file = getOrCreateFile(loc); + llvm::MDFile *file = getOrCreateFile(loc); unsigned line = getLineNumber(loc); uint64_t SizeInBits = 0; @@ -2467,7 +2467,7 @@ llvm::DISubprogram CGDebugInfo::getFunctionDeclaration(const Decl *D) { return llvm::DISubprogram(); // Setup context. - llvm::DIScope S = getContextDescriptor(cast(D->getDeclContext())); + auto *S = getContextDescriptor(cast(D->getDeclContext())); auto MI = SPCache.find(FD->getCanonicalDecl()); if (MI == SPCache.end()) { @@ -3277,9 +3277,9 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, true, Init, getOrCreateStaticDataMemberDeclarationOrNull(VarD))); } -llvm::DIScope CGDebugInfo::getCurrentContextDescriptor(const Decl *D) { +llvm::MDScope *CGDebugInfo::getCurrentContextDescriptor(const Decl *D) { if (!LexicalBlockStack.empty()) - return cast(LexicalBlockStack.back()); + return LexicalBlockStack.back(); return getContextDescriptor(D); } diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index 086ad4fd75fed7ec2fbd64e5be6491dedd6300dc..982afbc8bb4e707d4b16f4f235f8509191c76ab0 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -186,11 +186,9 @@ class CGDebugInfo { llvm::DIType createFieldType(StringRef name, QualType type, uint64_t sizeInBitsOverride, SourceLocation loc, - AccessSpecifier AS, - uint64_t offsetInBits, - llvm::DIFile tunit, - llvm::DIScope scope, - const RecordDecl* RD = nullptr); + AccessSpecifier AS, uint64_t offsetInBits, + llvm::MDFile *tunit, llvm::MDScope *scope, + const RecordDecl *RD = nullptr); // Helpers for collecting fields of a record. void CollectRecordLambdaFields(const CXXRecordDecl *CXXDecl, @@ -320,9 +318,9 @@ private: uint64_t *OffSet); /// \brief Get context info for the decl. - llvm::DIScope getContextDescriptor(const Decl *Decl); + llvm::MDScope *getContextDescriptor(const Decl *Decl); - llvm::DIScope getCurrentContextDescriptor(const Decl *Decl); + llvm::MDScope *getCurrentContextDescriptor(const Decl *Decl); /// \brief Create a forward decl for a RecordType in a given context. llvm::MDCompositeType *getOrCreateRecordFwdDecl(const RecordType *,