summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-05-20 04:58:53 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-05-20 04:58:53 +0000
commitbd4837665b2ee1e77dc9337e11ee2aed52a00a93 (patch)
treef1524e93f342c3624f7104ec6596b26799c5e822 /clang/lib/CodeGen/CGDebugInfo.h
parent87a594835feacbbc8002a950622952d781ca1cba (diff)
downloadbcm5719-llvm-bd4837665b2ee1e77dc9337e11ee2aed52a00a93.tar.gz
bcm5719-llvm-bd4837665b2ee1e77dc9337e11ee2aed52a00a93.zip
Revert "Revert "Debug Info: Using declarations/DW_TAG_imported_declaration of variables, types, and functions.""
This reverts commit r181947 (git d2990ce56a16050cac0d7937ec9919ff54c6df62 ) This addresses one of the two issues identified in r181947, ensuring that types imported via using declarations only result in a declaration being emitted for the type, not a definition. The second issue (emitting using declarations that are unused) is hopefully an acceptable increase as the real fix for this would be a bit difficult (probably at best we could record which using directives were involved in lookups - but may not have been the result of the lookup). This also ensures that DW_TAG_imported_declarations (& directives) are not emitted in line-tables-only mode as well as ensuring that typedefs only require/emit declarations (rather than definitions) for referenced types. llvm-svn: 182231
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.h')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 853ec2e657f..68fdbd9a8a7 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -36,6 +36,7 @@ namespace clang {
class ObjCIvarDecl;
class ClassTemplateSpecializationDecl;
class GlobalDecl;
+ class UsingDecl;
namespace CodeGen {
class CodeGenModule;
@@ -96,6 +97,9 @@ class CGDebugInfo {
llvm::DenseMap<const char *, llvm::WeakVH> DIFileCache;
llvm::DenseMap<const FunctionDecl *, llvm::WeakVH> SPCache;
+ /// \brief Cache declarations relevant to DW_TAG_imported_declarations (C++
+ /// using declarations) that aren't covered by other more specific caches.
+ llvm::DenseMap<const Decl *, llvm::WeakVH> DeclCache;
llvm::DenseMap<const NamespaceDecl *, llvm::WeakVH> NameSpaceCache;
llvm::DenseMap<const Decl *, llvm::WeakVH> StaticDataMemberCache;
@@ -270,6 +274,9 @@ public:
/// \brief - Emit C++ using directive.
void EmitUsingDirective(const UsingDirectiveDecl &UD);
+ /// \brief - Emit C++ using declaration.
+ void EmitUsingDecl(const UsingDecl &UD);
+
/// getOrCreateRecordType - Emit record type's standalone debug info.
llvm::DIType getOrCreateRecordType(QualType Ty, SourceLocation L);
@@ -291,6 +298,8 @@ private:
/// getContextDescriptor - Get context info for the decl.
llvm::DIScope getContextDescriptor(const Decl *Decl);
+ llvm::DIScope getCurrentContextDescriptor(const Decl *Decl);
+
/// createRecordFwdDecl - Create a forward decl for a RecordType in a given
/// context.
llvm::DIType createRecordFwdDecl(const RecordDecl *, llvm::DIDescriptor);
@@ -334,6 +343,10 @@ private:
llvm::DIType CreateMemberType(llvm::DIFile Unit, QualType FType,
StringRef Name, uint64_t *Offset);
+ /// \brief Retrieve the DIDescriptor, if any, for the canonical form of this
+ /// declaration.
+ llvm::DIDescriptor getDeclarationOrDefinition(const Decl *D);
+
/// getFunctionDeclaration - Return debug info descriptor to describe method
/// declaration for the given method definition.
llvm::DISubprogram getFunctionDeclaration(const Decl *D);
OpenPOWER on IntegriCloud