Commit Graph

24 Commits

Author SHA1 Message Date
Alp Toker a3c494f0db Revert "clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]"
We've decided to make the core rewriter class and PP rewriters mandatory.
They're only a few hundred lines of code in total and not worth supporting as a
distinct build configuration, especially since doing so disables key compiler
features.

This reverts commit r213150.

Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter."

This reverts commit r213148.

Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/"

This reverts commit r213146.

llvm-svn: 213159
2014-07-16 15:12:48 +00:00
NAKAMURA Takumi 692d6bb544 clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.
llvm-svn: 213148
2014-07-16 13:36:39 +00:00
Daniel Jasper 553d4878da clang-format: Introduce style with spaces on both sides of */&.
Patch by Janusz Sobczak (slightly extended).
This fixes llvm.org/19929.

llvm-svn: 211098
2014-06-17 12:40:34 +00:00
Rafael Espindola 374597abfc Allow lowercase messages in this test again.
I misunderstood where the message was being converted.

llvm-svn: 210774
2014-06-12 12:40:04 +00:00
Rafael Espindola d0136707a9 Give clang-format its own error category.
The posix errno values are probably to the best thing to use for
describing parse errors.

This should also fix the mingw build.

llvm-svn: 210739
2014-06-12 02:50:04 +00:00
Rafael Espindola a8aef53849 Accomodate for message differences on windows.
llvm-svn: 210722
2014-06-11 23:53:06 +00:00
Daniel Jasper 94ea5bb115 clang-format: Add basic test for -style=none.
llvm-svn: 209447
2014-05-22 15:13:48 +00:00
Daniel Jasper e1d9141433 clang-format: Explicitly set fallback style that is tested.
llvm-svn: 196213
2013-12-03 06:48:41 +00:00
Alexander Kornienko bc4ae44928 Added an option to specify fallback style.
Summary:
Added -fallback-style option. Changed clang-format to stop searching
for .clang-format when an invalid file is found.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D2292

llvm-svn: 196108
2013-12-02 15:21:38 +00:00
Alexander Kornienko cabdd738fc Added LanguageStandard::LS_JavaScript to gate all JS-specific parsing.
Summary:
Use LS_JavaScript for files ending with ".js". Added support for ">>>="
operator.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D2242

llvm-svn: 195961
2013-11-29 15:19:43 +00:00
Bill Wendling ef9315d942 Disable this check temporarily.
This is failing for me. When I run the command on my own, I get this:

Error reading /usr/local/google/home/morbo/llvm/llvm.obj/tools/clang/test/Format/Output/.clang-format: Invalid argument
void f() {
  int* i;
  int j;
}

The formatting is like this because I have the Google format version in my
~/.clang-format file. This test should be made independent of that.

llvm-svn: 195080
2013-11-19 02:25:28 +00:00
Hans Wennborg 9f6581bb88 Allow _clang-format as alternative to .clang-format config filename
Dotfiles are impractical on Windows. This makes clang-format search
for the style configuration file as '_clang-format' in addition to
the usual '.clang-format'. This is similar to how VIM searches for
'_vimrc' on Windows.

Differential Revision: http://llvm-reviews.chandlerc.com/D1629

llvm-svn: 190413
2013-09-10 15:41:12 +00:00
Alexander Kornienko 22479f7d99 Trying to fix tests with in-tree builds, that contain a .clang-format files in
both tools/clang and llvm directories.

llvm-svn: 189761
2013-09-02 14:25:56 +00:00
Alexander Kornienko 9acf3dbf1d Test for empty .clang-format file.
Summary: Test clang-format's handling of empty .clang-format files.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D1562

llvm-svn: 189757
2013-09-02 13:44:16 +00:00
Chandler Carruth bc36e6e099 Switch the default mode for clang-format to '-file'. Make 'LLVM' the
fallback syntax used when we fail to find a '.clang-format' file. Adjust
variable names appropriately.

Update the editor integration pieces that specify a '-style' option to
specify it as '-style=file'. I left the functionality in place because
even if the preferred method is to use '.clang-format' files, this way
if someone needs to clobber the style in their editor we show how to do
so in these examples.

Also check in a '.clang-format' file for Clang to ensure that separate
checkouts and builds of Clang from LLVM can still get the nice
formatting. =] This unfortunately required nuking the test for the
absence of a '.clang-format' file as now the directory happening to be
under your clang source tree will cause there to always be a file. ;]

llvm-svn: 189741
2013-09-02 07:42:02 +00:00
Daniel Dunbar 14e88a1577 [tests] Use 'printf' instead of 'echo -e', which is not part of BSD echo.
llvm-svn: 189562
2013-08-29 03:02:39 +00:00
Alexander Kornienko a49732ff28 Added -lines X:Y option to specify line range to process. This is a more human-friendly alternative to -offset and -length.
Differential Revision: http://llvm-reviews.chandlerc.com/D1160

llvm-svn: 186625
2013-07-18 22:54:56 +00:00
Rafael Espindola 925213b0fa Add 'not' to commands that are expected to fail.
This is at least good documentation, but also opens the possibility of
using pipefail.

llvm-svn: 185652
2013-07-04 16:16:58 +00:00
Daniel Jasper 2a250b8b49 Let clang-format move the cursor appropriately.
With this patch, clang-format will try to keep the cursor at the
original code position in editor integrations (implemented for emacs and
vim). This means, after formatting, clang-format will try to keep the
cursor on the same character of the same token.

llvm-svn: 182373
2013-05-21 12:21:39 +00:00
Alexander Kornienko 006b5c89ce Clang-format: allow -style="{yaml/json}" on command line
Summary: + improved handling of default style and predefined styles.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D813

llvm-svn: 182205
2013-05-19 00:53:30 +00:00
Daniel Jasper d2ae41a7c6 Remove diagnostics from clang-format.
We only ever implemented one and that one is not actually all that
helpful (e.g. gets incorrectly triggered by macros).

llvm-svn: 181871
2013-05-15 08:14:19 +00:00
Alexander Kornienko 3fbee010c6 clang-format support for multiple input files.
Summary:
Added support for multiple input files, that can be used both with and
without in-place edit (-i) option. Added checks for -offset and -length options:
don't allow them on multiple files, check that they don't fall outside input
file, made both options unsigned, so that there's no need to check for negative
values. Removed "-1 can be used for end-of-file" from -length description.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D719

llvm-svn: 180185
2013-04-24 12:46:44 +00:00
Daniel Jasper 92a3130509 Provide better emacs integration.
The new emacs integration is simpler, does not save the current file
before reformatting and ensures that emacs does not scroll as a result
of formatting.

Also explicitly set the style in clang-format tests to make them more
robust.

llvm-svn: 179372
2013-04-12 10:12:01 +00:00
Daniel Jasper b7fb5e6f4b Re-add clang-format tests to clang/test.
Also now use -strict-whitespace as the tests are confusing otherwise.

llvm-svn: 177853
2013-03-25 09:14:25 +00:00