[polly] r181293 - cmake: Add target to reformat with clang-format
Tobias Grosser
grosser at fim.uni-passau.de
Tue May 7 00:30:31 PDT 2013
Author: grosser
Date: Tue May 7 02:30:31 2013
New Revision: 181293
URL: http://llvm.org/viewvc/llvm-project?rev=181293&view=rev
Log:
cmake: Add target to reformat with clang-format
Calling 'make polly-update-format' will format all Polly files with
clang-format.
Added:
polly/trunk/utils/update_format.sh (with props)
Modified:
polly/trunk/CMakeLists.txt
Modified: polly/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/CMakeLists.txt?rev=181293&r1=181292&r2=181293&view=diff
==============================================================================
--- polly/trunk/CMakeLists.txt (original)
+++ polly/trunk/CMakeLists.txt Tue May 7 02:30:31 2013
@@ -165,3 +165,6 @@ list( REMOVE_ITEM files ${jsonfiles} )
add_custom_command( OUTPUT formatting COMMAND
${CMAKE_CURRENT_SOURCE_DIR}/utils/check_format.sh ${files})
add_custom_target(polly-check-format DEPENDS formatting)
+add_custom_command( OUTPUT formatting-update COMMAND
+ ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_format.sh ${files})
+add_custom_target(polly-update-format DEPENDS formatting-update)
Added: polly/trunk/utils/update_format.sh
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/utils/update_format.sh?rev=181293&view=auto
==============================================================================
--- polly/trunk/utils/update_format.sh (added)
+++ polly/trunk/utils/update_format.sh Tue May 7 02:30:31 2013
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if ! which clang-format; then
+ echo "Error: cannot find clang-format in your path"
+ exit 1
+fi
+
+for ARG in "$@"
+ do
+ clang-format -i $ARG
+ done
Propchange: polly/trunk/utils/update_format.sh
------------------------------------------------------------------------------
svn:executable = *
More information about the llvm-commits
mailing list