Adding PoisonValue for representing poison value explicitly in IR
Define ConstantData::PoisonValue. Add support for poison value to LLLexer/LLParser/BitcodeReader/BitcodeWriter. Add support for poison value to llvm-c interface. Add support for poison value to OCaml binding. Add m_Poison in PatternMatch. Differential Revision: https://reviews.llvm.org/D71126
This commit is contained in:
@@ -2425,6 +2425,8 @@ void ModuleBitcodeWriter::writeConstants(unsigned FirstVal, unsigned LastVal,
|
||||
unsigned AbbrevToUse = 0;
|
||||
if (C->isNullValue()) {
|
||||
Code = bitc::CST_CODE_NULL;
|
||||
} else if (isa<PoisonValue>(C)) {
|
||||
Code = bitc::CST_CODE_POISON;
|
||||
} else if (isa<UndefValue>(C)) {
|
||||
Code = bitc::CST_CODE_UNDEF;
|
||||
} else if (const ConstantInt *IV = dyn_cast<ConstantInt>(C)) {
|
||||
|
||||
Reference in New Issue
Block a user