diff options
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.h')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index 5050ca0ad3f..beafd25f9b1 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -125,7 +125,8 @@ class CGDebugInfo { /// 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::TrackingMDRef> DeclCache; - llvm::DenseMap<const NamespaceDecl *, llvm::TrackingMDRef> NameSpaceCache; + typedef std::pair<const NamespaceDecl *, const llvm::DIModule *> NamespaceKey; + llvm::DenseMap<NamespaceKey, llvm::TrackingMDRef> NamespaceCache; llvm::DenseMap<const NamespaceAliasDecl *, llvm::TrackingMDRef> NamespaceAliasCache; llvm::DenseMap<const Decl *, llvm::TypedTrackingMDRef<llvm::DIDerivedType>> @@ -194,8 +195,15 @@ class CGDebugInfo { getOrCreateFunctionType(const Decl *D, QualType FnType, llvm::DIFile *F); /// \return debug info descriptor for vtable. llvm::DIType *getOrCreateVTablePtrType(llvm::DIFile *F); + + /// \return namespace descriptor for the given namespace decl. + /// /// \return namespace descriptor for the given namespace decl. - llvm::DINamespace *getOrCreateNameSpace(const NamespaceDecl *N); + /// \param ParentModule The parent module (or nullptr) of this particular + /// namespace decl. This needs to be passed in because + /// the AST merges namespace decls. + llvm::DINamespace *getOrCreateNamespace(const NamespaceDecl *N, + llvm::DIModule *ParentModule); llvm::DIType *CreatePointerLikeType(llvm::dwarf::Tag Tag, const Type *Ty, QualType PointeeTy, llvm::DIFile *F); llvm::DIType *getOrCreateStructPtrType(StringRef Name, llvm::DIType *&Cache); |