diff options
Diffstat (limited to 'include/clang/AST/Mangle.h')
-rw-r--r-- | include/clang/AST/Mangle.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/include/clang/AST/Mangle.h b/include/clang/AST/Mangle.h index b1fbe936136a..5db5c5b977da 100644 --- a/include/clang/AST/Mangle.h +++ b/include/clang/AST/Mangle.h @@ -56,7 +56,7 @@ private: llvm::DenseMap<const BlockDecl*, unsigned> GlobalBlockIds; llvm::DenseMap<const BlockDecl*, unsigned> LocalBlockIds; - llvm::DenseMap<const TagDecl*, uint64_t> AnonStructIds; + llvm::DenseMap<const NamedDecl*, uint64_t> AnonStructIds; public: ManglerKind getKind() const { return Kind; } @@ -82,9 +82,9 @@ public: return Result.first->second; } - uint64_t getAnonymousStructId(const TagDecl *TD) { - std::pair<llvm::DenseMap<const TagDecl *, uint64_t>::iterator, bool> - Result = AnonStructIds.insert(std::make_pair(TD, AnonStructIds.size())); + uint64_t getAnonymousStructId(const NamedDecl *D) { + std::pair<llvm::DenseMap<const NamedDecl *, uint64_t>::iterator, bool> + Result = AnonStructIds.insert(std::make_pair(D, AnonStructIds.size())); return Result.first->second; } @@ -170,6 +170,8 @@ public: virtual void mangleCXXDtorComdat(const CXXDestructorDecl *D, raw_ostream &) = 0; + virtual void mangleLambdaSig(const CXXRecordDecl *Lambda, raw_ostream &) = 0; + static bool classof(const MangleContext *C) { return C->getKind() == MK_Itanium; } @@ -248,8 +250,16 @@ class ASTNameGenerator { public: explicit ASTNameGenerator(ASTContext &Ctx); ~ASTNameGenerator(); + + /// Writes name for \p D to \p OS. + /// \returns true on failure, false on success. bool writeName(const Decl *D, raw_ostream &OS); + + /// \returns name for \p D std::string getName(const Decl *D); + + /// \returns all applicable mangled names. + /// For example C++ constructors/destructors can have multiple. std::vector<std::string> getAllManglings(const Decl *D); private: |