commit 2fae7c381b2a204aef2dfc73bdd9314af051e91e
parent f7b33434bca4ec7ecd93667b23a0ea7575a032ba
Author: Kyle Milz <kyle@0x30.net>
Date: Sun, 25 Sep 2016 18:04:59 -0600
src: comment + whitespace fixes
Diffstat:
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/inst_visitor.cc b/src/inst_visitor.cc
@@ -125,7 +125,6 @@ RewriteASTVisitor::VisitCallExpr(clang::CallExpr *c)
bool
RewriteASTVisitor::VisitBinaryOperator(clang::BinaryOperator *b)
{
-
// If we can't rewrite the last token, don't even start.
if (b->getLocEnd().isMacroID())
return true;
@@ -139,21 +138,19 @@ RewriteASTVisitor::modify_stmt(clang::Stmt *s, int &counter)
if (s == NULL)
return false;
- // If x = y is the original statement on line 19 then we try rewriting
- // as (++_citrun[19], x = y).
std::stringstream ss;
ss << "(++_citrun.data["
<< m_SM.getPresumedLineNumber(s->getLocStart()) - 1
<< "], ";
if (m_TheRewriter.InsertTextBefore(s->getLocStart(), ss.str())) {
- // writing failed, don't attempt to add ")"
++m_counters[REWRITE_ERROR];
return false;
}
- m_TheRewriter.InsertTextAfter(real_loc_end(s), ")");
+ m_TheRewriter.InsertTextAfter(real_loc_end(s), ")");
++counter;
+
return true;
}