search for: g_var

Displaying 3 results from an estimated 3 matches for "g_var".

Did you mean: _var
2011 Apr 26
2
[LLVMdev] Symbol folding with MC
...stions regarding folding operations with symbols during the instruction print stage with MC. At the moment I'm working with global symbols but i guess that other symbol types should be equivalent. My first question is how can i negate the address of a symbol? Consider this piece of code: char g_var[80]; char foo(int a) { return g_var[a]; } this gets compiles into something like (in pseudo asm): addi a, g_var load retreg, a but i dont have an add with immediate instruction so i have to do the following subi a, -g_var // negate g_var addr load retreg, a A solution I thought could be passing...
2011 Apr 26
0
[LLVMdev] Symbol folding with MC
...perations with symbols during the instruction print stage with MC. At the moment I'm working with global symbols but i guess that other symbol types should be equivalent. > > My first question is how can i negate the address of a symbol? > > Consider this piece of code: > char g_var[80]; > char foo(int a) { return g_var[a]; } > > this gets compiles into something like (in pseudo asm): > addi a, g_var > load retreg, a > > but i dont have an add with immediate instruction so i have to do the following > subi a, -g_var // negate g_var addr > load retr...
2019 Nov 20
2
Get the address of ConstantDataArray
Hi all, I have a global array declared as: table = internal constant [8 x [256 x i32]] ... At the moment I'm able to get the reference to table using Constant* g_var = cast<GlobalVariable>(I.getOperand(0))->getInitializer(); ( please consider I to be a GetElementPtrInst object ). Now I would like to understand how to get the address of table[2][3], for instance, considering that I have the g_var variable. In addition, I was able to access to the valu...