[clang] 68ee36a - [CIR] Remove inferred context from pointer type getters (#138858)

via cfe-commits cfe-commits at lists.llvm.org
Wed May 7 10:21:05 PDT 2025


Author: Henrich Lauko
Date: 2025-05-07T19:21:01+02:00
New Revision: 68ee36a144bb6f090b10586a9e1f049f1462132e

URL: https://github.com/llvm/llvm-project/commit/68ee36a144bb6f090b10586a9e1f049f1462132e
DIFF: https://github.com/llvm/llvm-project/commit/68ee36a144bb6f090b10586a9e1f049f1462132e.diff

LOG: [CIR] Remove inferred context from pointer type getters (#138858)

This mirror incubator changes from https://github.com/llvm/clangir/pull/1600

Added: 
    

Modified: 
    clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
    clang/lib/CIR/CodeGen/CIRGenExpr.cpp

Removed: 
    


################################################################################
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 64cbda2ebe0af..711a65215b043 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.


        


More information about the cfe-commits mailing list