search for: getexecutablepath

Displaying 7 results from an estimated 7 matches for "getexecutablepath".

2010 Aug 18
1
[LLVMdev] clang: call extern function using JIT
...uot; #include "llvm/System/Host.h" #include "llvm/System/Path.h" #include "llvm/Target/TargetSelect.h" using namespace clang; using namespace clang::driver; extern "C" int yipee(int val) { fprintf(stderr, "yipee!"); return 1; } llvm::sys::Path GetExecutablePath(const char *Argv0) { // This just needs to be some symbol in the binary; C++ doesn't // allow taking the address of ::main however. void *MainAddr = (void*) (intptr_t) GetExecutablePath; return llvm::sys::Path::GetMainExecutable(Argv0, MainAddr); } int Execute(llvm::Module *Mod, char * con...
2013 Oct 03
0
[LLVMdev] libclang JIT frontend
...e "static" keyword because its address is used for // GetMainExecutable (since some platforms don't support taking the // address of main, and some platforms can't implement GetMainExecutable // without being given the address of a function in the main executable). llvm::sys::Path GetExecutablePath(const char *Argv0) { // This just needs to be some symbol in the binary; C++ doesn't // allow taking the address of ::main however. void *MainAddr = (void*) (intptr_t) GetExecutablePath; return llvm::sys::Path::GetMainExecutable(Argv0, MainAddr); } static int Execute(llvm::Module *Mod,...
2010 Aug 18
0
[LLVMdev] clang: call extern function using JIT
I tried what you said, now I get: LLVM ERROR: Program used external function 'yipee' which could not be resolved! Stack dump: 0. Running pass 'X86 Machine Code Emitter' on function '@main' did not even get as far as a breakpoint. Óscar Fuentes wrote: > > gafferuk <gafferuk at gmail.com> writes: > >> Im confused. The function i wish to call is
2010 Aug 18
2
[LLVMdev] clang: call extern function using JIT
gafferuk <gafferuk at gmail.com> writes: > Im confused. The function i wish to call is a return type of int. > Im calling it with int dd = yipee(1); > > What's wrong? Declare the function: int yipee(int); int main() { int dd = yipee(1); return 0; } If that still crashes, put a breakpoint on `yipee' and see if the execution gets there, if the argument is
2019 Jul 29
4
ICE in release/9.x when using LLVM_ENABLE_MODULES
I ran into an LLVM/Clang crash when attempting to do the following: 1. Build Clang from the release/9.x branch source. 2. Use the Clang from (1) to build clangd on the release/9.x branch, with LLVM_ENABLE_MODULES=On. I wrote a script to reproduce the crash: https://gist.github.com/modocache/ac366ca9673b93bb21e75d3e72162608 At the above URL, you'll find a script `repro.sh` that reproduces
2016 Aug 04
4
help please: how to sort the contents of a "SymbolTableListTraits<GlobalVariable>"?
...54-42-1cb1a4c-master/llvm/tools/cfe/lib/FrontendTool/ExecuteCompilerInvocation.cpp:241 #22 0x0000000000c33bc8 in cc1_main (Argv=..., Argv0=0x7fffffffe3f9 "/work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/tmp/clang", MainAddr=0xc26010 <GetExecutablePath(char const*, bool)>) at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/tools/driver/cc1_main.cpp:116 #23 0x0000000000c27c2a in ExecuteCC1Tool (argv=..., Tool=...) at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07...
2016 Jul 27
2
help please: how to sort the contents of a "SymbolTableListTraits<GlobalVariable>"?
Dear all, In the process of trying to add optimization for better layout of global variables, I have run up against a roadblock: I don`t seem to be able to sort the contents of a "SymbolTableListTraits<GlobalVariable>" -- or even swap two elements in that list -- without causing LLVM to crash. I have tried writing a comparator class and then using "llvm::iplist<