commit e6403754eb3c78c9e68113d0fff933f1aae2c715
parent 8bc389f729ca098bd18facfb4d9cb5898f7cd8f0
Author: Kyle Milz <milz@macbook.0x30.net>
Date: Mon, 20 Jul 2020 13:41:10 -0700
inst: some llvm function names changed
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/bin/inst_visitor.cc b/bin/inst_visitor.cc
@@ -48,7 +48,7 @@ RewriteASTVisitor::TraverseStmt(clang::Stmt *s)
if (s == NULL)
return true;
- clang::SourceLocation start_loc = s->getLocStart();
+ clang::SourceLocation start_loc = s->getBeginLoc();
if (m_SM.isInMainFile(start_loc) == false)
return false;
@@ -64,7 +64,7 @@ RewriteASTVisitor::TraverseStmt(clang::Stmt *s)
bool
RewriteASTVisitor::TraverseDecl(clang::Decl *d)
{
- if (m_SM.isInMainFile(d->getLocStart()) == false)
+ if (m_SM.isInMainFile(d->getBeginLoc()) == false)
return false;
if (clang::isa<clang::VarDecl>(d)) {
@@ -147,7 +147,7 @@ bool
RewriteASTVisitor::VisitBinaryOperator(clang::BinaryOperator *b)
{
// If we can't rewrite the last token, don't even start.
- if (b->getLocEnd().isMacroID())
+ if (b->getEndLoc().isMacroID())
return true;
modify_stmt(b, m_counters[BIN_OPER]);
return true;
@@ -161,10 +161,10 @@ RewriteASTVisitor::modify_stmt(clang::Stmt *s, int &counter)
std::stringstream ss;
ss << "(++_citrun.data["
- << m_SM.getPresumedLineNumber(s->getLocStart()) - 1
+ << m_SM.getPresumedLineNumber(s->getBeginLoc()) - 1
<< "], ";
- if (m_TheRewriter.InsertTextBefore(s->getLocStart(), ss.str())) {
+ if (m_TheRewriter.InsertTextBefore(s->getBeginLoc(), ss.str())) {
++m_counters[REWRITE_ERROR];
return false;
}
@@ -185,10 +185,10 @@ RewriteASTVisitor::VisitFunctionDecl(clang::FunctionDecl *f)
std::stringstream rewrite_text;
clang::Stmt *FuncBody = f->getBody();
- clang::SourceLocation curly_brace(FuncBody->getLocStart().getLocWithOffset(1));
+ clang::SourceLocation curly_brace(FuncBody->getBeginLoc().getLocWithOffset(1));
// Animate function calls by firing the entire declaration.
- int decl_start = m_SM.getPresumedLineNumber(f->getLocStart());
+ int decl_start = m_SM.getPresumedLineNumber(f->getBeginLoc());
int decl_end = m_SM.getPresumedLineNumber(curly_brace);
for (int i = decl_start; i <= decl_end; ++i)
rewrite_text << "++_citrun.data[" << i - 1 << "];";
@@ -203,6 +203,6 @@ RewriteASTVisitor::VisitFunctionDecl(clang::FunctionDecl *f)
clang::SourceLocation
RewriteASTVisitor::real_loc_end(clang::Stmt *d)
{
- clang::SourceLocation _e(d->getLocEnd());
+ clang::SourceLocation _e(d->getEndLoc());
return clang::Lexer::getLocForEndOfToken(_e, 0, m_SM, m_lopt);
}