Debug Info: constify and rename from generateRef to getRef.

No functionality change.