I ended up putting a flag in the class table to keep track of functions being virtual (so they can be used in polymorphism) and them being methods (so the object they modify is automatically passed).
My compiler can now convert something like "myvar.myfunc()" to "VarClass_myfunc(&myvar)".