23
23
#include " llvm/CodeGen/MachineJumpTableInfo.h"
24
24
#include " llvm/CodeGen/MachineRegisterInfo.h"
25
25
#include " llvm/CodeGen/TargetLoweringObjectFileImpl.h"
26
+ #include " llvm/IR/DiagnosticInfo.h"
26
27
#include " llvm/Support/Debug.h"
27
28
#include " llvm/Support/ErrorHandling.h"
28
29
#include " llvm/Support/raw_ostream.h"
@@ -1044,6 +1045,12 @@ SDValue XtensaTargetLowering::getAddrPCRel(SDValue Op,
1044
1045
return DAG.getNode (XtensaISD::PCREL_WRAPPER, DL, Ty, Op);
1045
1046
}
1046
1047
1048
+ static void fail (const SDLoc &DL, SelectionDAG &DAG, const char *Msg) {
1049
+ MachineFunction &MF = DAG.getMachineFunction ();
1050
+ DAG.getContext ()->diagnose (
1051
+ DiagnosticInfoUnsupported (MF.getFunction (), Msg, DL.getDebugLoc ()));
1052
+ }
1053
+
1047
1054
SDValue
1048
1055
XtensaTargetLowering::LowerCall (CallLoweringInfo &CLI,
1049
1056
SmallVectorImpl<SDValue> &InVals) const {
@@ -1063,7 +1070,11 @@ XtensaTargetLowering::LowerCall(CallLoweringInfo &CLI,
1063
1070
const TargetFrameLowering *TFL = Subtarget.getFrameLowering ();
1064
1071
1065
1072
// TODO: Support tail call optimization.
1066
- IsTailCall = false ;
1073
+ if (IsTailCall) {
1074
+ if (CLI.CB && CLI.CB ->isMustTailCall ())
1075
+ fail (DL, DAG, " tail call is not implemented" );
1076
+ IsTailCall = false ;
1077
+ }
1067
1078
1068
1079
// Analyze the operands of the call, assigning locations to each operand.
1069
1080
SmallVector<CCValAssign, 16 > ArgLocs;
0 commit comments