summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@google.com>2016-02-12 22:56:03 +0000
committerDerek Schuff <dschuff@google.com>2016-02-12 22:56:03 +0000
commit51699a83cd54680d82b5c0926a22ac7a41354b54 (patch)
tree277f012f167752a20973d43b1e3567f41df3adaf /llvm/lib
parent7793ddb0432c9fa2637066387d4716ee2d866555 (diff)
downloadbcm5719-llvm-51699a83cd54680d82b5c0926a22ac7a41354b54.tar.gz
bcm5719-llvm-51699a83cd54680d82b5c0926a22ac7a41354b54.zip
[WebAssembly] Report more meaningful error messages for some unsupported
ops. Computed gotos and RETURNADDR may never be supported; we can do FRAMEADDR in the future. llvm-svn: 260759
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp13
-rw-r--r--llvm/lib/Target/WebAssembly/known_gcc_test_failures.txt8
2 files changed, 17 insertions, 4 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
index 7d63d89f17e..436494efd23 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -61,6 +61,8 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering(
setOperationAction(ISD::GlobalAddress, MVTPtr, Custom);
setOperationAction(ISD::ExternalSymbol, MVTPtr, Custom);
setOperationAction(ISD::JumpTable, MVTPtr, Custom);
+ setOperationAction(ISD::BlockAddress, MVTPtr, Custom);
+ setOperationAction(ISD::BRIND, MVT::Other, Custom);
// Take the default expansion for va_arg, va_copy, and va_end. There is no
// default action for va_start, so we do that custom.
@@ -515,6 +517,7 @@ SDValue WebAssemblyTargetLowering::LowerFormalArguments(
SDValue WebAssemblyTargetLowering::LowerOperation(SDValue Op,
SelectionDAG &DAG) const {
+ SDLoc DL(Op);
switch (Op.getOpcode()) {
default:
llvm_unreachable("unimplemented operation lowering");
@@ -531,6 +534,16 @@ SDValue WebAssemblyTargetLowering::LowerOperation(SDValue Op,
return LowerBR_JT(Op, DAG);
case ISD::VASTART:
return LowerVASTART(Op, DAG);
+ case ISD::BlockAddress:
+ case ISD::BRIND:
+ fail(DL, DAG, "WebAssembly hasn't implemented computed gotos");
+ return SDValue();
+ case ISD::RETURNADDR: // Probably nothing meaningful can be returned here.
+ fail(DL, DAG, "WebAssembly hasn't implemented __builtin_return_address");
+ return SDValue();
+ case ISD::FRAMEADDR: // TODO: Make this return the userspace frame address
+ fail(DL, DAG, "WebAssembly hasn't implemented __builtin_frame_address");
+ return SDValue();
}
}
diff --git a/llvm/lib/Target/WebAssembly/known_gcc_test_failures.txt b/llvm/lib/Target/WebAssembly/known_gcc_test_failures.txt
index 76ca4cf6b0c..108ba6a8f3a 100644
--- a/llvm/lib/Target/WebAssembly/known_gcc_test_failures.txt
+++ b/llvm/lib/Target/WebAssembly/known_gcc_test_failures.txt
@@ -54,22 +54,22 @@ pr38151.c
pr28982b.c
-# Cannot select brind.
+# Computed gotos are not supported (Cannot select BlockAddress/BRIND)
20040302-1.c
20071210-1.c
920501-4.c
920501-5.c
-
-# Cannot select BlockAddress.
comp-goto-1.c
980526-1.c
990208-1.c
-# unimplemented operation lowering.
+# WebAssembly hasn't implemented (will never?) __builtin_return_address
20010122-1.c
20030323-1.c
20030811-1.c
pr17377.c
+
+# WebAssembly hasn't implemented __builtin_frame_address
frame-address.c
# Error: invalid output constraint '=t' in asm.
OpenPOWER on IntegriCloud