new clang plugin: staticmethods

Genius suggestion from Tor Lillqvist, write a clang plugin that finds
methods that can be static.

Change-Id: Ie6684cc95d088e8750b300a028b49f763da00345
This commit is contained in:
Noel Grandin
2015-03-25 15:37:53 +02:00
parent 17551216cc
commit c4a9241f72
12 changed files with 182 additions and 40 deletions

View File

@@ -224,6 +224,16 @@ inline bool isMacroBodyExpansion(clang::CompilerInstance& compiler, clang::Sourc
}
inline bool isMacroBodyExpansion(clang::CompilerInstance& compiler, clang::SourceLocation location)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
return compiler.getSourceManager().isMacroBodyExpansion(location);
#else
return location.isMacroID()
&& !compiler.getSourceManager().isMacroArgExpansion(location);
#endif
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */