diff options
author | Frederic Riss <friss@apple.com> | 2014-11-06 21:12:06 +0000 |
---|---|---|
committer | Frederic Riss <friss@apple.com> | 2014-11-06 21:12:06 +0000 |
commit | 442293e83f045d699a7ad733740f47880ba98bed (patch) | |
tree | 53db661c4504fa674e22778fce1175b4855c0bd8 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | b7a4505a3f3398ee4832f337c2a117476af58665 (diff) | |
download | bcm5719-llvm-442293e83f045d699a7ad733740f47880ba98bed.tar.gz bcm5719-llvm-442293e83f045d699a7ad733740f47880ba98bed.zip |
Return a DIDescriptor from CGDebugInfo::getDeclarationOrDefinition...
... instead of a DIScope that might wrap something that's not actually
a DIScope (eg. a DIGlobalVariable);
llvm-svn: 221481
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 44428412968..e655f055961 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -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, |