diff options
author | Pedro Lobo <pedro.lobo@tecnico.ulisboa.pt> | 2025-02-19 09:13:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-19 10:13:37 +0100 |
commit | 4af8c5382e12a74a3c79c573e029d681719a323b (patch) | |
tree | 7da5e8b11502d4d1d91bed623c1dd89d790f68c5 /llvm/lib/Bitcode/Reader/MetadataLoader.cpp | |
parent | 029c8e783d17d55541b308ee6db5429d54cb5153 (diff) | |
download | llvm-4af8c5382e12a74a3c79c573e029d681719a323b.zip llvm-4af8c5382e12a74a3c79c573e029d681719a323b.tar.gz llvm-4af8c5382e12a74a3c79c573e029d681719a323b.tar.bz2 |
[BitcodeReader] Use `poison` instead of `undef` to represent unsupported constexprs in metadata (#127665)
Metadata that references unsupported constant expressions can be
represented with `poison` metadata instead of `undef` metadata.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/MetadataLoader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp index 413d9f68e..f8f5432 100644 --- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp +++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp @@ -1229,13 +1229,13 @@ static Value *getValueFwdRef(BitcodeReaderValueList &ValueList, unsigned Idx, // This is a reference to a no longer supported constant expression. // Pretend that the constant was deleted, which will replace metadata - // references with undef. + // references with poison. // TODO: This is a rather indirect check. It would be more elegant to use // a separate ErrorInfo for constant materialization failure and thread // the error reporting through getValueFwdRef(). if (Idx < ValueList.size() && ValueList[Idx] && ValueList[Idx]->getType() == Ty) - return UndefValue::get(Ty); + return PoisonValue::get(Ty); return nullptr; } |