[Cling](https://github.com/root-project/cling) (LLVM-based) does something like you described.
See the [demo](https://github.com/root-project/cling/tree/master/tools/demo). In particular see the function [useSymbolAddress](https://github.com/root-project/cling/blob/f23f0ed9ca38f27c5f9fbbb54e13f67e11f95b9b/tools/demo/cling-demo.cpp#L48)