diff options
Diffstat (limited to 'clang-tools-extra/clang-move/HelperDeclRefGraph.cpp')
-rw-r--r-- | clang-tools-extra/clang-move/HelperDeclRefGraph.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-move/HelperDeclRefGraph.cpp b/clang-tools-extra/clang-move/HelperDeclRefGraph.cpp index 8303015171e..00ab9ea651f 100644 --- a/clang-tools-extra/clang-move/HelperDeclRefGraph.cpp +++ b/clang-tools-extra/clang-move/HelperDeclRefGraph.cpp @@ -10,8 +10,11 @@ #include "HelperDeclRefGraph.h" #include "ClangMove.h" #include "clang/AST/Decl.h" +#include "llvm/Support/Debug.h" #include <vector> +#define DEBUG_TYPE "clang-move" + namespace clang { namespace move { @@ -113,13 +116,19 @@ void HelperDeclRGBuilder::run( if (const auto *FuncRef = Result.Nodes.getNodeAs<DeclRefExpr>("func_ref")) { const auto *DC = Result.Nodes.getNodeAs<Decl>("dc"); assert(DC); - - RG->addEdge(getOutmostClassOrFunDecl(DC->getCanonicalDecl()), - getOutmostClassOrFunDecl(FuncRef->getDecl())); + DEBUG(llvm::dbgs() << "Find helper function usage: " + << FuncRef->getDecl()->getNameAsString() << " (" + << FuncRef->getDecl() << ")\n"); + RG->addEdge( + getOutmostClassOrFunDecl(DC->getCanonicalDecl()), + getOutmostClassOrFunDecl(FuncRef->getDecl()->getCanonicalDecl())); } else if (const auto *UsedClass = Result.Nodes.getNodeAs<CXXRecordDecl>("used_class")) { const auto *DC = Result.Nodes.getNodeAs<Decl>("dc"); assert(DC); + DEBUG(llvm::dbgs() << "Find helper class usage: " + << UsedClass->getNameAsString() << " (" << UsedClass + << ")\n"); RG->addEdge(getOutmostClassOrFunDecl(DC->getCanonicalDecl()), UsedClass); } } |