[ORC] Narrow a cast: the block guarded by the condition only handles
authorLang Hames <lhames@gmail.com>
Fri, 28 Sep 2018 20:16:16 +0000 (20:16 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 28 Sep 2018 20:16:16 +0000 (20:16 +0000)
GlobalVariables, not all GlobalValues.

llvm-svn: 343358

llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp

index fc788d9..295a9bc 100644 (file)
@@ -36,7 +36,7 @@ static void extractAliases(MaterializationResponsibility &R, Module &M,
       A->replaceAllUsesWith(F);
       A->eraseFromParent();
       F->setName(AliasName);
-    } else if (isa<GlobalValue>(Aliasee)) {
+    } else if (isa<GlobalVariable>(Aliasee)) {
       auto *G = cloneGlobalVariableDecl(M, *cast<GlobalVariable>(Aliasee));
       A->replaceAllUsesWith(G);
       A->eraseFromParent();