<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">For such things you might also want to take a look at clang-rename tool in clang/tools/extra.<div class=""><br class=""></div><div class="">—</div><div class="">Kirill</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 27 Jul 2016, at 19:57, Himanshu via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Actually I found out that getLoc works as desired in this case. <div class="">thanks!</div></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature">--<div class="">Himanshu</div></div></div>
<br class=""><div class="gmail_quote">On Wed, Jul 27, 2016 at 10:49 AM, Himanshu <span dir="ltr" class=""><<a href="mailto:himanshu@utexas.edu" target="_blank" class="">himanshu@utexas.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hi All, <br class=""><br class="">I am working on a rewriter that needs to replace certain variable declarations. Let me create a simplified example here. Consider the following DeclStmt: <br class=""><br class="">size_t v, *u = NULL, w = 10;<br class=""><br class="">In my RecursiveASTVisitor I implement VisitVarDecl, and use the rewriter.replace(SourceRange, ...) API. I create the SourceRange using VarDecl::getLocStart and getLocEnd. But this leads to the whole DeclStmt being replaced even if only want to replace u or w. I tried using the getInnerLocStart, but it leads to the same issue. How should I get the correct start and end locations for each individual VarDecl? <br class=""><br class=""><br class="">Thanks!<br class="">-<br class="">Himanshu<br class=""><div class="">
</div></div>
</blockquote></div><br class=""></div>
_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev<br class=""></div></blockquote></div><br class=""></div></body></html>