[PATCH] D64834: [Xtensa 8/10] Add support of the Xtensa shift/load/store/move and processor control instructions.
Sergei Barannikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 20 02:36:53 PST 2022
barannikov88 added inline comments.
================
Comment at: llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp:154
+ return isImm(0, 60) &&
+ ((dyn_cast<MCConstantExpr>(getImm())->getValue() & 0x3) == 0);
+ }
----------------
use `cast<>` here and below. `dyn_cast` is for the cases when the result is allowed to be nullptr.
================
Comment at: llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp:407
+ return MatchOperand_NoMatch;
+ RegName = StringRef(std::to_string(getLexer().getTok().getIntVal()));
+ break;
----------------
Bug: `std::string` termporary is destroyed at ';' and RegName references freed memory.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64834/new/
https://reviews.llvm.org/D64834
More information about the llvm-commits
mailing list