Skip to content

Commit 1015967

Browse files
searlmc1jmmartinez
authored andcommitted
Temporarily unconditionally emit used / compiler.used array elements as unqualified pointers
Workaround an ASAN issue; exposed by llvm#88182
1 parent cf61b59 commit 1015967

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3072,7 +3072,9 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name,
30723072
for (unsigned i = 0, e = List.size(); i != e; ++i) {
30733073
UsedArray[i] = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
30743074
cast<llvm::Constant>(&*List[i]),
3075-
llvm::PointerType::getUnqual(CGM.getLLVMContext()));
3075+
CGM.getTarget().getTriple().isAMDGCN() ?
3076+
llvm::PointerType::getUnqual(CGM.getLLVMContext()) :
3077+
CGM.Int8PtrTy);
30763078
}
30773079

30783080
if (UsedArray.empty())

0 commit comments

Comments
 (0)