[llvm] [IR] Check parameters of target extension types on construction (PR #107268)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 5 02:54:18 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)));
----------------
nikic wrote:
Would be good to do this in BitcodeReader as well.
https://github.com/llvm/llvm-project/pull/107268
More information about the llvm-commits
mailing list