22
22
#include " llvm/CodeGen/MachineRegisterInfo.h"
23
23
#include " llvm/CodeGen/TargetLoweringObjectFileImpl.h"
24
24
#include " llvm/IR/GlobalVariable.h"
25
+ #include " llvm/IR/DiagnosticInfo.h"
25
26
#include " llvm/Support/Debug.h"
26
27
#include " llvm/Support/ErrorHandling.h"
27
28
#include " llvm/Support/MathExtras.h"
@@ -991,6 +992,12 @@ SDValue XtensaTargetLowering::LowerFormalArguments(
991
992
return Chain;
992
993
}
993
994
995
+ static void fail (const SDLoc &DL, SelectionDAG &DAG, const char *Msg) {
996
+ MachineFunction &MF = DAG.getMachineFunction ();
997
+ DAG.getContext ()->diagnose (
998
+ DiagnosticInfoUnsupported (MF.getFunction (), Msg, DL.getDebugLoc ()));
999
+ }
1000
+
994
1001
SDValue
995
1002
XtensaTargetLowering::LowerCall (CallLoweringInfo &CLI,
996
1003
SmallVectorImpl<SDValue> &InVals) const {
@@ -1010,7 +1017,11 @@ XtensaTargetLowering::LowerCall(CallLoweringInfo &CLI,
1010
1017
const TargetFrameLowering *TFL = Subtarget.getFrameLowering ();
1011
1018
1012
1019
// TODO: Support tail call optimization.
1013
- IsTailCall = false ;
1020
+ if (IsTailCall) {
1021
+ if (CLI.CB && CLI.CB ->isMustTailCall ())
1022
+ fail (DL, DAG, " tail call is not implemented" );
1023
+ IsTailCall = false ;
1024
+ }
1014
1025
1015
1026
// Analyze the operands of the call, assigning locations to each operand.
1016
1027
SmallVector<CCValAssign, 16 > ArgLocs;
0 commit comments