[Orc] Fix a bug in the CompileOnDemand layer where stub decls were not cloned
[oota-llvm.git] / lib / ExecutionEngine / Orc / IndirectionUtils.cpp
index 4ed873031482b8f76fc98d9cbdff7730e1bae228..b439810ed330ee43f9e12609d422145398fcb3b4 100644 (file)
@@ -30,8 +30,6 @@ Constant* createIRTypedAddress(FunctionType &FT, TargetAddress Addr) {
 
 GlobalVariable* createImplPointer(PointerType &PT, Module &M,
                                   const Twine &Name, Constant *Initializer) {
-  if (!Initializer)
-    Initializer = Constant::getNullValue(&PT);
   auto IP = new GlobalVariable(M, &PT, false, GlobalValue::ExternalLinkage,
                                Initializer, Name, nullptr,
                                GlobalValue::NotThreadLocal, 0, true);