[flang-commits] [flang] df417c3 - [flang] Add correct number of args for wait

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Fri Jul 1 01:16:47 PDT 2022


Author: Valentin Clement
Date: 2022-07-01T10:16:36+02:00
New Revision: df417c372f315d8798b93ea88cf862fda6295477

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

LOG: [flang] Add correct number of args for wait

Add source coordinates to BeginWait and BeginWaitAll calls

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D128970

Co-authored-by: V Donaldson <vdonaldson at nvidia.com>

Added: 
    

Modified: 
    flang/lib/Lower/IO.cpp
    flang/test/Lower/io-statement-1.f90

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/IO.cpp b/flang/lib/Lower/IO.cpp
index fdf001dde4518..6545d20b6e28e 100644
--- a/flang/lib/Lower/IO.cpp
+++ b/flang/lib/Lower/IO.cpp
@@ -1764,6 +1764,11 @@ Fortran::lower::genWaitStatement(Fortran::lower::AbstractConverter &converter,
     mlir::Value id = fir::getBase(converter.genExprValue(
         loc, getExpr<Fortran::parser::IdExpr>(stmt), stmtCtx));
     args.push_back(builder.createConvert(loc, beginFuncTy.getInput(1), id));
+    args.push_back(locToFilename(converter, loc, beginFuncTy.getInput(2)));
+    args.push_back(locToLineNo(converter, loc, beginFuncTy.getInput(3)));
+  } else {
+    args.push_back(locToFilename(converter, loc, beginFuncTy.getInput(1)));
+    args.push_back(locToLineNo(converter, loc, beginFuncTy.getInput(2)));
   }
   auto cookie = builder.create<fir::CallOp>(loc, beginFunc, args).getResult(0);
   genConditionHandlerCall(converter, loc, cookie, stmt.v, csi);

diff  --git a/flang/test/Lower/io-statement-1.f90 b/flang/test/Lower/io-statement-1.f90
index e380d3200e0af..e30d1841b52b6 100644
--- a/flang/test/Lower/io-statement-1.f90
+++ b/flang/test/Lower/io-statement-1.f90
@@ -28,7 +28,7 @@
   ! CHECK: call {{.*}}EndIoStatement
   endfile(8)
 
-  ! CHECK: call {{.*}}BeginWaitAll
+  ! CHECK: call {{.*}}BeginWaitAll(%{{.*}}, %{{.*}}, %{{.*}})
   ! CHECK: call {{.*}}EndIoStatement
   wait(unit=8)
 


        


More information about the flang-commits mailing list