[clang] [clang][NFC] Fix a warning (PR #98611)
Piotr Fusik via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 12 03:34:17 PDT 2024
https://github.com/pfusik created https://github.com/llvm/llvm-project/pull/98611
enumerated and non-enumerated type in conditional expression
>From d8d44d1eff37bc7e2632fb64b087aac270742ac6 Mon Sep 17 00:00:00 2001
From: Piotr Fusik <p.fusik at samsung.com>
Date: Fri, 12 Jul 2024 11:34:26 +0200
Subject: [PATCH] [clang][NFC] Fix a warning
enumerated and non-enumerated type in conditional expression
---
clang/lib/CodeGen/CGExpr.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 039f60c774591..ddb82571f53d7 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -3842,9 +3842,10 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked,
llvm::CallInst *TrapCall = Builder.CreateCall(
CGM.getIntrinsic(llvm::Intrinsic::ubsantrap),
- llvm::ConstantInt::get(CGM.Int8Ty, ClSanitizeDebugDeoptimization
- ? TrapBB->getParent()->size()
- : CheckHandlerID));
+ llvm::ConstantInt::get(CGM.Int8Ty,
+ ClSanitizeDebugDeoptimization
+ ? TrapBB->getParent()->size()
+ : static_cast<uint64_t>(CheckHandlerID)));
if (!CGM.getCodeGenOpts().TrapFuncName.empty()) {
auto A = llvm::Attribute::get(getLLVMContext(), "trap-func-name",
More information about the cfe-commits
mailing list