Author: Timm Baeder
Date: 2026-08-24T15:57:39+02:00
New Revision: 0fa5bcc3585186742570b0d4eb05dbb9f13951e9

URL: 
https://github.com/llvm/llvm-project/commit/0fa5bcc3585186742570b0d4eb05dbb9f13951e9
DIFF: 
https://github.com/llvm/llvm-project/commit/0fa5bcc3585186742570b0d4eb05dbb9f13951e9.diff

LOG: [clang][bytecode] Avoid an APFloat copy (#218391)

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Compiler.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/Compiler.cpp 
b/clang/lib/AST/ByteCode/Compiler.cpp
index 87d23bf5df0c8..afcc125f7e1ec 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -5832,10 +5832,8 @@ bool Compiler<Emitter>::visitAPValue(const APValue &Val, 
PrimType ValType,
   assert(!DiscardResult);
   if (Val.isInt())
     return this->emitConst(Val.getInt(), ValType, Info);
-  if (Val.isFloat()) {
-    APFloat F = Val.getFloat();
-    return this->emitFloat(F, Info);
-  }
+  if (Val.isFloat())
+    return this->emitFloat(Val.getFloat(), Info);
 
   if (Val.isMemberPointer()) {
     if (const ValueDecl *MemberDecl = Val.getMemberPointerDecl()) {


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to