mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-02 04:39:35 +00:00
Report errors correctly for unselected target intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84193 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0383606b65
commit
11ee508d7b
@ -30,6 +30,7 @@
|
|||||||
#include "llvm/Target/TargetLowering.h"
|
#include "llvm/Target/TargetLowering.h"
|
||||||
#include "llvm/Target/TargetOptions.h"
|
#include "llvm/Target/TargetOptions.h"
|
||||||
#include "llvm/Target/TargetInstrInfo.h"
|
#include "llvm/Target/TargetInstrInfo.h"
|
||||||
|
#include "llvm/Target/TargetIntrinsicInfo.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
@ -5404,14 +5405,16 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const {
|
|||||||
case ISD::EH_RETURN: return "EH_RETURN";
|
case ISD::EH_RETURN: return "EH_RETURN";
|
||||||
case ISD::ConstantPool: return "ConstantPool";
|
case ISD::ConstantPool: return "ConstantPool";
|
||||||
case ISD::ExternalSymbol: return "ExternalSymbol";
|
case ISD::ExternalSymbol: return "ExternalSymbol";
|
||||||
case ISD::INTRINSIC_WO_CHAIN: {
|
case ISD::INTRINSIC_WO_CHAIN:
|
||||||
unsigned IID = cast<ConstantSDNode>(getOperand(0))->getZExtValue();
|
|
||||||
return Intrinsic::getName((Intrinsic::ID)IID);
|
|
||||||
}
|
|
||||||
case ISD::INTRINSIC_VOID:
|
case ISD::INTRINSIC_VOID:
|
||||||
case ISD::INTRINSIC_W_CHAIN: {
|
case ISD::INTRINSIC_W_CHAIN: {
|
||||||
unsigned IID = cast<ConstantSDNode>(getOperand(1))->getZExtValue();
|
unsigned OpNo = getOpcode() == ISD::INTRINSIC_WO_CHAIN ? 0 : 1;
|
||||||
|
unsigned IID = cast<ConstantSDNode>(getOperand(OpNo))->getZExtValue();
|
||||||
|
if (IID < Intrinsic::num_intrinsics)
|
||||||
return Intrinsic::getName((Intrinsic::ID)IID);
|
return Intrinsic::getName((Intrinsic::ID)IID);
|
||||||
|
else if (const TargetIntrinsicInfo *TII = G->getTarget().getIntrinsicInfo())
|
||||||
|
return TII->getName(IID);
|
||||||
|
llvm_unreachable("Invalid intrinsic ID");
|
||||||
}
|
}
|
||||||
|
|
||||||
case ISD::BUILD_VECTOR: return "BUILD_VECTOR";
|
case ISD::BUILD_VECTOR: return "BUILD_VECTOR";
|
||||||
|
@ -584,6 +584,8 @@ public:
|
|||||||
return intrinsic_wo_chain_sdnode;
|
return intrinsic_wo_chain_sdnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool hasTargetIntrinsics() { return !TgtIntrinsics.empty(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ParseNodeInfo();
|
void ParseNodeInfo();
|
||||||
void ParseNodeTransforms();
|
void ParseNodeTransforms();
|
||||||
|
@ -2067,8 +2067,16 @@ void DAGISelEmitter::EmitInstructionSelector(raw_ostream &OS) {
|
|||||||
<< " errs() << \"Cannot yet select: \";\n"
|
<< " errs() << \"Cannot yet select: \";\n"
|
||||||
<< " unsigned iid = cast<ConstantSDNode>(N.getOperand("
|
<< " unsigned iid = cast<ConstantSDNode>(N.getOperand("
|
||||||
<< "N.getOperand(0).getValueType() == MVT::Other))->getZExtValue();\n"
|
<< "N.getOperand(0).getValueType() == MVT::Other))->getZExtValue();\n"
|
||||||
<< " llvm_report_error(\"Cannot yet select: intrinsic %\" +\n"
|
<< " if (iid < Intrinsic::num_intrinsics)\n"
|
||||||
<< "Intrinsic::getName((Intrinsic::ID)iid));\n"
|
<< " llvm_report_error(\"Cannot yet select: intrinsic %\" + "
|
||||||
|
<< "Intrinsic::getName((Intrinsic::ID)iid));\n";
|
||||||
|
if (CGP.hasTargetIntrinsics()) {
|
||||||
|
OS << " else if (const TargetIntrinsicInfo *tii = TM.getIntrinsicInfo())\n"
|
||||||
|
<< " llvm_report_error(Twine(\"Cannot yet select: target intrinsic "
|
||||||
|
<< "%\") + tii->getName(iid));\n";
|
||||||
|
}
|
||||||
|
OS << " else\n"
|
||||||
|
<< " llvm_report_error(\"Cannot yet select: invalid intrinsic\");\n"
|
||||||
<< "}\n\n";
|
<< "}\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user