Commit 0e90622d by Nicolas Capens Committed by Nicolas Capens

Generate error on unexpected intrisics.

Change-Id: I5a02aee156a64f48baca356f0a5263123f570741 Reviewed-on: https://chromium-review.googlesource.com/399590Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarJim Stichnoth <stichnot@chromium.org>
parent 7638e275
......@@ -4972,6 +4972,9 @@ void TargetARM32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
Type DestTy = (Dest != nullptr) ? Dest->getType() : IceType_void;
Intrinsics::IntrinsicID ID = Instr->getIntrinsicInfo().ID;
switch (ID) {
default:
llvm::report_fatal_error("Unexpected intrinsic");
return;
case Intrinsics::AtomicFence:
case Intrinsics::AtomicFenceAll:
assert(Dest == nullptr);
......
......@@ -4037,6 +4037,9 @@ void TargetMIPS32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
Variable *Dest = Instr->getDest();
Type DestTy = (Dest == nullptr) ? IceType_void : Dest->getType();
switch (Instr->getIntrinsicInfo().ID) {
default:
llvm::report_fatal_error("Unexpected intrinsic");
return;
case Intrinsics::AtomicCmpxchg: {
UnimplementedLoweringError(this, Instr);
return;
......
......@@ -4004,6 +4004,9 @@ template <typename TraitsType>
void TargetX86Base<TraitsType>::lowerIntrinsicCall(
const InstIntrinsicCall *Instr) {
switch (Intrinsics::IntrinsicID ID = Instr->getIntrinsicInfo().ID) {
default:
llvm::report_fatal_error("Unexpected intrinsic");
return;
case Intrinsics::AtomicCmpxchg: {
if (!Intrinsics::isMemoryOrderValid(
ID, getConstantMemoryOrder(Instr->getArg(3)),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment