c++ - Generating function pointers in LLVM -


I am writing my first LLVM sample. I am trying to create a small LLMV module that takes the name of the function and gives an indicator for it. The problem is that I do not know how to generate Function Points in LLVM. I got a function object by calling getDeclaration (...) . Is there any way that I can get an indication for it?

The function is a globalValue, so this is the pointer by itself, in the meantime, you can use the LVVM's C ++ Use backend to generate C + + API calls, which will reconstruct the IR, which you are feeding in LL. For example, feed the following code in the following:

  zero foo (int (* times) (int)); Int factor (int x); Int main (int argc, char ** argv) {foo (factorial); }   

Ensure that you have the "Show LLVM C + API code" checkbox selected and you will see related LLVM IR and C + + API calls, which will redo it.

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -