From fc8d9d9a20906e2ee51796add3798538d653ee74 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 20 Apr 2015 18:32:15 +0000 Subject: [PATCH] DebugInfo: Prepare for deletion of DIScope An upcoming LLVM commit will delete `DIScope`, so update users to `MDScope*`. llvm-svn: 235326 --- clang/lib/CodeGen/CGDebugInfo.cpp | 14 +++++++------- clang/lib/CodeGen/CGDebugInfo.h | 12 +++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 0ff0b09..48fe668 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 086ad4f..982afbc 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 *, -- 2.7.4