similar to: [LLVMdev] how to get and modify a local variable's value through executionEngine?

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] how to get and modify a local variable's value through executionEngine?"

2012 Dec 10
0
[LLVMdev] how to get and modify a local variable's value through executionEngine?
Dong Chen <jameschennerd at gmail.com> writes: > hello guys, > recently, i successfully get and modify global variable by execution engine. > the functions i used are listed here: > int m=1; > EE->updateGlobalMapping(p->M->getGlobalVariable("x",true),&m); > EE->recompileAndRelinkFunction(EntryFn); > x is the global variable in the module.
2012 May 23
0
[LLVMdev] lli unable to resolve symbol _ZNKSt3__16locale9use_facetERNS0_2idE in bitcode
Ashok Nalkund wrote: > > Resending :(. Any pointers? Fundamentally the issue is that the system linker is supposed to define __dso_handle when linking, but since there is no system linker between your build of the .bc files and running lli, nobody has defined it. It seems reasonable to me that lli should define __dso_handle if it's declared in the module. You could module
2012 Dec 05
3
[LLVMdev] how to get and modify a global variable inside a module
hi Duncan Sands, i have tried the functions: GlobalValue * getNamedValue (StringRef Name) const GlobalVariable * getGlobalVariable (StringRef Name, bool AllowInternal=false) const GlobalVariable * getNamedGlobal (StringRef Name) const but i think these functions just return the ID or something else (not the Global Variable's main memory address, i am not sure) here is the thing. i
2012 May 23
1
[LLVMdev] lli unable to resolve symbol _ZNKSt3__16locale9use_facetERNS0_2idE in bitcode
Hi Nick, > Fundamentally the issue is that the system linker is supposed to define > __dso_handle when linking, but since there is no system linker between > your build of the .bc files and running lli, nobody has defined it. > > It seems reasonable to me that lli should define __dso_handle if it's > declared in the module. > > You could module tools/lli/lli.cpp to add
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hello Óscar Fuentes, thanks for your reply, if i use the API provided by parser.h and the program *.ll i parsed contains local variable, i can get a module have local variable without defines it first. i think that module is a structure like AST(i am not sure whether i was right), this must be a traversal method. am i right or do i misunderstand something? -- View this message in context:
2007 Sep 22
4
[LLVMdev] RFC: Patch
Hi all, I have a patch that would potentially help Objective-C 2. In the "make_decl_llvm()" in llvm-backend.cpp, there is code to search through the already generated global variables. Objective-C goes through this code twice with the same identifier. The first time, is to create meta-data for a "property". The second time is to add a reference to that property into the
2012 May 22
5
[LLVMdev] lli unable to resolve symbol _ZNKSt3__16locale9use_facetERNS0_2idE in bitcode
Resending :(. Any pointers? tia On 5/21/2012 2:46 PM, Ashok Nalkund wrote: > On 5/21/2012 11:15 AM, Nick Lewycky wrote: >> Ashok Nalkund wrote: >>> Resending, any pointers? I demangled the symbol and it turns out to be: >>> std::__1::locale::use_facet(std::__1::locale::id&) const >> >> My guess is that you've got a .bc file produced on a mac using
2012 Dec 05
0
[LLVMdev] how to get and modify a global variable inside a module
On 12/5/12 2:49 PM, Dong Chen wrote: > here is the thing. i want to know the exact main memory address of the > Global Varibale's address when ExecutionEngine execut the *.ll code. further > more, i want to change the address, is it possible? I assume you want to adjust the value at that address, right? Then you might want to check the ExecutionEngine::getPointerToGlobal method. You
2013 Apr 04
0
[LLVMdev] ExecutionEngine::updateGlobalMapping
Hello, I am using updateGlobalMapping to inform the JIT engine the address of some C helpers. Due to the nature of the analysis pass, there can be several calls to updateGlobalMapping with the same GlobalValue key and the same (or sometimes different) address. My problem is when the reverse mapping is enabled, the following fragment: // If we are using the reverse mapping, add it too. if
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hi Óscar Fuentes , thanks for your reply, but there are still a lot of concepts i don't understand. there seems to be some document to guide you but hard to understand. can you show me some basic and easy to learn document or websites? thank you -- View this message in context:
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hi Óscar Fuentes, i am new to llvm, so i still have several questions. thanks for you help. (1)what is SSA form(static single assignment)? (2)how to traverse the basic blocks? if the module is gained by parser, what will the basic blocks contain? i will be on the line, thank you very much -- View this message in context:
2007 Sep 22
0
[LLVMdev] RFC: Patch
Hi Bill, why not just add "true" to the getGlobalVariable call? GlobalVariable *getGlobalVariable(const std::string &Name, bool AllowInternal = false) const; Ciao, Duncan.
2006 Mar 26
1
[LLVMdev] A question about Module::getGlobalVariable()
I want to find a global variable by name in some module , I find LLVM function Module::getGlobalVariable(string name,Type* ty); My question is , is it necessary to specify the global variable type (second param) ? Why not just getGlobalVariable(string name). I look up the source , and find that it depend on SymbolTable.find() and SymbolTable only support find with type .is it True ? or I make
2010 Aug 18
1
[LLVMdev] clang: call extern function using JIT
Heres my full code listing, im totally stuck. // Whistle.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "clang/CodeGen/CodeGenAction.h" #include "clang/Driver/Compilation.h" #include "clang/Driver/Driver.h" #include "clang/Driver/Tool.h" #include
2012 Dec 05
4
[LLVMdev] how to get and modify a global variable inside a module
recently, i use LLVM API to write a program to read *.ll and excute it automatically. Further more, i want to change some global variables inside a module. i tried some functions provided by Module.h and ExecutionEngine.h but none were seemed to match my need. did someone have the experience or some advices? thank you ;) -- View this message in context:
2005 Nov 02
1
[LLVMdev] Statically Initialized Arrays
On Nov 2, 2005, at 16:39, Chris Lattner wrote: > 4. Replace the old GV with the new GV using code that looks like this: > > OldGV->replaceAllUsesWith(ConstantExpr::getCast(NewGV, > OldGV->getType()); > OldGV->eraseFromParent(); > > At the end of this, any instructions or other globals that referenced > the temporary global will now reference the new one.
2015 Sep 14
2
JIT: Mapping global variable in JIT'ted code to variable in running program
Hi, I think this is probably easiest to explain with code (I only provided the essentials for clarity): // begin file jit.cpp int myglobal; void printMyGlobal() { printf("myglobal: %d\n", myglobal); } int main(int argc, char *argv[]) { // This file, jit.cpp has been compiled to bitcode (clang -S -emit-llvm jit.cpp) // and is read into Module M here Module *M = ...
2010 Aug 17
4
[LLVMdev] clang: call extern function using JIT
hi, im creating a music application(image below). At the moment im using tcc compiler but im moving across to clang because of the improved compiler warnings. Can anyone please explain and show code so I can use clang's JIT to call functions in my application? Thanks. http://old.nabble.com/file/p29449300/51709341.jpeg -- View this message in context:
2012 Sep 19
3
[LLVMdev] newbie question on getelementptr
Hi All, I'm new to LLVM and I'm having a coding problem. I'm creating a GlobalVariable that contains a StructType that contains a Function. The function returns i32 and takes two i32's. Here is my code: GlobalVariable* retrieved = module->getGlobalVariable("myGV"); ... Constant* result = ConstantExpr::getGetElementPtr(retrieved, indices); How do I get my Function
2004 Dec 14
0
[LLVMdev] misc. patches
Morten, The leaks.patch file introduced a static destructor ordering problem which lead to garbled output. The comment above those lines of code indicates why it needs to be the way it is. My bad for committing it in the first place. Please be careful in the future. Reid. On Mon, 2004-12-13 at 05:30, Morten Ofstad wrote: > Hi, > > here are some minor patches that for various reasons