[PATCH] D41610: [X86] Implementation of X86Operand::print
Andrew V. Tischenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 9 08:30:03 PST 2018
avt77 added inline comments.
================
Comment at: lib/Target/X86/AsmParser/X86Operand.h:107
+ } else {
+ assert(Val->getKind() == MCExpr::SymbolRef);
+ const MCSymbolRefExpr &SRE = cast<MCSymbolRefExpr>(*Val);
----------------
RKSimon wrote:
> Add an assert message
Maybe it's better something like (instead of assertion):
if (const MCSymbolRefExpr &SRE = dyn_cast<MCSymbolRefExpr>(*Val)) {
const MCSymbol &Sym = SRE.getSymbol();
if (auto SymName = Sym.getName().data())
......
to be sure it can't raise exception?
https://reviews.llvm.org/D41610
More information about the llvm-commits
mailing list