}
}
+#ifndef NDEBUG
std::string printNodeToString(const DynTypedNode &N, const PrintingPolicy &PP) {
std::string S;
llvm::raw_string_ostream OS(S);
OS << " ";
return std::move(OS.str());
}
+#endif
// We find the selection by visiting written nodes in the AST, looking for nodes
// that intersect with the selected character range.
SelectionVisitor(ASTContext &AST, const PrintingPolicy &PP, unsigned SelBegin,
unsigned SelEnd, FileID SelFile)
: SM(AST.getSourceManager()), LangOpts(AST.getLangOpts()),
- PrintPolicy(PP), SelBegin(SelBegin), SelEnd(SelEnd), SelFile(SelFile),
+#ifndef NDEBUG
+ PrintPolicy(PP),
+#endif
+ SelBegin(SelBegin), SelEnd(SelEnd), SelFile(SelFile),
SelBeginTokenStart(SM.getFileOffset(Lexer::GetBeginningOfToken(
SM.getComposedLoc(SelFile, SelBegin), SM, LangOpts))) {
// Ensure we have a node for the TU decl, regardless of traversal scope.
SourceManager &SM;
const LangOptions &LangOpts;
+#ifndef NDEBUG
const PrintingPolicy &PrintPolicy;
+#endif
std::stack<Node *> Stack;
RangeSet Claimed;
std::deque<Node> Nodes; // Stable pointers as we add more nodes.