Skip to content

Commit 0195220

Browse files
committed
[Review] Since Clang doesn't emit elements in the wrong addrspace, we can now use unqual only
1 parent 00d3bfb commit 0195220

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/IR/Globals.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,11 +689,10 @@ static void appendToUsedList(Module &M, StringRef Name,
689689

690690
SmallSetVector<Constant *, 16> Init;
691691
collectUsedGlobals(GV, Init);
692-
Type *ArrayEltTy = GV ? GV->getValueType()->getArrayElementType()
693-
: PointerType::getUnqual(M.getContext());
694692
if (GV)
695693
GV->eraseFromParent();
696694

695+
Type *ArrayEltTy = PointerType::getUnqual(M.getContext());
697696
for (auto *V : Values)
698697
Init.insert(ConstantExpr::getPointerBitCastOrAddrSpaceCast(V, ArrayEltTy));
699698

0 commit comments

Comments
 (0)