Skip to content

[CIR] Remove inferred context from pointer type getters #138858

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
May 7, 2025

Conversation

xlauko
Copy link
Contributor

@xlauko xlauko commented May 7, 2025

This mirror incubator changes from llvm/clangir#1600

@xlauko
Copy link
Contributor Author

xlauko commented May 7, 2025

@xlauko xlauko marked this pull request as ready for review May 7, 2025 12:42
@xlauko xlauko requested review from lanza and bcardosolopes as code owners May 7, 2025 12:42
@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels May 7, 2025
@llvmbot
Copy link
Member

llvmbot commented May 7, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clangir

Author: Henrich Lauko (xlauko)

Changes

This mirror incubator changes from llvm/clangir#1600


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

2 Files Affected:

  • (modified) clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h (+1-1)
  • (modified) clang/lib/CIR/CodeGen/CIRGenExpr.cpp (+1-1)
diff --git a/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h b/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
index d96a1394b97f2..a63bf4f8858d0 100644
--- a/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
+++ b/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
@@ -111,7 +111,7 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
   cir::BoolType getBoolTy() { return cir::BoolType::get(getContext()); }
 
   cir::PointerType getPointerTo(mlir::Type ty) {
-    return cir::PointerType::get(getContext(), ty);
+    return cir::PointerType::get(ty);
   }
 
   cir::PointerType getVoidPtrTy() {
diff --git a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
index 94a6c03f7f1a4..67196f9f949c1 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
@@ -42,7 +42,7 @@ Address CIRGenFunction::emitAddrOfFieldStorage(Address base,
   mlir::Location loc = getLoc(field->getLocation());
 
   mlir::Type fieldType = convertType(field->getType());
-  auto fieldPtr = cir::PointerType::get(builder.getContext(), fieldType);
+  auto fieldPtr = cir::PointerType::get(fieldType);
   // For most cases fieldName is the same as field->getName() but for lambdas,
   // which do not currently carry the name, so it can be passed down from the
   // CaptureStmt.

@xlauko xlauko requested review from andykaylor and erichkeane May 7, 2025 12:48
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
Copy link
Contributor Author

xlauko commented May 7, 2025

Merge activity

  • May 7, 1:16 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • May 7, 1:18 PM EDT: Graphite rebased this pull request as part of a merge.
  • May 7, 1:21 PM EDT: @xlauko merged this pull request with Graphite.

@xlauko xlauko force-pushed the users/xlauko/cir-pointer-getters branch from e9b719b to f875b20 Compare May 7, 2025 17:18
@xlauko xlauko merged commit 68ee36a into main May 7, 2025
6 of 9 checks passed
@xlauko xlauko deleted the users/xlauko/cir-pointer-getters branch May 7, 2025 17:21
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.

4 participants