[cfe-dev] Using Rewriter to remove a function call argument along with preceding comma?

Stephan Bergmann sbergman at redhat.com
Fri Jun 7 05:31:34 PDT 2013


Am new here, hope this isn't too dumb a question.  (And from looking at 
the archives, fits better here than on cfe-users?)

Anyway, what I want to do is a rewriting Clang plugin that removes one 
argument from specific function calls.  But where I'm lost is how to 
determine the SourceLocation of the comma preceding the given argument, 
to do something like

   Rewriter.RemoveText(
     SourceRange(
       /*TODO*/,
       callExpr->getArg(1)->getLocEnd()));

Thanks,
Stephan



More information about the cfe-dev mailing list