Skip to content

[CIR] Fix extra ; warning, and replace new with emplaceBlock (NFC) #127207

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
Feb 14, 2025

Conversation

xlauko
Copy link
Contributor

@xlauko xlauko commented Feb 14, 2025

No description provided.

@xlauko xlauko requested a review from andykaylor February 14, 2025 13:03
@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels Feb 14, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 14, 2025

@llvm/pr-subscribers-clang

Author: Henrich Lauko (xlauko)

Changes

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

1 Files Affected:

  • (modified) clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp (+2-2)
diff --git a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
index d60a6b38b0c12..74ff89346f3c4 100644
--- a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+++ b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
@@ -157,9 +157,9 @@ void CIRToLLVMGlobalOpLowering::setupRegionInitializedLLVMGlobalOp(
       op, llvmType, isConst, linkage, symbol, nullptr, alignment, addrSpace,
       isDsoLocal, isThreadLocal,
       /*comdat=*/mlir::SymbolRefAttr(), attributes);
-  newGlobalOp.getRegion().push_back(new mlir::Block());
+  newGlobalOp.getRegion().emplaceBlock();
   rewriter.setInsertionPointToEnd(newGlobalOp.getInitializerBlock());
-};
+}
 
 mlir::LogicalResult
 CIRToLLVMGlobalOpLowering::matchAndRewriteRegionInitializedGlobal(

@llvmbot
Copy link
Member

llvmbot commented Feb 14, 2025

@llvm/pr-subscribers-clangir

Author: Henrich Lauko (xlauko)

Changes

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

1 Files Affected:

  • (modified) clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp (+2-2)
diff --git a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
index d60a6b38b0c12..74ff89346f3c4 100644
--- a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+++ b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
@@ -157,9 +157,9 @@ void CIRToLLVMGlobalOpLowering::setupRegionInitializedLLVMGlobalOp(
       op, llvmType, isConst, linkage, symbol, nullptr, alignment, addrSpace,
       isDsoLocal, isThreadLocal,
       /*comdat=*/mlir::SymbolRefAttr(), attributes);
-  newGlobalOp.getRegion().push_back(new mlir::Block());
+  newGlobalOp.getRegion().emplaceBlock();
   rewriter.setInsertionPointToEnd(newGlobalOp.getInitializerBlock());
-};
+}
 
 mlir::LogicalResult
 CIRToLLVMGlobalOpLowering::matchAndRewriteRegionInitializedGlobal(

@xlauko xlauko removed the request for review from lanza February 14, 2025 15:23
Copy link
Contributor

@andykaylor andykaylor left a comment

Choose a reason for hiding this comment

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

lgtm

@xlauko xlauko merged commit d9b55b7 into llvm:main Feb 14, 2025
11 checks passed
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
bcardosolopes pushed a commit to bcardosolopes/llvm-project that referenced this pull request Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants