On Thu, Jul 25, 2013 at 1:45 PM, Abhinash Jain <
om...@mailinator.com> wrote:
>> OK - seems you might want to take a few steps back & understand how
>> C++ code is written/structured generally (and/or take a look at other
>> parts of the compiler). You'll need a header file with the declaration
>> of your function & you can include that header file in the
>> hashtable.cpp and testing.cpp - if that sentence doesn't make sense to
>> you yet, please find some general C++ programming resources to provide
>> further detail as such a discussion isn't really on-topic here.
>
> I know it could be a bit frustrating for you to answer such foolish
> question, but am novice to llvm and desperately need some help to resolve
> this issue.
>
> testing.cpp is an instrumentation file of llvm, whereas hashtable.cpp is
> simple c++ code.
>
> I want to insert the function named hashtable() (which is already present in
> hashtable.cpp) after every store instruction.
> So I have to first DECLARE it, which can be done with getOrInsertFunction()
> in testing.cpp.
> Now since declaration of function hashtable() is like
>
> void hashtable(string expr) //in hashtable.cpp
>
> So in getOrInsertFunction() I have to pass some more details like
>
> getOrInsertFunction (name of function in IR, Return type of function, List
> of argument for the function, etc.)
> i.e. getOrInsertFunction("_Z14printHashTablev",
> Type::getVoidTy(M.getContext()), ????, ????,);
to this function & produce similar IR yourself. If you're having