r235326 - DebugInfo: Prepare for deletion of DIScope
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Apr 20 11:32:15 PDT 2015
Author: dexonsmith
Date: Mon Apr 20 13:32:15 2015
New Revision: 235326
URL: http://llvm.org/viewvc/llvm-project?rev=235326&view=rev
Log:
DebugInfo: Prepare for deletion of DIScope
An upcoming LLVM commit will delete `DIScope`, so update users to
`MDScope*`.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.h
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=235326&r1=235325&r2=235326&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Apr 20 13:32:15 2015
@@ -139,7 +139,7 @@ void CGDebugInfo::setLocation(SourceLoca
}
/// 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(AccessSpec
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::getFunct
return llvm::DISubprogram();
// Setup context.
- llvm::DIScope S = getContextDescriptor(cast<Decl>(D->getDeclContext()));
+ auto *S = getContextDescriptor(cast<Decl>(D->getDeclContext()));
auto MI = SPCache.find(FD->getCanonicalDecl());
if (MI == SPCache.end()) {
@@ -3277,9 +3277,9 @@ void CGDebugInfo::EmitGlobalVariable(con
true, Init, getOrCreateStaticDataMemberDeclarationOrNull(VarD)));
}
-llvm::DIScope CGDebugInfo::getCurrentContextDescriptor(const Decl *D) {
+llvm::MDScope *CGDebugInfo::getCurrentContextDescriptor(const Decl *D) {
if (!LexicalBlockStack.empty())
- return cast<llvm::MDScope>(LexicalBlockStack.back());
+ return LexicalBlockStack.back();
return getContextDescriptor(D);
}
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=235326&r1=235325&r2=235326&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Mon Apr 20 13:32:15 2015
@@ -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 *,
More information about the cfe-commits
mailing list