[PATCH] D113755: [Flang] Add the FIR LLVMPointer Type

Jeff Niu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 14 15:03:39 PST 2021


Mogball added inline comments.


================
Comment at: flang/lib/Optimizer/Dialect/FIRType.cpp:475
+//===----------------------------------------------------------------------===//
+// LLVMPointerType
+//===----------------------------------------------------------------------===//
----------------
Mogball wrote:
> kiranchandramohan wrote:
> > clementval wrote:
> > > nit: Can we do this with assembly format directly?
> > I gave this a try but was not successful. It could be because I used it incorrectly or because the support for all types is not yet available.  @Mogball ?
> > 
> > Specifically, I made the following change to the definition of the type.
> > 
> > 
> > ```
> >   let parameters = (ins "mlir::Type":$eleTy);
> > 
> > + let assemblyFormat = "`<` $eleTy `>`";
> > ```
> > 
> > I got the following errors.
> > ```
> > tools/flang/include/flang/Optimizer/Dialect/FIROpsTypes.cpp.inc: In static member function ‘static mlir::Type fir::LLVMPointerType::parse(mlir::AsmParser&)’:
> > tools/flang/include/flang/Optimizer/Dialect/FIROpsTypes.cpp.inc:569:52: error: incomplete type ‘mlir::FieldParser<mlir::Type>’ used in nested name specifier
> >   569 |   _result_eleTy = ::mlir::FieldParser<mlir::Type>::parse(parser);
> >       |                                                    ^~~~~
> > tools/flang/include/flang/Optimizer/Dialect/FIROpsTypes.cpp.inc:578:29: error: no matching function for call to ‘fir::LLVMPointerType::get(mlir::MLIRContext*, mlir::Type&)’
> >   578 |     _result_eleTy.getValue());
> >       |                             ^
> > tools/flang/include/flang/Optimizer/Dialect/FIROpsTypes.cpp.inc:554:17: note: candidate: ‘static fir::LLVMPointerType fir::LLVMPointerType::get(mlir::Type)’
> >   554 | LLVMPointerType LLVMPointerType::get(mlir::Type elementType) {
> > ```
> I forgot to add a template specialization for Types. Let me get that right now.
https://reviews.llvm.org/D113867


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113755/new/

https://reviews.llvm.org/D113755



More information about the llvm-commits mailing list