summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-03-14 08:07:52 +0000
committerpatrick <patrick@openbsd.org>2017-03-14 08:07:52 +0000
commit1cb66ada17adf0954eaadba4d02ec2470365a3ac (patch)
tree521159d8f39562a43fffd680147eb5a71709b9b1 /gnu/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parentMark the sshd_config UsePrivilegeSeparation option as deprecated, (diff)
downloadwireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.tar.xz
wireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.zip
Import LLVM 4.0.0 release including clang and lld.
Diffstat (limited to 'gnu/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--gnu/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/gnu/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/gnu/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 9ca646534e2..996c95bd5f0 100644
--- a/gnu/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/gnu/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -5832,6 +5832,15 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
const Value *SwiftErrorVal = nullptr;
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
+
+ // We can't tail call inside a function with a swifterror argument. Lowering
+ // does not support this yet. It would have to move into the swifterror
+ // register before the call.
+ auto *Caller = CS.getInstruction()->getParent()->getParent();
+ if (TLI.supportSwiftError() &&
+ Caller->getAttributes().hasAttrSomewhere(Attribute::SwiftError))
+ isTailCall = false;
+
for (ImmutableCallSite::arg_iterator i = CS.arg_begin(), e = CS.arg_end();
i != e; ++i) {
const Value *V = *i;