diff options
author | John McCall <rjmccall@apple.com> | 2013-01-25 22:30:49 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2013-01-25 22:30:49 +0000 |
commit | b8b2c9da87e7d70a1679db026f40548b3192b705 (patch) | |
tree | faa4fbe6a64798098a71a21c89b2efc392f393e5 /lib/AST/ASTContext.cpp | |
parent | d07865b42dcb32154c75134fded51b38cc55a0c4 (diff) |
First pass at abstracting out a class for the target C++ ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173514 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index fff2f82e23..b5d60f589b 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -583,12 +583,13 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( CXXABI *ASTContext::createCXXABI(const TargetInfo &T) { if (!LangOpts.CPlusPlus) return 0; - switch (T.getCXXABI()) { - case CXXABI_ARM: + switch (T.getCXXABI().getKind()) { + case TargetCXXABI::GenericARM: + case TargetCXXABI::iOS: return CreateARMCXXABI(*this); - case CXXABI_Itanium: + case TargetCXXABI::GenericItanium: return CreateItaniumCXXABI(*this); - case CXXABI_Microsoft: + case TargetCXXABI::Microsoft: return CreateMicrosoftCXXABI(*this); } llvm_unreachable("Invalid CXXABI type!"); @@ -7607,7 +7608,8 @@ CallingConv ASTContext::getDefaultCXXMethodCallConv(bool isVariadic) { } CallingConv ASTContext::getCanonicalCallConv(CallingConv CC) const { - if (CC == CC_C && !LangOpts.MRTD && getTargetInfo().getCXXABI() != CXXABI_Microsoft) + if (CC == CC_C && !LangOpts.MRTD && + getTargetInfo().getCXXABI().isMemberFunctionCCDefault()) return CC_Default; return CC; } @@ -7618,11 +7620,12 @@ bool ASTContext::isNearlyEmpty(const CXXRecordDecl *RD) const { } MangleContext *ASTContext::createMangleContext() { - switch (Target->getCXXABI()) { - case CXXABI_ARM: - case CXXABI_Itanium: + switch (Target->getCXXABI().getKind()) { + case TargetCXXABI::GenericItanium: + case TargetCXXABI::GenericARM: + case TargetCXXABI::iOS: return createItaniumMangleContext(*this, getDiagnostics()); - case CXXABI_Microsoft: + case TargetCXXABI::Microsoft: return createMicrosoftMangleContext(*this, getDiagnostics()); } llvm_unreachable("Unsupported ABI"); |