Commit Graph

303 Commits

Author SHA1 Message Date
Eric Christopher 35c6b614ea Temporarily revert r189363 as it seems to be failing to build.
llvm-svn: 189387
2013-08-27 17:26:07 +00:00
Guillaume Papin dcdae946f3 cpp11-migrate: Add Pass-By-Value Transform
Currently only constructor parameters stored in class-local storage are modified
to make use of the pass-by-value idiom but this is a base that can be be further
improved to handle more situations.

llvm-svn: 189363
2013-08-27 16:11:26 +00:00
Guillaume Papin 64feb39b1b cpp11-migrate: Add a class to support include directives modifications
The IncludeDirectives class helps with detecting and modifying #include
directives. For now it allows the users to add angled-includes in a source file.
This is a start for this class that will evolve in the future to add more
functionality.

This should fix the reverted commit r189037 (buildbot failures on Windows).

llvm-svn: 189354
2013-08-27 14:50:26 +00:00
Tareq A. Siraj 1175552853 clang-replace: Delete change description files
Added a command line option "-remove-change-desc-files" that triggers
the deletion of the change description files after merging and applying
regardless of success.

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

llvm-svn: 189268
2013-08-26 19:58:59 +00:00
John Thompson 9e8d672206 Updated the main comment with respect to problems and future directions.
llvm-svn: 189229
2013-08-26 15:55:47 +00:00
John Thompson 8e01c069c9 Fixed some issues that resulted in erroneous duplicate symbol error messages.
llvm-svn: 189228
2013-08-26 15:17:23 +00:00
Edwin Vane 9f7a1c10ea clang-replace: Layout of test directory now more standard
Test-time dependencies now live within test/clang-replace/Inputs which is more
in line with llvm and clang test suites.

Added 'Inputs' to the lit config's 'exclude' list as with llvm's lit.cfg since
test-time dependencies should not have any lit scripts within.

llvm-svn: 189047
2013-08-22 19:44:07 +00:00
Guillaume Papin 883a2b2427 Revert "cpp11-migrate: Add a class to support include directives modifications"
This reverts commit r189017.

It broke the windows bots:
- http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/4176
- http://bb.pgr.jp/builders/cmake-clang-i686-mingw32/builds/3837

llvm-svn: 189037
2013-08-22 18:20:03 +00:00
Edwin Vane 69948e4155 clang-replace: Exclude test-time deps from LIT test suite
Subdirectories of test/clang-replace contain test-time dependencies and not
more LIT tests. Tell LIT to ignore these directories from the test suite.

llvm-svn: 189019
2013-08-22 15:04:34 +00:00
Guillaume Papin effabf9691 cpp11-migrate: Add a class to support include directives modifications
The IncludeDirectives class helps with detecting and modifying #include
directives. For now it allows the users to add angled-includes in a source file.
This is a start for this class that will evolve in the future to add more
functionality.

This should fix the reverted commit r188791 (buildbot failures on Windows).

llvm-svn: 189017
2013-08-22 14:49:07 +00:00
Edwin Vane 1106ef2a69 clang-replace: Write merged changes to disk
Functionality for clang-replace completed with the addition of the ability to
write merged replacements to disk.

Test added.

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

llvm-svn: 189014
2013-08-22 13:40:32 +00:00
Edwin Vane 3bf14cebee Introducing new tool clang-replace
Introducing new tool 'clang-replace' that finds files containing
serialized Replacements and applies those changes after deduplication
and detecting conflicts.

Currently the tool does not apply changes. It stops just after the
deduplication and conflict report phase. Forthcoming patches will
complete functionality.

Both build systems updated for new tool.

Includes a conflict test case.

clang-replace added to Doxygen build.

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

llvm-svn: 189008
2013-08-22 13:07:14 +00:00
Eli Friedman a4ff59a7f8 Adjust for r188968.
llvm-svn: 188970
2013-08-22 00:48:18 +00:00
Edwin Vane d2cd2a4e1e cpp11-migrate: Use Replacement serialization from clang::tooling
Serialization of replacements has been moved to clang::tooling.

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

llvm-svn: 188820
2013-08-20 19:20:52 +00:00
NAKAMURA Takumi 166b874696 UniqueHeaderNameTest.cpp: Appease valgrind.
llvm::sys::path::native(dst, dst) might be overridden-safe in most cases, though.

llvm-svn: 188800
2013-08-20 14:02:38 +00:00
Guillaume Papin 1593c7b20a Revert "cpp11-migrate: Add a class to support include directives modifications"
This reverts commit r188791.

The Windows bots are still broken.

llvm-svn: 188795
2013-08-20 13:05:57 +00:00
Guillaume Papin f240481b99 cpp11-migrate: Add a class to support include directives modifications
The IncludeDirectives class helps with detecting and modifying #include
directives. For now it allows the users to add angled-includes in a source file.
This is a start for this class that will evolve in the future to add more
functionality.

This should fix the reverted commit r188610 (buildbot failures on Windows).

llvm-svn: 188791
2013-08-20 12:30:26 +00:00
Alexey Samsonov f656e1783b Add dependencies on TransformUtils library in preparation for re-applying r188666
llvm-svn: 188674
2013-08-19 13:58:56 +00:00
Guillaume Papin 8d951fbc18 Revert "cpp11-migrate: Add a class to support include directives modifications"
This reverts commit r188610.

Issue with the absolute include paths not found in the unit tests on the Windows
bots. Needs investigation.

llvm-svn: 188611
2013-08-17 19:04:56 +00:00
Guillaume Papin 114d035521 cpp11-migrate: Add a class to support include directives modifications
The IncludeDirectives class helps with detecting and modifying #include
directives. For now it allows the users to add angled-includes in a source file.
This is a start for this class that will evolve in the future to add more
functionality.

llvm-svn: 188610
2013-08-17 18:48:31 +00:00
Ariel J. Bernal 2203559c3e Use -std=c++11 when no compilation database is provided
Allow the migrator to be used without specifing --. If neither -- nor -p is
provided and no compilation database can be detecteded from the first source
file path then -std=c++11 is added as the only compiler argument.

llvm-svn: 188533
2013-08-16 04:40:44 +00:00
Edwin Vane 169eec3620 cpp11-migrate: Remove mention of 'headers' from serialization code
* HeaderChangeDocument -> MigratorDocument
* HeaderFileName -> TargetFile
* SourceFileName -> MainSourceFile
* Removed TransformID
* Comments updated, at least with respect to serialization
* Unit tests updated.

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

llvm-svn: 188404
2013-08-14 19:02:28 +00:00
Tareq A. Siraj e5b3eb70e5 cpp11-migrate: Fixing doxygen warnings
For some reason doxygen doesn't seem to like the using namespace
clang::tooling in the source file and complaints about missing class
members.

Also fixed missing parameter documentation for TransformName in
SourceOverrides::applyReplacements().

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

llvm-svn: 188394
2013-08-14 17:47:39 +00:00
Edwin Vane bc7dc8d51f cpp11-migrate: Fix silly logic error preventing multiple transforms
A missed clause in an error test added in r188371 caused any use of the
migrator requesting multiple transforms to fail.

llvm-svn: 188374
2013-08-14 15:09:44 +00:00
Edwin Vane 4b68a0d5a0 cpp11-migrate: Adding -yaml-only option
For use with -headers, -yaml-only will cause cpp11-migrate to not write header
changes to disk and instead write them as header change description files. This
option facilitiates upcoming functionality to properly support changing headers
as part of migration.

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

llvm-svn: 188371
2013-08-14 14:52:45 +00:00
Benjamin Kramer 262b338519 \param is not for referring to arguments.
Found by -Wdocumentation.

llvm-svn: 188368
2013-08-14 10:21:47 +00:00
NAKAMURA Takumi db2162903e clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp: Use "%/t" instead of "%t" on sed(1) to avoid \'s expanded to control chars.
The feature, "%/t", has been introduced in llvm/lit since r188348.

llvm-svn: 188349
2013-08-14 02:28:25 +00:00
NAKAMURA Takumi 7a8317fff5 clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp: Use FileCheck instead of grep(1).
llvm-svn: 188347
2013-08-14 02:26:03 +00:00
NAKAMURA Takumi b31493d60c clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp: Suppress this on win32, for now. Investigating.
llvm-svn: 188345
2013-08-14 01:20:33 +00:00
John Thompson 922734c661 Enhanced test for header guards.
llvm-svn: 188308
2013-08-13 18:26:40 +00:00
John Thompson c8d710cc82 Avoid errors on header guards using #if defined(NAME).
llvm-svn: 188306
2013-08-13 18:11:36 +00:00
Tareq A. Siraj 8e1c269a61 Fixes test failure on darwin introduced by r188274
Reworked how the tests dealt with paths. Instead of removing the full path name,
put a marker in the expected file and replace the marker with the full path
before running diff.

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

llvm-svn: 188299
2013-08-13 17:53:00 +00:00
Tareq A. Siraj 3baabf3968 cpp11-migrate: Write header replacements to disk
Another attempt to commit r187204 after windows related problems has
been fixed. Note that changes to this patch reflect the current behavior
of cpp11-migrate.

Header replacements are now written to disk in YAML format for an external tool
to merge. A unique file will be created in the same directory as the header
with all replacements that came from a source file that included the header
file. The YAML file will have:
- Name of the header file
- Name of the source file that included the header file
- Transform ID that generated the replacement
- Offset
- Length
- Replacement text

Any tool reading these replacements should read them using the
HeaderChangeDocument struct.

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

llvm-svn: 188274
2013-08-13 14:58:50 +00:00
Nico Weber 8e20be2aea Remove CRs added in r187370.
llvm-svn: 188168
2013-08-12 11:43:36 +00:00
Tareq A. Siraj 9111258ad7 cpp11-migrate: Fixed path problem with include/exclude paths
This fixes a problem when the path separator in the include/exclude
directory is different (e.g. "\" vs. "/") from the path separator in
the file path we are modifying.

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

llvm-svn: 188094
2013-08-09 19:24:05 +00:00
Daniel Dunbar 4d0a3ef6a3 [tests] Update to use lit_config and lit package, as appropriate.
llvm-svn: 188092
2013-08-09 18:49:22 +00:00
John Thompson bb0a3b0668 Fixed coding convention naming issue - variable names start with uppercase.
llvm-svn: 188070
2013-08-09 13:52:09 +00:00
John Thompson 91555bde88 Fix false error message for function-style macro instance used as arguments in other function-style macros instances, and add test for it.
llvm-svn: 188036
2013-08-09 00:22:20 +00:00
John Thompson 4fa9c2cbc6 Extend comments for problems and future directions.
llvm-svn: 188035
2013-08-09 00:19:03 +00:00
David Blaikie 001ba2ec0b Fix speling.
Patch by Richard (legalize@xmission.com)

llvm-svn: 187990
2013-08-08 16:49:52 +00:00
John Thompson ba6c662669 Expanded modularize tests.
llvm-svn: 187943
2013-08-08 00:01:09 +00:00
John Thompson 181ea2e957 Comment changes. Added current problems comment.
llvm-svn: 187942
2013-08-08 00:00:10 +00:00
John Thompson 4ed963a0ba Fixed incorrect header guard/nested header mechanism.
llvm-svn: 187898
2013-08-07 18:49:47 +00:00
John Thompson d2a0600279 Fix comment typo.
llvm-svn: 187796
2013-08-06 14:05:43 +00:00
John Thompson 428ad10623 Add test for header guard work-around.
llvm-svn: 187759
2013-08-06 00:17:40 +00:00
John Thompson 48df096c3f Fixed uninitialized member, plus recommit of 187736.
llvm-svn: 187757
2013-08-05 23:55:14 +00:00
Arnold Schwaighofer 30448e607e Reverting r187736. It broke some public bots:
http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/10248
http://bb.pgr.jp/builders/cmake-clang-i686-mingw32/builds/3327

llvm-svn: 187746
2013-08-05 22:03:41 +00:00
John Thompson ea8e668516 Fixed incorrect include file exit detection. Added work-around to avoid error on header guard in nested include. Fixed a couple of coding standard issues on variable names.
llvm-svn: 187736
2013-08-05 19:15:50 +00:00
Benjamin Kramer d989ef4373 clang-tidy's modules depend on it.
Fixes shared cmake build.

llvm-svn: 187708
2013-08-04 16:06:43 +00:00
Daniel Jasper 89bbab09dd Fix clang-tidy dependencies and bad file comment.
This addresses comments in post-commit review of r187345.

llvm-svn: 187707
2013-08-04 15:56:30 +00:00