diff options
author | Tim Northover <tnorthover@apple.com> | 2017-05-23 21:41:49 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2017-05-23 21:41:49 +0000 |
commit | 6b5eceac2e1cb21826aec1d800f8c890a54b4d6b (patch) | |
tree | a30ed079a5cf50b326661ac32e4911e39d1f8b55 /llvm/lib/CodeGen | |
parent | 26450bf5794da92518261e802e10bd5195fe5754 (diff) | |
download | bcm5719-llvm-6b5eceac2e1cb21826aec1d800f8c890a54b4d6b.tar.gz bcm5719-llvm-6b5eceac2e1cb21826aec1d800f8c890a54b4d6b.zip |
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<double> 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.
llvm-svn: 303694
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 57d340c41c3..4c7d980a6a9 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/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) { |