From a0d2b0aa65665ba67a160d90e7ddb27c3c550acd Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 11 Mar 2022 16:48:39 +0100 Subject: [Bitcode] Clarify that extractvalue/insertvalue constexprs are not supported Bitcode currently cannot encode these. Throw a more obvious error in this case, rather than failing an operand count assertion. --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp') diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index ec10994..96f5666 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -2653,6 +2653,10 @@ void ModuleBitcodeWriter::writeConstants(unsigned FirstVal, unsigned LastVal, Record.push_back(VE.getValueID(C->getOperand(1))); Record.push_back(CE->getPredicate()); break; + case Instruction::ExtractValue: + case Instruction::InsertValue: + report_fatal_error("extractvalue/insertvalue constexprs not supported"); + break; } } else if (const BlockAddress *BA = dyn_cast(C)) { Code = bitc::CST_CODE_BLOCKADDRESS; -- cgit v1.1