Remove support for Clang < 3.3

Change-Id: I185852a738bac10dc6d331afccfcbc7ae1225cb1
This commit is contained in:
Stephan Bergmann
2016-06-29 08:55:27 +02:00
parent 6439d93cbe
commit 1ce7176ba1
12 changed files with 29 additions and 155 deletions

View File

@@ -146,8 +146,8 @@ bool RedundantCast::VisitImplicitCastExpr(const ImplicitCastExpr * expr) {
&& isVoidPointer(
dyn_cast<CXXStaticCastExpr>(e)->getSubExpr()
->IgnoreParenImpCasts()->getType())
&& !compat::isMacroBodyExpansion(
compiler, e->getLocStart()))
&& !compiler.getSourceManager().isMacroBodyExpansion(
e->getLocStart()))
{
report(
DiagnosticsEngine::Warning,
@@ -223,13 +223,13 @@ bool RedundantCast::VisitCXXReinterpretCastExpr(
loc = compiler.getSourceManager().getImmediateMacroCallerLoc(
loc);
}
if (compat::isMacroBodyExpansion(compiler, loc)) {
if (compiler.getSourceManager().isMacroBodyExpansion(loc)) {
auto loc2 = expr->getLocEnd();
while (compiler.getSourceManager().isMacroArgExpansion(loc2)) {
loc2 = compiler.getSourceManager()
.getImmediateMacroCallerLoc(loc2);
}
if (compat::isMacroBodyExpansion(compiler, loc2)) {
if (compiler.getSourceManager().isMacroBodyExpansion(loc2)) {
//TODO: check loc, loc2 are in same macro body expansion
loc = compiler.getSourceManager().getSpellingLoc(loc);
}