diff options
author | Sheng <ox59616e@gmail.com> | 2022-04-11 01:21:15 +0000 |
---|---|---|
committer | Sheng <ox59616e@gmail.com> | 2022-04-11 01:21:15 +0000 |
commit | ba59ec2843f99f19d55d7cd9f9ac536fb038fdab (patch) | |
tree | 316e2e0db25b7fb9a029b90d36dcdb1ad5993cc8 /llvm/utils/TableGen/FixedLenDecoderEmitter.cpp | |
parent | 3c1483609369559ecb6b40c60ca0366759332767 (diff) | |
download | llvm-ba59ec2843f99f19d55d7cd9f9ac536fb038fdab.zip llvm-ba59ec2843f99f19d55d7cd9f9ac536fb038fdab.tar.gz llvm-ba59ec2843f99f19d55d7cd9f9ac536fb038fdab.tar.bz2 |
Fix a misuse of `cast`
`cast` will assert instead of returning null pointer.
Diffstat (limited to 'llvm/utils/TableGen/FixedLenDecoderEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/FixedLenDecoderEmitter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp index bbb5d47..33be554 100644 --- a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp +++ b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp @@ -1970,7 +1970,7 @@ populateInstruction(CodeGenTarget &Target, const Record &EncodingDef, CGI.Operands[SO.first].MIOperandInfo->getNumArgs()) { Init *Arg = CGI.Operands[SO.first].MIOperandInfo-> getArg(SO.second); - if (DefInit *DI = cast<DefInit>(Arg)) + if (DefInit *DI = dyn_cast<DefInit>(Arg)) TypeRecord = DI->getDef(); } |