[clang] [clang][CodeGen] Don't crash on sizeless output. (PR #99849)

2024-07-22 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: not %clang_cc1 -S %s -o /dev/null 2>&1 | FileCheck %s efriedma-quic wrote: Please use "-verify" to check clang diagnostics, not FileCheck. Is there any existing file with inline asm diagnostics this can be added to? https://github.com/l

[clang] [clang][CodeGen] Don't crash on sizeless output. (PR #99849)

2024-07-22 Thread Eli Friedman via cfe-commits
@@ -2751,7 +2751,10 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { if (RequiresCast) { unsigned Size = getContext().getTypeSize(QTy); -Ty = llvm::IntegerType::get(getLLVMContext(), Size); +if (Size) + Ty = llvm::IntegerType::get

[clang] [clang][CodeGen] Don't crash on sizeless output. (PR #99849)

2024-07-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yeting Kuo (yetingk) Changes This fixes issue #63878 caused by creating an integer with zero bitwidth. --- Full diff: https://github.com/llvm/llvm-project/pull/99849.diff 2 Files Affected: - (modified) clang/lib/CodeGen/CGStmt.cpp (+4-

[clang] [clang][CodeGen] Don't crash on sizeless output. (PR #99849)

2024-07-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Yeting Kuo (yetingk) Changes This fixes issue #63878 caused by creating an integer with zero bitwidth. --- Full diff: https://github.com/llvm/llvm-project/pull/99849.diff 2 Files Affected: - (modified) clang/lib/CodeGen/CGStmt.

[clang] [clang][CodeGen] Don't crash on sizeless output. (PR #99849)

2024-07-22 Thread Yeting Kuo via cfe-commits
https://github.com/yetingk created https://github.com/llvm/llvm-project/pull/99849 This fixes issue #63878 caused by creating an integer with zero bitwidth. >From 44a0091b3e28b5c36f2eebe9e91d5c57f25a5d32 Mon Sep 17 00:00:00 2001 From: Yeting Kuo Date: Mon, 22 Jul 2024 01:18:51 -0700 Subject: [