[flang-commits] [PATCH] D114104: [FIR] Convert fir.allocmem and fir.freemem operations to calls to malloc and free, respectively

Mehdi AMINI via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Nov 22 13:03:59 PST 2021


mehdi_amini added inline comments.


================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:278-281
 
+/// Helper function for generating the LLVM IR that computes the size
+/// in bytes for a derived type.
+mlir::Value computeDerivedTypeSize(mlir::Location loc, mlir::Type ptrTy,
----------------



================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:291
+
 // Lower `fir.address_of` operation to `llvm.address_of` operation.
 struct AddrOfOpConversion : public FIROpConversion<fir::AddrOfOp> {
----------------



================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:37
 
+inline mlir::Type getVoidPtrType(mlir::MLIRContext *context) {
+  return mlir::LLVM::LLVMPointerType::get(mlir::IntegerType::get(context, 8));
----------------



================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:245
 
+namespace {
+/// Helper function for generating the LLVM IR that computes the size
----------------
AlexisPerry wrote:
> mehdi_amini wrote:
> > AlexisPerry wrote:
> > > clementval wrote:
> > > > I think it's already in an anonymous namespace.
> > > Thanks for the catch!
> > The coding standard indicates that anonymous namespace should be made as small as possible and only include class declarations.
> > Functions should be made static and outside the namespace instead.
> > 
> > https://llvm.org/docs/CodingStandards.html#anonymous-namespaces
> Thank you for the review.  I think I have implemented your suggestions correctly, but I would appreciate it if you could verify.  There were a number of places I had to change that were outside of the particular part of the file I had been working on and I want to make sure I captured everything appropriately.
Just pointed two places, otherwise LG


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

https://reviews.llvm.org/D114104



More information about the flang-commits mailing list