[llvm] [IR] Check parameters of target extension types on construction (PR #107268)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 5 03:57:36 PDT 2024
================
@@ -3530,7 +3530,12 @@ bool LLParser::parseTargetExtType(Type *&Result) {
if (parseToken(lltok::rparen, "expected ')' in target extension type"))
return true;
- Result = TargetExtType::get(Context, TypeName, TypeParams, IntParams);
+ auto TTy =
+ TargetExtType::getOrError(Context, TypeName, TypeParams, IntParams);
+ if (auto E = TTy.takeError())
+ return tokError(toString(std::move(E)));
----------------
jayfoad wrote:
Done, but I don't know how to write a test case for error handling in BitcodeReader.
https://github.com/llvm/llvm-project/pull/107268
More information about the llvm-commits
mailing list