commit bdf608af723f6756e19cc29edd2338ba513db2e1
parent 24cf38d17a7b87cbfcea0b94a95748a79c14811e
Author: Kyle Milz <kyle@0x30.net>
Date: Sun, 21 Aug 2016 22:30:11 -0600
src: move declaration closer to use
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/inst_action.cc b/src/inst_action.cc
@@ -65,7 +65,6 @@ InstrumentAction::EndSourceFileAction()
clang::SourceManager &sm = m_TheRewriter.getSourceMgr();
const clang::FileID main_fid = sm.getMainFileID();
- clang::SourceLocation start = sm.getLocForStartOfFile(main_fid);
clang::SourceLocation end = sm.getLocForEndOfFile(main_fid);
unsigned int num_lines = sm.getPresumedLineNumber(end);
@@ -94,6 +93,7 @@ InstrumentAction::EndSourceFileAction()
<< "}\n"
<< "#endif\n";
+ clang::SourceLocation start = sm.getLocForStartOfFile(main_fid);
if (m_TheRewriter.InsertTextAfter(start, preamble.str())) {
*m_log << "Failed to insert the instrumentation preabmle.";
return;