Commit Graph

73 Commits

Author SHA1 Message Date
NAKAMURA Takumi 6fb75e08e5 test/remove-cstr-calls/basic.cpp: Disable again on mingw. It behaves unstable.
llvm-svn: 173562
2013-01-26 06:39:48 +00:00
NAKAMURA Takumi fc37344916 Drop "REQUIRES:shell" in tests. They can run on win32.
llvm-svn: 173415
2013-01-25 04:33:40 +00:00
Edwin Vane 44c3145938 Add use-nullptr transform to cpp11-migrate
This transform converts the usage of null pointer constants (e.g. NULL, 0,
etc.) in legacy C++ code and converts them to use the new C++11 nullptr
keyword.
- Added use-nullptr transform.
- Added C++11 support to the final syntax check. Used ArgumentAdjuster class to
  add -std=c++11 option to the command line options.
- Added tests for use-nullptr transform.
- Added tests that exercises both loop-convert and use-nullptr in the source
  file.

TODO: There's a known bug when using both -loop-convert and -use-nullptr at the
      same time.

Author: Tareq A Siraj <tareq.a.siraj@intel.com>
Reviewers: klimek, gribozavr
llvm-svn: 173178
2013-01-22 18:31:49 +00:00
Chris Lattner 28b00bffd2 these need the bitcode reader as well.
llvm-svn: 172908
2013-01-19 18:45:35 +00:00
Chandler Carruth 06e24e34a9 Re-sort the #include lines which have gotten out of order.
llvm-svn: 172895
2013-01-19 09:10:38 +00:00
NAKAMURA Takumi 40ac112c91 Introduce llvm::sys::PrintStackTraceOnErrorSignal()
llvm-svn: 172821
2013-01-18 14:31:00 +00:00
Dmitri Gribenko 3de75d7c7c Fix a -Wdocumentation warning (empty paragraph passed to '\brief' command)
llvm-svn: 172661
2013-01-16 22:10:09 +00:00
Edwin Vane 862fec8835 Write transform results to disk only once
Instead of writing the result of each transform to disk for every
transform, write the results to buffers in memory and pass those buffers
to the next transform as input. Only write the buffers to disk if the
final syntax check passes.

Reviewers: klimek
llvm-svn: 172657
2013-01-16 21:11:50 +00:00
Daniel Jasper 9f4a1c6184 Add temporary option to invert the */& binding in a specific style.
This is temporarily necessary until styles are configurable through files
as it seems to be a contentious issue.

llvm-svn: 172546
2013-01-15 18:56:19 +00:00
Alexander Kornienko 02fd3ad24b Test source file name in diagnostics
llvm-svn: 172434
2013-01-14 17:01:57 +00:00
Daniel Jasper 51ce63cd98 Add support for Chromium style.
llvm-svn: 172432
2013-01-14 16:26:38 +00:00
Edwin Vane d44cbf7d09 Adding a .gitignore to tools-extra
Reviewers: klimek

llvm-svn: 172414
2013-01-14 14:20:19 +00:00
Alexander Kornienko 92bb086fba Added a test for clang-format diagnostics.
llvm-svn: 172407
2013-01-14 13:57:05 +00:00
Alexander Kornienko 79f49456fa Fix: correct file name in diagnostics.
llvm-svn: 172405
2013-01-14 13:40:44 +00:00
Edwin Vane bfbd10b329 Update users of RefactoringTool
RefactoringTool::run() no longer writes changes to disk automatically. Updating users of RefactoringTool to explicitly perform the write.
    
Reviewers: klimek

llvm-svn: 172218
2013-01-11 17:04:09 +00:00
Nico Weber e5d643d21c Remove FIXME fixed by djasper in r172066.
llvm-svn: 172097
2013-01-10 19:48:53 +00:00
Alexander Kornienko 92465285ab Format what you can when errors are found
llvm-svn: 172075
2013-01-10 15:19:44 +00:00
Edwin Vane 86c63d94bb Removing loop-convert tool
cpp11-migrate now contains the loop convert transform code and tests.
Cleaning up the old code/tests and updating build system files as
necessary.

Reviewers: klimek
llvm-svn: 172074
2013-01-10 15:19:11 +00:00
Alexander Kornienko 5b64279192 Improved clang-format integration support for diagnostic messages output
llvm-svn: 172072
2013-01-10 15:06:57 +00:00
Daniel Jasper 494394d817 Let clang-format binary use same LangOpts as test.
llvm-svn: 172066
2013-01-10 13:09:09 +00:00
Alex Rosenberg eb8360003b Add .arcconfig for Arcanist support for Phabricator
llvm-svn: 172043
2013-01-10 04:12:08 +00:00
Alex Rosenberg 0b18a095cf Fix comment
llvm-svn: 172042
2013-01-10 04:12:06 +00:00
Daniel Jasper abf4cce40f Simplify reversed for-loop.
llvm-svn: 171998
2013-01-09 20:46:42 +00:00
Daniel Jasper 46e432fb8a Initial version of diff/patch-reformat tool.
Use at your own risk :-).

llvm-svn: 171994
2013-01-09 20:20:11 +00:00
Manuel Klimek 3a449891ba Implements the features requested in PR14679.
- adds '-h' as an alias for '-help'.
- adds an optional <file> argument
- adds an option -i to in-place edit the given file
- adds a help text to explain what the tool does

llvm-svn: 171858
2013-01-08 15:19:57 +00:00
Edwin Vane 31896624da Transferred loop-convert tests to cpp11-migrate
- Turned off -count-only tests as they aren't supported in cpp11-migrate
  yet.
- Updated tests to use new binary name and options to access
  loop-convert transform.
- Fixed header guards to not use restricted names.

Reviewers: klimek, gribozavr
llvm-svn: 171852
2013-01-08 14:36:29 +00:00
Nico Weber 48e75f7e48 Enabled ObjC2 in clang-format for @package. Matches r171766.
llvm-svn: 171767
2013-01-07 19:08:19 +00:00
Nico Weber d9a440d21f Set LangOpts.ObjC1 to 1 in clang-format.
This matches the test change done in clang at r171742. Without this,
clang-format would strip '@' characters and format e.g. '@interface' as
'interface'.

llvm-svn: 171743
2013-01-07 15:21:13 +00:00
Daniel Jasper f7b48b6342 Make clang-format binary understand C++11.
llvm-svn: 171736
2013-01-07 14:52:14 +00:00
Chandler Carruth 08116a7df3 Add a namespace qualifier to the befriending statement for
RecusiveASTVisitor. With Clang and modern GCCs this was found through
the injected class name of the base class but older GCCs don't properly
implement the injected class name rules.

llvm-svn: 171593
2013-01-05 02:57:54 +00:00
Edwin Vane dde168b8b5 Port loop-convert into cpp11-migrate
Took existing code from loop-convert tool and made it into a cpp11-migrate
transform. Pattern now set for having transform code in subdirectories. Related
changes:
- Makefile and CMakeLists.txt updated to support source files in
  subdirectories.
- At least one transform must be specified. syntax-only tests removed to
  reflect this.
- TODO: port over loop-convert tests.

Reviewers: klimek, silvas
llvm-svn: 171481
2013-01-04 18:25:18 +00:00
Daniel Jasper f0273f8e15 Handle segfaults in clang-format vim-integration.
A segfault used to clear the entire buffer. With this change, a message
to report a bug is displayed instead.

This should solve most cases similar to llvm.org/PR14774.

llvm-svn: 171480
2013-01-04 18:24:12 +00:00
Chandler Carruth 54e147a933 Fix the sorting of the #include lines in these tools.
This is done with the script in llvm/utils/sort_includes.py

llvm-svn: 171365
2013-01-02 10:29:31 +00:00
NAKAMURA Takumi 43632a26a5 Update the copyright coredits -- Happy new year 2013!
llvm-svn: 171342
2013-01-01 10:00:19 +00:00
Chandler Carruth 5826f96e51 Teach the extras repository to actually install the clang-format tool.
We should also install the clang-format.py script somewhere that makes
since for a Vim integration script. I don't know where that is though,
so just installing the binary for now. This is enough to let me use the
script from a checkout combined with the installed (and thus less likely
to crash or be slow) clang-format binary.

llvm-svn: 171164
2012-12-27 17:48:37 +00:00
Edwin Vane 9e3c9de527 Use renamed CommonOptionsParser member functions
GetCompilations() and GetSourcePathLists() were renamed to match LLVM style.

Reviewed By: Alexander Kornienko

llvm-svn: 170230
2012-12-14 18:59:24 +00:00
Edwin Vane 3d97cc4c57 Add cpp11-migrate to autoconf build
llvm-svn: 169986
2012-12-12 16:08:10 +00:00
Edwin Vane 9bd2e1bacc Initial commit for cpp11-migrate tool
- Added directory structures and build system files for the new tool.
- Extremely basic implementation of tool performs only an initial syntax check.
- Basic tests ensure syntax test works as expected.

llvm-svn: 169983
2012-12-12 14:30:57 +00:00
Daniel Jasper 79e68bcf0e Basic clang-format vim-integration.
File contains installation and usage instructions.

llvm-svn: 169421
2012-12-05 21:06:08 +00:00
Daniel Jasper 95b089e287 Fix make build (hopefully).
llvm-svn: 169371
2012-12-05 10:22:07 +00:00
Daniel Jasper ff1491322e First version of a command line clang-format tool.
Reads a single source range (offset, length) as well as the style guide
as parameters and then reformats everything it receives from stdin.

llvm-svn: 169364
2012-12-05 09:01:09 +00:00
Chandler Carruth 9b1773b517 Update the #include lines of the extra tools.
llvm-svn: 169239
2012-12-04 09:21:50 +00:00
Edwin Vane 0254657c2d Test commit: reformat comment.
llvm-svn: 169126
2012-12-03 14:32:13 +00:00
Manuel Klimek 61a928720a Following the example from loop-convert tests, simplifying the remove-cstr-calls lit script.
Patch by Edwin Vane.

llvm-svn: 167390
2012-11-05 18:28:45 +00:00
NAKAMURA Takumi 9a37b94c95 Remove a trailing blank line, test commit.
llvm-svn: 165621
2012-10-10 14:06:15 +00:00
David Blaikie 149bf5d8a8 Fix typo in a comment in lit.cfg
Matches the same typo fix in clang's lit.cfg that this was copy/pasted from.

(original fix to clang's lit.cfg in r163696)

llvm-svn: 163718
2012-09-12 16:29:37 +00:00
David Blaikie d7086fb347 Make lit.cfg like the other lit.cfgs so it can be run standalone.
Relies on matching lit change in r163171.

llvm-svn: 163172
2012-09-04 22:23:37 +00:00
Ted Kremenek 8f6943c2e6 Update Makefiles to reflect split of clangRewrite.a into two libraries.
llvm-svn: 163056
2012-09-01 07:44:41 +00:00
David Blaikie 50174dc642 Add loop-convert to the Make build.
Hey, now the loop-convert tests pass too.

llvm-svn: 163015
2012-08-31 19:46:47 +00:00
David Blaikie efae14e96c Fix tests to be more robust (to older versions of grep, lesser lit-like test runners, etc)
Seems I had a problem with my version of grep, when run by lit, not supporting
the \s escape. This seems to fix it for me & I'll be getting the buildbots to
run these tests too to keep an eye on them (actually loop-convert tests still
fail when run via a make build, so that'll be addressed in a future commit). I
could use [[:space:]] to generalize over other whitespace but that seemed
unnecessarily verbose when the flexibility wasn't actually required by the
current text of the tests.

Also I just simplified a lot of the loop-convert tests (removing the
unecessary temp file deletion at the start, removing the unnecessary && for
FileCheck, etc).

The remove-cstr-calls/basic.cpp changes were necessitated by an out of tree
lit-like test runner that's a bit less fantastic about escaping. They were
modeled on existing tooling test cases in Clang, with thanks to Manuel Klimek
for the pointers.

llvm-svn: 163009
2012-08-31 17:49:33 +00:00