Call in-library only class member

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Call in-library only class member

Sebastian Dreßler

I'm trying to call class members which are not used within the original
source code and therefore are not declared within bitcode. An example
would be calling std::vector<T>::size(). Right now I'm using a helper
function, e.g.

int f(vector<int> &v) {
     return (int)v.size();

However, this solution is not as elegant as I would like it to have,
mostly due to the fact that with changing T i have to provide additional
code. So I wondered whether it is possible to declare a function and
recompile the resulting bitcode again with the result that the correct
function of the object gets called.

 From what I can see from [1] Kenneth Uildriks mentions JIT and also
that a declaration can be included. But I'm unable to link this proposed
solution to my actual problem.


[1]: How can we call an object's virtual function inside IR?

Mit freundlichen Grüßen / Kind regards

Sebastian Dreßler

Zuse Institute Berlin (ZIB)
Takustraße 7
D-14195 Berlin-Dahlem

[hidden email]
Phone: +49 30 84185-261
LLVM Developers mailing list
[hidden email]