Generate a unique filename for a given header

This patch is in preparation for writing the header replacement to disk.
Added getUniqueHeaderName() that generates a unique header filename in
the same directory as the header file.

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


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186007 91177308-0d34-0410-b5e6-96231b3b80d8
cpp11-migrate: Add missing file headers in unit tests

Differential: http://llvm-reviews.chandlerc.com/D1124
Author: Guillaume Papin <guillaume.papin@epitech.eu>



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186093 91177308-0d34-0410-b5e6-96231b3b80d8
cpp11-migrate: FileOverrides/Transform refactoring.

This commit include the following changes:
 - SourceOverrides is now a class
   - it simplifies the usage for the Transform class, since now the
     replacements can be applied directly to the file overrides with
     SourceOverrides::applyReplacements().
   - it contains a method applyRewrites() which was previously named
     collectResults() in Transform.cpp. The method has been "optimized"
     a bit to re-use the allocated buffer (std::string::clear() is called).
   - since the class has some logic it's now unit tested
 - Now FileOverrides is a class (not a std::map typedef) and store pointers
   to the SourceOverrides. The reason is that the SourceOverrides can't be
   copied anymore (which was already something to avoid since it's can be a
   quite large object).

Author: Guillaume Papin <guillaume.papin@epitech.eu>

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


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186161 91177308-0d34-0410-b5e6-96231b3b80d8
Fix UseAuto not transforming iterator when non-fully qualifiers are used and
using inline namespaces is specified.

UseAuto used to fail to transform iterators when using inline namespaces and
non-fully qualified types, relying on a using directive previously declared.
- This fix uses the already define isFromStdNamespace matcher.
- Fixed tests and added a new test using inline namespaces.
- Added CustomMatchers to reuse common matchers among transforms.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186327 91177308-0d34-0410-b5e6-96231b3b80d8
Update for llvm API change.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186449 91177308-0d34-0410-b5e6-96231b3b80d8
cpp11-migrate: Use test fixture in preparation for more tests

Existing tests are not changed but the set-up work is moved into a fixture
to simplify forthcoming new tests.



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186575 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed some formatting issues with clang-format to get a baseline.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186675 91177308-0d34-0410-b5e6-96231b3b80d8
cpp11-migrate: Make a VirtualFilesHelper class for the unit tests.

This change makes it easier for new unit tests to create virtual files.

Author: Guillaume Papin <guillaume.papin@epitech.eu>



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186842 91177308-0d34-0410-b5e6-96231b3b80d8
cp11-migrate: Integration with LibFormat

Adding a feature to optionally reformat code changed by the migrator. Like
LibFormat, can choose between built-in styles (LLVM, Mozilla, Google, Chromium)
or use a YAML-format config file.

Author: Guillaume Papin <guillaume.papin@epitech.eu>



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186866 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "cp11-migrate: Integration with LibFormat"

This reverts commit r186866.

This breaks the build and the original author Guillaume Papin
<guillaume.papin@epitech.eu> asked me to revert so he could look at it more with
revane.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186873 91177308-0d34-0410-b5e6-96231b3b80d8
cp11-migrate: Integration with LibFormat
    
Adding a feature to optionally reformat code changed by the migrator. Like
LibFormat, can choose between built-in styles (LLVM, Mozilla, Google, Chromium)
or use a YAML-format config file.

Now with no dependency on iostream by the Reformatting.cpp LIT test.

Author: Guillaume Papin <guillaume.papin@epitech.eu>



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186938 91177308-0d34-0410-b5e6-96231b3b80d8
Fix doxygen warnings
It seems that doxygen fails to find overloaded methods when the parameters are
not in sync with the method declaration.
Added the fully-qualifed type to the parameters method definition although it's
not necessary since the using directive is in effect.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@186948 91177308-0d34-0410-b5e6-96231b3b80d8
test commit

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@187038 91177308-0d34-0410-b5e6-96231b3b80d8
cpp11-migrate: Register the transforms automatically using llvm::Registry

With this change each transform now register a factory. The factories are
registered using an llvm::Registry which makes them available globally.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@187041 91177308-0d34-0410-b5e6-96231b3b80d8
cpp11-migrate: Fix build break on Windows introduced in r187041.

r187041 changed the way the transform are created and the order the transformed
are applied "may" have changed as well (no specific constraints exist on the
order). This produced a test failure on the Windows buildbot.

Now the test use -std=c++11, so 'nullptr' is defined and the test is not anymore
dependent on the order the transforms are applied.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@187048 91177308-0d34-0410-b5e6-96231b3b80d8
Fix doxygen warnings
Doxygen doesn't recognize <blockquote> html tags. Added support for <blockquote>
and Markdown was introduce with doxygen 1.8.0. This patch replaces blockquote
with \par for compatibility with previous versions.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@187067 91177308-0d34-0410-b5e6-96231b3b80d8
cpp11-migrate: Tweak lit tests to avoid false negatives

Recent failures on a freebsd buildbot indicated a weakness in the
Reformatting.cpp lit test. Tweaking the test to avoid false negatives and
hopefully make the buildbot happy.



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@187153 91177308-0d34-0410-b5e6-96231b3b80d8
cpp11-migrate: Write header replacements to disk

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 file
 - Transform ID that generated the replacement
 - Offset
 - Length
 - Replacement text

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

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


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@187204 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "cpp11-migrate: Write header replacements to disk"

This reverts commit 187204. It broke the freebsd bots:

http://lab.llvm.org:8011/builders/clang-X86_64-freebsd/builds/9561

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@187227 91177308-0d34-0410-b5e6-96231b3b80d8
Added new feature for checking macro and preprocessor conditional consistency.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@187228 91177308-0d34-0410-b5e6-96231b3b80d8