[cfe-dev] Get mapped offset for rewritten text

Nikita Belov via cfe-dev cfe-dev at lists.llvm.org
Wed Apr 5 08:07:33 PDT 2017


Hello,

I need to get mapped offset for rewritten text to use it in
Rewriter::RemoveText(SourceRange range, RewriteOptions 
opts=RewriteOptions())
because that method calculates only mapped offset for end of range (not 
for
begin of range). Rewriter also has functions getRangeSize(...) and 
getRewrittenText(...)
which can calculate mapped offsets. Maybe Rewriter needs 
getMappedRange(...) function?
How can I get mapped offset for begin of range?

I found patch 
(http://lists.llvm.org/pipermail/cfe-dev/2010-November/012120.html)
with public Rewriter::getMappedOffset(...), but it isn't in master tree 
of clang.




More information about the cfe-dev mailing list