summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/redundantcast.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/redundantcast.cxx')
-rw-r--r--compilerplugins/clang/redundantcast.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx
index 27566809494c..1cfe44c9305e 100644
--- a/compilerplugins/clang/redundantcast.cxx
+++ b/compilerplugins/clang/redundantcast.cxx
@@ -158,7 +158,7 @@ private:
bool isOverloadedFunction(FunctionDecl const * decl);
bool isInIgnoredMacroBody(Expr const * expr) {
- auto const loc = compat::getBeginLoc(expr);
+ auto const loc = expr->getBeginLoc();
return compiler.getSourceManager().isMacroBodyExpansion(loc)
&& ignoreLocation(compiler.getSourceManager().getSpellingLoc(loc));
}
@@ -232,7 +232,7 @@ bool RedundantCast::VisitImplicitCastExpr(const ImplicitCastExpr * expr) {
dyn_cast<CXXStaticCastExpr>(e)->getSubExpr()
->IgnoreParenImpCasts()->getType())
&& !compiler.getSourceManager().isMacroBodyExpansion(
- compat::getBeginLoc(e)))
+ e->getBeginLoc()))
{
report(
DiagnosticsEngine::Warning,
@@ -312,7 +312,7 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) {
if (ignoreLocation(expr)) {
return true;
}
- if (isInUnoIncludeFile(compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(expr)))) {
+ if (isInUnoIncludeFile(compiler.getSourceManager().getSpellingLoc(expr->getBeginLoc()))) {
return true;
}
auto t1 = compat::getSubExprAsWritten(expr)->getType();
@@ -333,7 +333,7 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) {
// Ignore FD_ISSET expanding to "...(SOCKET)(fd)..." in some Microsoft
// winsock2.h (TODO: improve heuristic of determining that the whole
// expr is part of a single macro body expansion):
- auto l1 = compat::getBeginLoc(expr);
+ auto l1 = expr->getBeginLoc();
while (compiler.getSourceManager().isMacroArgExpansion(l1)) {
l1 = compiler.getSourceManager().getImmediateMacroCallerLoc(l1);
}
@@ -341,7 +341,7 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) {
while (compiler.getSourceManager().isMacroArgExpansion(l2)) {
l2 = compiler.getSourceManager().getImmediateMacroCallerLoc(l2);
}
- auto l3 = compat::getEndLoc(expr);
+ auto l3 = expr->getEndLoc();
while (compiler.getSourceManager().isMacroArgExpansion(l3)) {
l3 = compiler.getSourceManager().getImmediateMacroCallerLoc(l3);
}
@@ -551,7 +551,7 @@ bool RedundantCast::VisitCXXStaticCastExpr(CXXStaticCastExpr const * expr) {
// h=b5889d25e9bf944a89fdd7bcabf3b6c6f6bb6f7c> "assert: Support types
// without operator== (int) [BZ #21972]":
if (t1->isBooleanType() && t2->isBooleanType()) {
- auto loc = compat::getBeginLoc(expr);
+ auto loc = expr->getBeginLoc();
if (compiler.getSourceManager().isMacroBodyExpansion(loc)
&& (Lexer::getImmediateMacroName(
loc, compiler.getSourceManager(), compiler.getLangOpts())
@@ -607,13 +607,13 @@ bool RedundantCast::VisitCXXReinterpretCastExpr(
return true;
}
if (rewriter != nullptr) {
- auto loc = compat::getBeginLoc(expr);
+ auto loc = expr->getBeginLoc();
while (compiler.getSourceManager().isMacroArgExpansion(loc)) {
loc = compiler.getSourceManager().getImmediateMacroCallerLoc(
loc);
}
if (compiler.getSourceManager().isMacroBodyExpansion(loc)) {
- auto loc2 = compat::getEndLoc(expr);
+ auto loc2 = expr->getEndLoc();
while (compiler.getSourceManager().isMacroArgExpansion(loc2)) {
loc2 = compiler.getSourceManager()
.getImmediateMacroCallerLoc(loc2);
@@ -795,8 +795,8 @@ bool RedundantCast::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr const * exp
//
// in sal/osl/unx/socket.cxx:
//TODO: Better check that sub is exactly an expansion of FD_ISSET:
- if (compat::getEndLoc(sub).isMacroID()) {
- for (auto loc = compat::getBeginLoc(sub);
+ if (sub->getEndLoc().isMacroID()) {
+ for (auto loc = sub->getBeginLoc();
loc.isMacroID()
&& (compiler.getSourceManager()
.isAtStartOfImmediateMacroExpansion(loc));