================
@@ -58,6 +59,107 @@ static RValue emitBuiltinBitOp(CIRGenFunction &cgf, const 
CallExpr *e,
   return RValue::get(result);
 }
 
+/// Emit the conversions required to turn the given value into an
+/// integer of the given size.
+static mlir::Value emitToInt(CIRGenFunction &cgf, mlir::Value v, QualType t,
+                             cir::IntType intType) {
+  v = cgf.emitToMemory(v, t);
+
+  if (isa<cir::PointerType>(v.getType()))
----------------
andykaylor wrote:

```suggestion
  if (mlir::isa<cir::PointerType>(v.getType()))
```
Making this explicit is a nice hint to readers of the code who aren't familiar 
with MLIR, letting them know that this can be subtly different (specifically, 
`llvm::isa<>` only works with pointers, whereas this is acting on an object 
that wraps a pointer).

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

Reply via email to