llvm-project/clang-tools-extra/cpp11-migrate
Edwin Vane c383960be9 Don't replace macro usage if macro body has NULL
In case of macro body expansion, check to see if the macro is named NULL and
don't replace inside the macro body. This fixes the case when NULL appears
inside the macro body and the transform replaces the usage of the macro with
nullptr. This is an easy fix for the problem for now and we should analyze the
macro body to see if it expands to only NullToPointer in the future for a more
robust solution that takes care of user defined macros that behaves like NULL.

Other changes:
- Moved complex macro tests to macros.cpp
- Added new test cases.
- Added checks to make sure that the macro bodies are not modified by the tool.

Fixes: PR15396

Author: Tareq A Siraj <tareq.a.siraj@intel.com>
llvm-svn: 177422
2013-03-19 18:47:03 +00:00
..
LoopConvert Extend loop variable naming checks 2013-03-08 14:15:18 +00:00
UseAuto Fixing Doxygen warnings in cpp11-migrate 2013-03-08 19:12:12 +00:00
UseNullptr Don't replace macro usage if macro body has NULL 2013-03-19 18:47:03 +00:00
CMakeLists.txt Introducing Use-Auto transform for cpp11-migrate 2013-02-28 16:29:24 +00:00
Cpp11Migrate.cpp Fixing Doxygen warnings in cpp11-migrate 2013-03-08 19:12:12 +00:00
Makefile Introducing Use-Auto transform for cpp11-migrate 2013-02-28 16:29:24 +00:00
Transform.cpp Propagate changes through no-op transforms 2013-02-15 19:38:28 +00:00
Transform.h Added summary option to cpp11-migrate tool 2013-03-05 00:12:33 +00:00
Transforms.cpp Introducing Use-Auto transform for cpp11-migrate 2013-02-28 16:29:24 +00:00
Transforms.h Port loop-convert into cpp11-migrate 2013-01-04 18:25:18 +00:00