[Orc] Teach the CompileOnDemand layer to clone aliases.
[oota-llvm.git] / include / llvm / ExecutionEngine / Orc / CompileOnDemandLayer.h
index 9694b80d19289a9691b7d92e7562e3e64235f78c..714ca2374dc359a3343307dacb8edf2e9994f4e0 100644 (file)
@@ -217,6 +217,10 @@ private:
       if (!GV.isDeclaration())
         cloneGlobalVariableDecl(*GVsAndStubsM, GV, &VMap);
 
+    // And the aliases.
+    for (auto &Alias : SrcM->aliases())
+      cloneGlobalAlias(*GVsAndStubsM, Alias, VMap, &GDMat);
+
     // Then clone the initializers.
     for (auto &GV : SrcM->globals())
       if (!GV.isDeclaration())