hanchenye-llvm-project/clang-tools-extra
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
..
clang-format Remove superseeded option. 2013-02-06 14:22:17 +00:00
cpp11-migrate Don't replace macro usage if macro body has NULL 2013-03-19 18:47:03 +00:00
docs [docs] Clarify wording. 2013-03-12 02:40:05 +00:00
modularize Added future directions comment and a couple of fixme's. 2013-03-14 01:41:29 +00:00
remove-cstr-calls these need the bitcode reader as well. 2013-01-19 18:45:35 +00:00
test Don't replace macro usage if macro body has NULL 2013-03-19 18:47:03 +00:00
tool-template these need the bitcode reader as well. 2013-01-19 18:45:35 +00:00
.arcconfig Add .arcconfig for Arcanist support for Phabricator 2013-01-10 04:12:08 +00:00
.gitignore .gitignore: ignore docs/_build 2013-03-03 15:15:12 +00:00
CMakeLists.txt Initial check in of Doug's modularize tool for checking header readiness for modules, plus some changes per review feedback: Removed system headers, changed to use stream output, added file name in message. 2013-03-12 02:07:30 +00:00
CODE_OWNERS.TXT Adding a new code owners file for clang-tools-extra. 2013-03-14 16:56:31 +00:00
LICENSE.TXT
Makefile Initial check in of Doug's modularize tool for checking header readiness for modules, plus some changes per review feedback: Removed system headers, changed to use stream output, added file name in message. 2013-03-12 02:07:30 +00:00
README.txt

README.txt

//===----------------------------------------------------------------------===//
// Clang Tools repository
//===----------------------------------------------------------------------===//

Welcome to the repository of extra Clang Tools.  This repository holds tools
that are developed as part of the LLVM compiler infrastructure project and the
Clang frontend.  These tools are kept in a separate "extra" repository to
allow lighter weight checkouts of the core Clang codebase.

This repository is only intended to be checked out inside of a full LLVM+Clang
tree, and in the 'tools/extra' subdirectory of the Clang checkout.

All discussion regarding Clang, Clang-based tools, and code in this repository
should be held using the standard Clang mailing lists:
  http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Code review for this tree should take place on the standard Clang patch and
commit lists:
  http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

If you find a bug in these tools, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/