]> granicus.if.org Git - clang/commitdiff
Return a DIDescriptor from CGDebugInfo::getDeclarationOrDefinition...
authorFrederic Riss <friss@apple.com>
Thu, 6 Nov 2014 21:12:06 +0000 (21:12 +0000)
committerFrederic Riss <friss@apple.com>
Thu, 6 Nov 2014 21:12:06 +0000 (21:12 +0000)
... instead of a DIScope that might wrap something that's not actually
a DIScope (eg. a DIGlobalVariable);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221481 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h

index 44428412968f15d51d79977a3437d134eb9d6087..e655f055961aaa83dd944684407b95c984b610cb 100644 (file)
@@ -2307,7 +2307,7 @@ llvm::DIType CGDebugInfo::CreateMemberType(llvm::DIFile Unit, QualType FType,
   return Ty;
 }
 
-llvm::DIScope CGDebugInfo::getDeclarationOrDefinition(const Decl *D) {
+llvm::DIDescriptor CGDebugInfo::getDeclarationOrDefinition(const Decl *D) {
   // We only need a declaration (not a definition) of the type - so use whatever
   // we would otherwise do to get a type for a pointee. (forward declarations in
   // limited debug info, full definitions (if the type definition is available)
@@ -2327,7 +2327,7 @@ llvm::DIScope CGDebugInfo::getDeclarationOrDefinition(const Decl *D) {
   if (I == DeclCache.end())
     return llvm::DIScope();
   llvm::Value *V = I->second;
-  return llvm::DIScope(dyn_cast_or_null<llvm::MDNode>(V));
+  return llvm::DIDescriptor(dyn_cast_or_null<llvm::MDNode>(V));
 }
 
 /// getFunctionDeclaration - Return debug info descriptor to describe method
@@ -3239,7 +3239,7 @@ void CGDebugInfo::EmitUsingDecl(const UsingDecl &UD) {
   // Emitting one decl is sufficient - debuggers can detect that this is an
   // overloaded name & provide lookup for all the overloads.
   const UsingShadowDecl &USD = **UD.shadow_begin();
-  if (llvm::DIScope Target =
+  if (llvm::DIDescriptor Target =
           getDeclarationOrDefinition(USD.getUnderlyingDecl()))
     DBuilder.createImportedDeclaration(
         getCurrentContextDescriptor(cast<Decl>(USD.getDeclContext())), Target,
index f50b89fb996759955e1712a6ce0ad063cd3ac6ad..e8b6ca91e2f4d9f4a4aa859d273ee0ebdc607661 100644 (file)
@@ -363,9 +363,9 @@ private:
   llvm::DIType CreateMemberType(llvm::DIFile Unit, QualType FType,
                                 StringRef Name, uint64_t *Offset);
 
-  /// \brief Retrieve the DIScope, if any, for the canonical form of this
+  /// \brief Retrieve the DIDescriptor, if any, for the canonical form of this
   /// declaration.
-  llvm::DIScope getDeclarationOrDefinition(const Decl *D);
+  llvm::DIDescriptor getDeclarationOrDefinition(const Decl *D);
 
   /// getFunctionDeclaration - Return debug info descriptor to describe method
   /// declaration for the given method definition.