Skip to content

Conversation

@sarnex
Copy link
Member

@sarnex sarnex commented Apr 30, 2025

Fixes for #138000

@sarnex
Copy link
Member Author

sarnex commented Apr 30, 2025

Ignoring clang-format CI result

@github-actions
Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- clang/lib/CodeGen/CGCall.cpp
View the diff from clang-format here.
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index b5a7217dd..83b0e8e96 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -3520,7 +3520,8 @@ static llvm::Value *tryEmitFusedAutoreleaseOfResult(CodeGenFunction &CGF,
   // Look for:
   //   %generator = call i8* @objc_retain(i8* %originalResult)
   // or
-  //   %generator = call i8* @objc_retainAutoreleasedReturnValue(i8* %originalResult)
+  //   %generator = call i8* @objc_retainAutoreleasedReturnValue(i8*
+  //   %originalResult)
   llvm::CallInst *call = dyn_cast<llvm::CallInst>(generator);
   if (!call)
     return nullptr;
@@ -3996,7 +3997,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI,
         RV = SI->getValueOperand();
         SI->eraseFromParent();
 
-      // Otherwise, we have to do a simple load.
+        // Otherwise, we have to do a simple load.
       } else {
         RV = Builder.CreateLoad(ReturnValue);
       }

@sarnex sarnex marked this pull request as ready for review April 30, 2025 21:47
@sarnex sarnex requested a review from efriedma-quic April 30, 2025 21:48
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:codegen IR generation bugs: mangling, exceptions, etc. labels Apr 30, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 30, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-codegen

Author: Nick Sarnie (sarnex)

Changes

Fixes for #138000


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

1 Files Affected:

  • (modified) clang/lib/CodeGen/CGCall.cpp (+2-3)
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 83b0e8e965770..b5a7217dd3e56 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -3520,8 +3520,7 @@ static llvm::Value *tryEmitFusedAutoreleaseOfResult(CodeGenFunction &CGF,
   // Look for:
   //   %generator = call i8* @objc_retain(i8* %originalResult)
   // or
-  //   %generator = call i8* @objc_retainAutoreleasedReturnValue(i8*
-  //   %originalResult)
+  //   %generator = call i8* @objc_retainAutoreleasedReturnValue(i8* %originalResult)
   llvm::CallInst *call = dyn_cast<llvm::CallInst>(generator);
   if (!call)
     return nullptr;
@@ -3997,7 +3996,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI,
         RV = SI->getValueOperand();
         SI->eraseFromParent();
 
-        // Otherwise, we have to do a simple load.
+      // Otherwise, we have to do a simple load.
       } else {
         RV = Builder.CreateLoad(ReturnValue);
       }

@sarnex sarnex merged commit aa4b44e into llvm:main May 2, 2025
15 of 16 checks passed
SI->eraseFromParent();

// Otherwise, we have to do a simple load.
// Otherwise, we have to do a simple load.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pointed out this one specifically, but I think the same thing happened in a few other places.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll go through and check, thanks

IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
sarnex added a commit that referenced this pull request May 7, 2025
More fixes based on #138036

---------

Signed-off-by: Sarnie, Nick <[email protected]>
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request May 7, 2025
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
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