diff options
author | Anders Carlsson <andersca@mac.com> | 2009-10-07 01:06:45 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-10-07 01:06:45 +0000 |
commit | b540491851910c2efa68196a8bdc2eed1071c17d (patch) | |
tree | 4b447bf47fdeef16f02a2ca43dcd60828af668a3 /lib/CodeGen/Mangle.h | |
parent | 3d92d8c94e9447a6d903241e180590b4025c5927 (diff) |
Add a MangleContext and pass it to all mangle functions. It will be used for keeping state, such as identifiers assigned to anonymous structs as well as scope encoding.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.h')
-rw-r--r-- | lib/CodeGen/Mangle.h | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/lib/CodeGen/Mangle.h b/lib/CodeGen/Mangle.h index 91143a5c4b..8ab5d5edf3 100644 --- a/lib/CodeGen/Mangle.h +++ b/lib/CodeGen/Mangle.h @@ -33,21 +33,31 @@ namespace clang { class NamedDecl; class VarDecl; - bool mangleName(const NamedDecl *D, ASTContext &Context, + class MangleContext { + ASTContext &Context; + public: + explicit MangleContext(ASTContext &Context) + : Context(Context) { } + + ASTContext &getASTContext() const { return Context; } + }; + + bool mangleName(MangleContext &Context, const NamedDecl *D, llvm::raw_ostream &os); - void mangleThunk(const FunctionDecl *FD, int64_t n, int64_t vn, - ASTContext &Context, llvm::raw_ostream &os); - void mangleCovariantThunk(const FunctionDecl *FD, int64_t nv_t, int64_t v_t, - int64_t nv_r, int64_t v_r, ASTContext &Context, + void mangleThunk(MangleContext &Context, const FunctionDecl *FD, + int64_t n, int64_t vn, llvm::raw_ostream &os); + void mangleCovariantThunk(MangleContext &Context, const FunctionDecl *FD, + int64_t nv_t, int64_t v_t, + int64_t nv_r, int64_t v_r, llvm::raw_ostream &os); - void mangleGuardVariable(const VarDecl *D, ASTContext &Context, + void mangleGuardVariable(MangleContext &Context, const VarDecl *D, llvm::raw_ostream &os); - void mangleCXXVtable(QualType T, ASTContext &Context, llvm::raw_ostream &os); - void mangleCXXRtti(QualType T, ASTContext &Context, llvm::raw_ostream &os); - void mangleCXXCtor(const CXXConstructorDecl *D, CXXCtorType Type, - ASTContext &Context, llvm::raw_ostream &os); - void mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type, - ASTContext &Context, llvm::raw_ostream &os); + void mangleCXXVtable(MangleContext &Context, QualType T, llvm::raw_ostream &os); + void mangleCXXRtti(MangleContext &Context, QualType T, llvm::raw_ostream &os); + void mangleCXXCtor(MangleContext &Context, const CXXConstructorDecl *D, + CXXCtorType Type, llvm::raw_ostream &os); + void mangleCXXDtor(MangleContext &Context, const CXXDestructorDecl *D, + CXXDtorType Type, llvm::raw_ostream &os); } #endif |