[PATCH] D88625: MCExpr::evaluateAsRelocatableImpl : allow evaluation of non-VK_None MCSymbolRefExpr when MCAsmLayout is available

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 16:38:56 PST 2020


MaskRay added inline comments.


================
Comment at: llvm/lib/MC/MCExpr.cpp:816
+          if (Res.getRefKind() != MCSymbolRefExpr::VK_None || !Res.getSymA() ||
+              Res.getSymB() || Res.getConstant())
+            return false;
----------------
I cannot test `Res.getSymB` in the conditions because (1) `foo - bar` can result into an early error (2) `foo + foo` will cause a `report_fatal_error` crash.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88625/new/

https://reviews.llvm.org/D88625



More information about the llvm-commits mailing list