[llvm] [RISCV] Align MCOperandPredicates with AsmParser (PR #146184)

Sudharsan Veeravalli via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 30 22:04:59 PDT 2025


================
@@ -63,12 +63,29 @@ bool MCOperand::evaluateAsConstantImm(int64_t &Imm) const {
 }
 
 bool MCOperand::isBareSymbolRef() const {
-  assert(isExpr() &&
-         "isBareSymbolRef expects only expressions");
+  MCExpr::Spec Specifier;
+  return isSimpleSymbolRef(Specifier) && Specifier == 0;
+}
+
+bool MCOperand::isSimpleSymbolRef(MCExpr::Spec &Specifier) const {
+  assert(isExpr() && "isBareSymbolRef expects only expressions");
----------------
svs-quic wrote:

Do you maybe want to change this to isSimpleSymbolRef?

https://github.com/llvm/llvm-project/pull/146184


More information about the llvm-commits mailing list