Hi Team,
I am trying a simple LLVM pass which changes the statement
From : @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
To : @.str = private unnamed_addr constant [5 x i8] c"%19s\00", align 1
The “From” statement is fetched from the IR using the below code. And it prints fine.
GlobalVariable *gVar = dyn_cast(const_expr->getOperand(0));
I am trying to change with something like the below, but doesn’t seem working.
Value *constant = Builder.CreateGlobalString(“[3 x i8] c"%19s\00"”, “String1a”);
gVar->setOperand(0,constant);
Any suggestions please. Thanks.