[flang-commits] [flang] 4e0a2bd - [fir] Fix build

Jeff Niu via flang-commits flang-commits at lists.llvm.org
Wed Aug 10 22:10:47 PDT 2022


Author: Jeff Niu
Date: 2022-08-11T01:10:33-04:00
New Revision: 4e0a2bd6279998261393c9b7446dbb285188c149

URL: https://github.com/llvm/llvm-project/commit/4e0a2bd6279998261393c9b7446dbb285188c149
DIFF: https://github.com/llvm/llvm-project/commit/4e0a2bd6279998261393c9b7446dbb285188c149.diff

LOG: [fir] Fix build

Added: 
    

Modified: 
    flang/lib/Optimizer/CodeGen/CodeGen.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
index 9a7bc217e622c..335ce24d221d5 100644
--- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -379,7 +379,7 @@ struct AllocaOpConversion : public FIROpConversion<fir::AllocaOp> {
             "callee", mlir::SymbolRefAttr::get(memSizeFn));
         auto call = rewriter.create<mlir::LLVM::CallOp>(
             loc, ity, lenParams, llvm::ArrayRef<mlir::NamedAttribute>{attr});
-        size = call.getResult(0);
+        size = call.getResult();
         ty = ::getVoidPtrType(alloc.getContext());
       } else {
         return emitError(loc, "unexpected type ")
@@ -997,7 +997,7 @@ struct AllocMemOpConversion : public FIROpConversion<fir::AllocMemOp> {
     auto malloc = rewriter.create<mlir::LLVM::CallOp>(
         loc, ::getVoidPtrType(heap.getContext()), size, heap->getAttrs());
     rewriter.replaceOpWithNewOp<mlir::LLVM::BitcastOp>(heap, ty,
-                                                       malloc.getResult(0));
+                                                       malloc.getResult());
     return mlir::success();
   }
 


        


More information about the flang-commits mailing list