/// byte offset into the Atom's content to do the fix up.
virtual uint64_t offsetInAtom() const = 0;
- /// If the reference is an edge to another Atom, then this returns the
- /// other Atom. Otherwise, it returns nullptr.
+ /// Returns the atom this reference refers to.
virtual const Atom *target() const = 0;
/// During linking, the linker may merge graphs which coalesces some nodes
uint64_t offsetInAtom() const override { return _offsetInAtom; }
- const Atom *target() const override { return _target; }
+ const Atom *target() const override {
+ assert(_target);
+ return _target;
+ }
Addend addend() const override { return _addend; }
-
void setAddend(Addend a) override { _addend = a; }
-
void setTarget(const Atom *newAtom) override { _target = newAtom; }
+
private:
const Atom *_target;
uint64_t _offsetInAtom;