[PATCH] D43204: [OpenMP] Fix trailing space when printing pragmas

Joel E. Denny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 12 12:04:17 PST 2018


jdenny created this revision.
jdenny added a reviewer: ABataev.
Herald added a subscriber: guansong.

-ast-print prints omp pragmas with a trailing space.  While this
behavior is likely of little concern to most users, surely it's
unintentional, and it's annoying for some source-level work I'm 
pursuing.  This patch focuses on omp pragmas, but it also fixes
init_seg and loop hint pragmas because they share implementation.

The testing strategy here is to add usually just one '{{$}}' per 
relevant -ast-print test file.  This seems to achieve good code
coverage.  However, this strategy is probably easy to forget as the 
tests evolve.  That's probably fine as this fix is far from critical.
The main goal of the testing is to aid the initial review.

This patch also adds a fixme for "#pragma unroll", which prints as
"#pragma unroll (enable)", which is invalid syntax.


https://reviews.llvm.org/D43204

Files:
  include/clang/Basic/Attr.td
  lib/AST/StmtPrinter.cpp
  test/Misc/ast-print-pragmas.cpp
  test/OpenMP/atomic_ast_print.cpp
  test/OpenMP/barrier_ast_print.cpp
  test/OpenMP/cancel_ast_print.cpp
  test/OpenMP/cancellation_point_ast_print.cpp
  test/OpenMP/critical_ast_print.cpp
  test/OpenMP/declare_reduction_ast_print.c
  test/OpenMP/declare_reduction_ast_print.cpp
  test/OpenMP/declare_simd_ast_print.c
  test/OpenMP/declare_simd_ast_print.cpp
  test/OpenMP/declare_target_ast_print.cpp
  test/OpenMP/distribute_ast_print.cpp
  test/OpenMP/distribute_dist_schedule_ast_print.cpp
  test/OpenMP/distribute_parallel_for_ast_print.cpp
  test/OpenMP/distribute_parallel_for_simd_ast_print.cpp
  test/OpenMP/distribute_simd_ast_print.cpp
  test/OpenMP/flush_ast_print.cpp
  test/OpenMP/for_ast_print.cpp
  test/OpenMP/for_simd_ast_print.cpp
  test/OpenMP/master_ast_print.cpp
  test/OpenMP/ordered_ast_print.cpp
  test/OpenMP/parallel_ast_print.cpp
  test/OpenMP/parallel_for_ast_print.cpp
  test/OpenMP/parallel_for_simd_ast_print.cpp
  test/OpenMP/parallel_sections_ast_print.cpp
  test/OpenMP/sections_ast_print.cpp
  test/OpenMP/simd_ast_print.cpp
  test/OpenMP/single_ast_print.cpp
  test/OpenMP/target_ast_print.cpp
  test/OpenMP/target_data_ast_print.cpp
  test/OpenMP/target_data_use_device_ptr_ast_print.cpp
  test/OpenMP/target_enter_data_ast_print.cpp
  test/OpenMP/target_exit_data_ast_print.cpp
  test/OpenMP/target_is_device_ptr_ast_print.cpp
  test/OpenMP/target_parallel_ast_print.cpp
  test/OpenMP/target_parallel_for_ast_print.cpp
  test/OpenMP/target_parallel_for_is_device_ptr_ast_print.cpp
  test/OpenMP/target_parallel_for_simd_ast_print.cpp
  test/OpenMP/target_parallel_for_simd_is_device_ptr_ast_print.cpp
  test/OpenMP/target_parallel_is_device_ptr_ast_print.cpp
  test/OpenMP/target_simd_ast_print.cpp
  test/OpenMP/target_teams_ast_print.cpp
  test/OpenMP/target_teams_distribute_ast_print.cpp
  test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp
  test/OpenMP/target_teams_distribute_parallel_for_is_device_ptr_ast_print.cpp
  test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp
  test/OpenMP/target_teams_distribute_parallel_for_simd_is_device_ptr_ast_print.cpp
  test/OpenMP/target_teams_distribute_simd_ast_print.cpp
  test/OpenMP/target_teams_distribute_simd_is_device_ptr_ast_print.cpp
  test/OpenMP/target_teams_is_device_ptr_ast_print.cpp
  test/OpenMP/target_update_ast_print.cpp
  test/OpenMP/task_ast_print.cpp
  test/OpenMP/taskgroup_ast_print.cpp
  test/OpenMP/taskloop_ast_print.cpp
  test/OpenMP/taskloop_simd_ast_print.cpp
  test/OpenMP/taskwait_ast_print.cpp
  test/OpenMP/taskyield_ast_print.cpp
  test/OpenMP/teams_ast_print.cpp
  test/OpenMP/teams_distribute_ast_print.cpp
  test/OpenMP/teams_distribute_parallel_for_ast_print.cpp
  test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp
  test/OpenMP/teams_distribute_simd_ast_print.cpp
  test/OpenMP/threadprivate_ast_print.cpp
  test/PCH/pragma-loop.cpp
  utils/TableGen/ClangAttrEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43204.133910.patch
Type: text/x-patch
Size: 54173 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180212/9888afa6/attachment-0001.bin>


More information about the cfe-commits mailing list