From 5be8b939f0dd3f278cab7e3e9c88c1b428e3df52 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Tue, 23 May 2017 21:41:49 +0000 Subject: [PATCH] Sema: allow imaginary constants via GNU extension if UDL overloads not present. C++14 added user-defined literal support for complex numbers so that you can write something like "complex val = 2i". However, there is an existing GNU extension supporting this syntax and interpreting the result as a _Complex type. This changes parsing so that such literals are interpreted in terms of C++14's operators if an overload is present but otherwise falls back to the original GNU extension. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303694 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 57d340c41c3..4c7d980a6a9 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -2394,9 +2394,12 @@ void SelectionDAGBuilder::visitIndirectBr(const IndirectBrInst &I) { } void SelectionDAGBuilder::visitUnreachable(const UnreachableInst &I) { - if (DAG.getTarget().Options.TrapUnreachable) + errs() << "WARNING: trap\n"; + if (DAG.getTarget().Options.TrapUnreachable) { DAG.setRoot( DAG.getNode(ISD::TRAP, getCurSDLoc(), MVT::Other, DAG.getRoot())); + + } } void SelectionDAGBuilder::visitFSub(const User &I) { -- 2.11.0