Skip to content

[clang][NFC] Fix a warning #98611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2024
Merged

[clang][NFC] Fix a warning #98611

merged 1 commit into from
Jul 14, 2024

Conversation

pfusik
Copy link
Contributor

@pfusik pfusik commented Jul 12, 2024

enumerated and non-enumerated type in conditional expression

enumerated and non-enumerated type in conditional expression
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:codegen IR generation bugs: mangling, exceptions, etc. labels Jul 12, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 12, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-codegen

Author: Piotr Fusik (pfusik)

Changes

enumerated and non-enumerated type in conditional expression


Full diff: https://github.com/llvm/llvm-project/pull/98611.diff

1 Files Affected:

  • (modified) clang/lib/CodeGen/CGExpr.cpp (+4-3)
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",

@pfusik
Copy link
Contributor Author

pfusik commented Jul 12, 2024

This fixes one of the very few warnings when building clang with Ubuntu 22.04's gcc.

@pfusik pfusik requested a review from nikic July 12, 2024 10:47
@pfusik pfusik merged commit ca4ebae into llvm:main Jul 14, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen IR generation bugs: mangling, exceptions, etc. clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants