Extend Module::getOrInsertGlobal to control the construction of the
authorPhilip Pfaffe <philip.pfaffe@gmail.com>
Wed, 2 Jan 2019 15:41:47 +0000 (15:41 +0000)
committerPhilip Pfaffe <philip.pfaffe@gmail.com>
Wed, 2 Jan 2019 15:41:47 +0000 (15:41 +0000)
commit6bc98ad7e879fb2c56bc998b57320db3405fd5af
treec5516520caf48e01c01f11b76c083dbd59133549
parent0682afbaeed4471483ed6069a080f0cfd922767b
Extend Module::getOrInsertGlobal to control the construction of the
GlobalVariable

Summary:
Extend Module::getOrInsertGlobal to accept a callback for creating a new
GlobalVariable if necessary instead of calling the GV constructor
directly using default arguments. Additionally overload
getOrInsertGlobal for the previous default behavior.

Reviewers: chandlerc

Subscribers: hiraditya, llvm-commits, bollu

Differential Revision: https://reviews.llvm.org/D56130

llvm-svn: 350219
llvm/include/llvm/IR/Module.h
llvm/lib/IR/Module.cpp