diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-08-16 21:57:06 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-08-16 21:57:06 +0000 |
commit | 91c9867049393af7027c21e9b03365130690b8ce (patch) | |
tree | ad2c815e3263be2cd60aef8d55e15a75a8722a9f /clang/tools/libclang/IndexingContext.h | |
parent | 04a452b712929122aadb121d9f94e330202a63cf (diff) | |
download | bcm5719-llvm-91c9867049393af7027c21e9b03365130690b8ce.tar.gz bcm5719-llvm-91c9867049393af7027c21e9b03365130690b8ce.zip |
Replace some DenseMap keys with simpler structures that don't need another DenseMapInfo specialization.
llvm-svn: 188580
Diffstat (limited to 'clang/tools/libclang/IndexingContext.h')
-rw-r--r-- | clang/tools/libclang/IndexingContext.h | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/clang/tools/libclang/IndexingContext.h b/clang/tools/libclang/IndexingContext.h index 62873bedb27..3437d55f014 100644 --- a/clang/tools/libclang/IndexingContext.h +++ b/clang/tools/libclang/IndexingContext.h @@ -270,14 +270,6 @@ public: } }; -struct RefFileOccurence { - const FileEntry *File; - const Decl *Dcl; - - RefFileOccurence(const FileEntry *File, const Decl *Dcl) - : File(File), Dcl(Dcl) { } -}; - class IndexingContext { ASTContext *Ctx; CXClientData ClientData; @@ -294,6 +286,7 @@ class IndexingContext { ContainerMapTy ContainerMap; EntityMapTy EntityMap; + typedef std::pair<const FileEntry *, const Decl *> RefFileOccurence; llvm::DenseSet<RefFileOccurence> RefFileOccurences; std::deque<DeclGroupRef> TUDeclsInObjCContainer; @@ -524,29 +517,3 @@ inline T *ScratchAlloc::allocate() { } }} // end clang::cxindex - -namespace llvm { - /// Define DenseMapInfo so that FileID's can be used as keys in DenseMap and - /// DenseSets. - template <> - struct DenseMapInfo<clang::cxindex::RefFileOccurence> { - static inline clang::cxindex::RefFileOccurence getEmptyKey() { - return clang::cxindex::RefFileOccurence(0, 0); - } - - static inline clang::cxindex::RefFileOccurence getTombstoneKey() { - return clang::cxindex::RefFileOccurence((const clang::FileEntry *)~0, - (const clang::Decl *)~0); - } - - static unsigned getHashValue(clang::cxindex::RefFileOccurence S) { - typedef std::pair<const clang::FileEntry *, const clang::Decl *> PairTy; - return DenseMapInfo<PairTy>::getHashValue(PairTy(S.File, S.Dcl)); - } - - static bool isEqual(clang::cxindex::RefFileOccurence LHS, - clang::cxindex::RefFileOccurence RHS) { - return LHS.File == RHS.File && LHS.Dcl == RHS.Dcl; - } - }; -} |