[PATCH] D13659: Implement .reloc (constant offset only) with support for R_MIPS_NONE and R_MIPS_32.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 15:27:49 PDT 2015


majnemer added a subscriber: majnemer.

================
Comment at: include/llvm/MC/MCObjectStreamer.h:127-128
@@ -126,2 +126,4 @@
   void EmitGPRel64Value(const MCExpr *Value) override;
+  bool EmitRelocDirective(const MCExpr &Offset, StringRef Name,
+                          const MCExpr &Expr, SMLoc Loc = SMLoc()) override;
   void EmitFill(uint64_t NumBytes, uint8_t FillValue) override;
----------------
Will there be any direct calls of this? If not, I'd just drop the default argument.

================
Comment at: include/llvm/MC/MCStreamer.h:692
@@ +691,3 @@
+                                  const MCExpr &Expr, SMLoc Loc = SMLoc()) {
+    return false;
+  }
----------------
Shouldn't this return `true` because nothing was emitted?

================
Comment at: lib/MC/MCAsmStreamer.cpp:242-243
@@ -241,1 +241,4 @@
 
+  bool EmitRelocDirective(const MCExpr &Offset, StringRef Name,
+                          const MCExpr &Expr, SMLoc Loc = SMLoc()) override;
+
----------------
Will there be any direct calls of this? If not, I'd just drop the default argument.

================
Comment at: lib/MC/MCParser/AsmParser.cpp:4528-4531
@@ +4527,6 @@
+
+  // We can only deal with constant expressions at the moment.
+  int64_t OffsetValue;
+  if (!Offset->evaluateAsAbsolute(OffsetValue))
+    return Error(OffsetLoc, "expression is not a constant value");
+
----------------
Not all targets support an addend, this should be predicated on a hook.


http://reviews.llvm.org/D13659





More information about the llvm-commits mailing list