hishiguro updated this revision to Diff 265450.
hishiguro added a comment.

Thank you for your comment. I updated source.


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

https://reviews.llvm.org/D79921

Files:
  clang/lib/CodeGen/CGStmtOpenMP.cpp
  clang/test/OpenMP/omp_with_loop_pragma.c


Index: clang/test/OpenMP/omp_with_loop_pragma.c
===================================================================
--- clang/test/OpenMP/omp_with_loop_pragma.c
+++ clang/test/OpenMP/omp_with_loop_pragma.c
@@ -3,12 +3,12 @@
 // expected-no-diagnostics
 
 // CHECK: !{{[0-9]+}} = !{!"llvm.loop.vectorize.width", i32 1}
-void sub(double * restrict a, double * restrict b, int n){ 
+void sub(double *restrict a, double *restrict b, int n) {
   int i;
 
 #pragma omp parallel for
 #pragma clang loop vectorize(disable)
-  for(i=0;i<n;i++){
+  for (i = 0; i < n; i++) {
     a[i] = a[i] + b[i];
   }
 }
Index: clang/lib/CodeGen/CGStmtOpenMP.cpp
===================================================================
--- clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -1732,8 +1732,8 @@
   const SourceRange R = S.getSourceRange();
 
   // If attributes are attached, push to the basic block with them.
-  const OMPExecutableDirective *OMPED = dyn_cast<OMPExecutableDirective>(&S);
-  const CapturedStmt *ICS = OMPED->getInnermostCapturedStmt();
+  const auto &OMPED = cast<OMPExecutableDirective>(S);
+  const CapturedStmt *ICS = OMPED.getInnermostCapturedStmt();
   const Stmt *SS = ICS->getCapturedStmt();
   const AttributedStmt *AS = dyn_cast_or_null<AttributedStmt>(SS);
   if (AS)


Index: clang/test/OpenMP/omp_with_loop_pragma.c
===================================================================
--- clang/test/OpenMP/omp_with_loop_pragma.c
+++ clang/test/OpenMP/omp_with_loop_pragma.c
@@ -3,12 +3,12 @@
 // expected-no-diagnostics
 
 // CHECK: !{{[0-9]+}} = !{!"llvm.loop.vectorize.width", i32 1}
-void sub(double * restrict a, double * restrict b, int n){ 
+void sub(double *restrict a, double *restrict b, int n) {
   int i;
 
 #pragma omp parallel for
 #pragma clang loop vectorize(disable)
-  for(i=0;i<n;i++){
+  for (i = 0; i < n; i++) {
     a[i] = a[i] + b[i];
   }
 }
Index: clang/lib/CodeGen/CGStmtOpenMP.cpp
===================================================================
--- clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -1732,8 +1732,8 @@
   const SourceRange R = S.getSourceRange();
 
   // If attributes are attached, push to the basic block with them.
-  const OMPExecutableDirective *OMPED = dyn_cast<OMPExecutableDirective>(&S);
-  const CapturedStmt *ICS = OMPED->getInnermostCapturedStmt();
+  const auto &OMPED = cast<OMPExecutableDirective>(S);
+  const CapturedStmt *ICS = OMPED.getInnermostCapturedStmt();
   const Stmt *SS = ICS->getCapturedStmt();
   const AttributedStmt *AS = dyn_cast_or_null<AttributedStmt>(SS);
   if (AS)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to