commit c82a261730e531a57f4eed8895f0a96860aa35e1 parent efd37578e92d4829b67cbe5f0bc389c18d6a510c Author: Kyle Milz <kyle@0x30.net> Date: Thu, 11 Aug 2016 17:42:02 -0600 src: only rewrite source code in primary file Diffstat:
M | src/inst_visitor.cc | | | 5 | +---- |
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/inst_visitor.cc b/src/inst_visitor.cc @@ -26,10 +26,7 @@ RewriteASTVisitor::TraverseStmt(clang::Stmt *s) if (s == NULL) return true; - clang::SourceLocation start_loc = s->getLocStart(); - clang::FullSourceLoc full_loc(start_loc, m_SM); - - if (full_loc.isInSystemHeader()) + if (m_SM.isInMainFile(s->getLocStart()) == false) return false; RecursiveASTVisitor<RewriteASTVisitor>::TraverseStmt(s);