diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-01-13 18:57:25 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-01-13 18:57:25 +0000 |
commit | 14110477887e3dc168ffc6c191e72d705051f99e (patch) | |
tree | dbb92d800ccd0adbb96c1d29c6d277c432648c11 /lib/CodeGen/CGCXXABI.h | |
parent | c421f546e63b2f85caa1ca0d94d508f99bb871cb (diff) |
Move name mangling support from CodeGen to AST. In the
process, perform a number of refactorings:
- Move MiscNameMangler member functions to MangleContext
- Remove GlobalDecl dependency from MangleContext
- Make MangleContext abstract and move Itanium/Microsoft functionality
to their own classes/files
- Implement ASTContext::createMangleContext and have CodeGen use it
No (intended) functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXXABI.h')
-rw-r--r-- | lib/CodeGen/CGCXXABI.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CodeGen/CGCXXABI.h b/lib/CodeGen/CGCXXABI.h index 56c4ea98ae..8bc1385d7f 100644 --- a/lib/CodeGen/CGCXXABI.h +++ b/lib/CodeGen/CGCXXABI.h @@ -32,18 +32,20 @@ namespace clang { class CXXMethodDecl; class CXXRecordDecl; class FieldDecl; + class MangleContext; namespace CodeGen { class CodeGenFunction; class CodeGenModule; - class MangleContext; /// Implements C++ ABI-specific code generation functions. class CGCXXABI { protected: CodeGenModule &CGM; + llvm::OwningPtr<MangleContext> MangleCtx; - CGCXXABI(CodeGenModule &CGM) : CGM(CGM) {} + CGCXXABI(CodeGenModule &CGM) + : CGM(CGM), MangleCtx(CGM.getContext().createMangleContext()) {} protected: ImplicitParamDecl *&getThisDecl(CodeGenFunction &CGF) { @@ -74,7 +76,9 @@ public: virtual ~CGCXXABI(); /// Gets the mangle context. - virtual MangleContext &getMangleContext() = 0; + MangleContext &getMangleContext() { + return *MangleCtx; + } /// Find the LLVM type used to represent the given member pointer /// type. |