How can i insert an add instruction in IR file llvm?

i want to insert add instruction in IR llvm format, instruction like x = x + 1 , where x is global variable , i try to use: GlobalVariable* x = new GlobalVariable(mod,Type::getInt32Ty(Context),false,GlobalValue::CommonLinkage,0,“xCounter”);
Value one = ConstantInt::get(Type::getInt32Ty(Context),1); newInst = BinaryOperator::Create(Instruction::Add, , one ,“counter”, insertPos);
but an error occur, it is not accept type GlobalVariable, How can i define a global variable and set its value , and final i print its value on screen ?