We want to create a global string pointer, and update its “value” (literal) on demand, and use it.
Create a String Pointer
Basically, there are two ways of creating a global variable (Module
and IRbuilder
). The second one is shown here.
Update the “value” pointed
Why should we use GEP (GetElementPointer)?
Because we need to calculate the index, please refer to The Often Misunderstood GEP Instruction.
Use the string pointer