[NVPTX] convert pointers in byval kernel arguments to global
[oota-llvm.git] / lib / LTO / LTOModule.cpp
index 6131c3180249ded2331ad3e122cef53cd896bf21..ec8991ed236531e5dfd3b2f641d904a2fd2f8c38 100644 (file)
@@ -232,7 +232,7 @@ LTOModule *LTOModule::makeLTOModule(MemoryBufferRef Buffer,
 
   TargetMachine *target = march->createTargetMachine(TripleStr, CPU, FeatureStr,
                                                      options);
-  M->setDataLayout(*target->getDataLayout());
+  M->setDataLayout(target->createDataLayout());
 
   std::unique_ptr<object::IRObjectFile> IRObj(
       new object::IRObjectFile(Buffer, std::move(M)));
@@ -473,6 +473,9 @@ void LTOModule::addDefinedSymbol(const char *Name, const GlobalValue *def,
   if (def->hasComdat())
     attr |= LTO_SYMBOL_COMDAT;
 
+  if (isa<GlobalAlias>(def))
+    attr |= LTO_SYMBOL_ALIAS;
+
   auto Iter = _defines.insert(Name).first;
 
   // fill information structure