llvm::GlobalVariable::replaceInitializer

Replace the initializer and update this global's value type.

Synopsis

Declared in <llvm/IR/GlobalVariable.h>

void
replaceInitializer(Constant* InitVal);

Description

Sets the initializer for this global variable, and sets the value type of the global to the type of the initializer. The initializer must not be null. This may affect the global's alignment if it isn't explicitly set.

Parameters

NameDescription
InitValThe non-null new initializer.