summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ItaniumMangle.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2016-03-03 06:39:32 +0000
committerJohn McCall <rjmccall@apple.com>2016-03-03 06:39:32 +0000
commit477f2bb0d53c070d63f992d15000575154fcd586 (patch)
tree65fd844b20fbb6c46c1424fe808246f69fa3d209 /clang/lib/AST/ItaniumMangle.cpp
parenteb3413e43a88264494cbf8404c253b622fcb195d (diff)
downloadbcm5719-llvm-477f2bb0d53c070d63f992d15000575154fcd586.tar.gz
bcm5719-llvm-477f2bb0d53c070d63f992d15000575154fcd586.zip
Semantic analysis for the swiftcall calling convention.
I've tried to keep the infrastructure behind parameter ABI treatments fairly general. llvm-svn: 262587
Diffstat (limited to 'clang/lib/AST/ItaniumMangle.cpp')
-rw-r--r--clang/lib/AST/ItaniumMangle.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index 71c94104ccc..5e079960ae1 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/lib/AST/ItaniumMangle.cpp
@@ -2167,6 +2167,9 @@ StringRef CXXNameMangler::getCallingConvQualifierName(CallingConv CC) {
case CC_SpirKernel:
// FIXME: we should be mangling all of the above.
return "";
+
+ case CC_Swift:
+ return "swiftcall";
}
llvm_unreachable("bad calling convention");
}
@@ -2195,8 +2198,20 @@ CXXNameMangler::mangleExtParameterInfo(FunctionProtoType::ExtParameterInfo PI) {
// Note that these are *not* substitution candidates. Demanglers might
// have trouble with this if the parameter type is fully substituted.
+ switch (PI.getABI()) {
+ case ParameterABI::Ordinary:
+ break;
+
+ // All of these start with "swift", so they come before "ns_consumed".
+ case ParameterABI::SwiftContext:
+ case ParameterABI::SwiftErrorResult:
+ case ParameterABI::SwiftIndirectResult:
+ mangleVendorQualifier(getParameterABISpelling(PI.getABI()));
+ break;
+ }
+
if (PI.isConsumed())
- Out << "U11ns_consumed";
+ mangleVendorQualifier("ns_consumed");
}
// <type> ::= <function-type>
OpenPOWER on IntegriCloud