[llvm] [RuntimeDyldChecker][AArch32] Add a PC offset to next_PC for ARM targets (PR #91746)

Stefan Gränitz via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 05:32:52 PDT 2024


================
@@ -354,21 +354,41 @@ class RuntimeDyldCheckerExprEval {
           EvalResult(("Cannot decode unknown symbol '" + Symbol + "'").str()),
           "");
 
+    // if there is an offset number expr
+    int64_t SymbolOffset = 0;
+    BinOpToken BinOp;
+    std::tie(BinOp, RemainingExpr) = parseBinOpToken(RemainingExpr);
+    switch (BinOp) {
+    case BinOpToken::Add: {
+      EvalResult Number;
+      std::tie(Number, RemainingExpr) = evalNumberExpr(RemainingExpr);
+      SymbolOffset = Number.getValue();
+      break;
+    }
+    case BinOpToken::Invalid:
+      break;
+    default:
+      return std::make_pair(
+          unexpectedToken(RemainingExpr, RemainingExpr,
+                          "expected '+' for offset or ')' if no offset"),
+          "");
+    }
+
----------------
weliveindetail wrote:

This is only used in a single test, right? If we really want to use it there, we should rather fix the test by adding another label. Otherwise, if we really want to go down this road, it would probably be best to support full expressions here again.

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


More information about the llvm-commits mailing list