citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 32df9e3bd527276c455acc9b996a7ab55a03ea76
parent 2e07bd8c061397199e86e28073b7f1fc4b30f136
Author: kyle <kyle@getaddrinfo.net>
Date:   Sat, 31 Oct 2015 16:04:09 -0600

instrument: header file cleaning

Diffstat:
Minstrument/instrumenter.cpp | 7+++++++
Minstrument/instrumenter.h | 19+++----------------
Minstrument/main.cpp | 23+++++++++--------------
3 files changed, 19 insertions(+), 30 deletions(-)

diff --git a/instrument/instrumenter.cpp b/instrument/instrumenter.cpp @@ -1,3 +1,10 @@ +#include <sstream> +#include <string> +#include <iostream> + +#include <clang/AST/AST.h> +#include <clang/Lex/Lexer.h> + #include "instrumenter.h" bool diff --git a/instrument/instrumenter.h b/instrument/instrumenter.h @@ -1,21 +1,8 @@ -#include <sstream> -#include <string> -#include <iostream> - -#include "clang/AST/AST.h" -#include "clang/AST/ASTConsumer.h" -#include "clang/AST/RecursiveASTVisitor.h" -#include "clang/Frontend/ASTConsumers.h" -#include "clang/Frontend/FrontendActions.h" -#include "clang/Frontend/CompilerInstance.h" -#include "clang/Lex/Lexer.h" -#include "clang/Tooling/CommonOptionsParser.h" -#include "clang/Tooling/Tooling.h" -#include "clang/Rewrite/Core/Rewriter.h" +#include <clang/AST/ASTConsumer.h> +#include <clang/AST/RecursiveASTVisitor.h> +#include <clang/Rewrite/Core/Rewriter.h> using namespace clang; -using namespace clang::driver; -using namespace clang::tooling; // By implementing RecursiveASTVisitor, we can specify which AST nodes diff --git a/instrument/main.cpp b/instrument/main.cpp @@ -4,21 +4,16 @@ #include <unistd.h> #include <sys/stat.h> // mode flags +#include <iostream> #include <sstream> #include <string> -#include <iostream> -#include "clang/AST/AST.h" -#include "clang/AST/ASTConsumer.h" -#include "clang/AST/RecursiveASTVisitor.h" -#include "clang/Frontend/ASTConsumers.h" -#include "clang/Frontend/FrontendActions.h" -#include "clang/Frontend/CompilerInstance.h" -#include "clang/Lex/Lexer.h" -#include "clang/Tooling/CommonOptionsParser.h" -#include "clang/Tooling/Tooling.h" -#include "clang/Rewrite/Core/Rewriter.h" -#include "llvm/Support/raw_ostream.h" +#include <clang/Frontend/FrontendActions.h> +#include <clang/Frontend/CompilerInstance.h> +#include <clang/Tooling/CommonOptionsParser.h> +#include <clang/Tooling/Tooling.h> +#include <clang/Rewrite/Core/Rewriter.h> +#include <llvm/Support/raw_ostream.h> #include "instrumenter.h" @@ -50,8 +45,8 @@ public: TheRewriter.InsertTextAfter(start, ss.str()); // Now emit the rewritten buffer. - // std::ofstream output(inst_files[0]); - int fd = open(inst_files[0], O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); + int fd = open(inst_files[0], O_WRONLY | O_CREAT, + S_IRUSR | S_IWUSR); if (fd < 0) err(1, "open"); llvm::raw_fd_ostream output(fd, /* close */ 1);