Skip to content

Commit cf61b59

Browse files
Alex Voicujmmartinez
authored andcommitted
Get the type of the used array from its elements.
1 parent 1c23824 commit cf61b59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3077,8 +3077,8 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name,
30773077

30783078
if (UsedArray.empty())
30793079
return;
3080-
llvm::ArrayType *ATy = llvm::ArrayType::get(
3081-
llvm::PointerType::getUnqual(CGM.getLLVMContext()), UsedArray.size());
3080+
llvm::ArrayType *ATy = llvm::ArrayType::get(UsedArray.front()->getType(),
3081+
UsedArray.size());
30823082

30833083
auto *GV = new llvm::GlobalVariable(
30843084
CGM.getModule(), ATy, false, llvm::GlobalValue::AppendingLinkage,

0 commit comments

Comments
 (0)