commit 161b5d039e857ab36a4f44cd4d499be7cb162c0d
parent 5757897eb351669a45122946738f2d31082af13b
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Fri, 25 Mar 2016 16:35:14 -0600
patches: regen osx
Diffstat:
M | patches/osx.diff | | | 66 | ++++++++++++++++++++++++++++++++++++++---------------------------- |
1 file changed, 38 insertions(+), 28 deletions(-)
diff --git a/patches/osx.diff b/patches/osx.diff
@@ -1,5 +1,5 @@
diff --git a/SCV/Project.pm b/SCV/Project.pm
-index 5b608cc..296ec68 100644
+index 5ca6b48..da95995 100644
--- a/SCV/Project.pm
+++ b/SCV/Project.pm
@@ -49,7 +49,7 @@ EOF
@@ -12,7 +12,7 @@ index 5b608cc..296ec68 100644
}
diff --git a/instrument/Makefile b/instrument/Makefile
-index 5d3511b..bea4c35 100644
+index ef67bae..8f80e9c 100644
--- a/instrument/Makefile
+++ b/instrument/Makefile
@@ -8,7 +8,8 @@ CXXFLAGS += `llvm-config --cxxflags`
@@ -40,50 +40,60 @@ index 5d3511b..bea4c35 100644
LDADD += `llvm-config --libs bitreader mcparser transformutils option --system-libs`
-diff --git a/instrument/instrumenter.cc b/instrument/instrumenter.cc
-index 29d84c0..9688e8e 100644
---- a/instrument/instrumenter.cc
-+++ b/instrument/instrumenter.cc
-@@ -104,14 +104,14 @@ instrumenter::real_loc_end(Stmt *d)
+diff --git a/instrument/instrument_action.cc b/instrument/instrument_action.cc
+index cf1eb96..b60d6c0 100644
+--- a/instrument/instrument_action.cc
++++ b/instrument/instrument_action.cc
+@@ -15,7 +15,7 @@
+ #include "runtime_h.h"
- // MyFrontendAction ---
--ASTConsumer *
-+std::unique_ptr<ASTConsumer>
- MyFrontendAction::CreateASTConsumer(CompilerInstance &CI, StringRef file)
+-clang::ASTConsumer *
++std::unique_ptr<clang::ASTConsumer>
+ InstrumentAction::CreateASTConsumer(clang::CompilerInstance &CI, clang::StringRef file)
{
// llvm::errs() << "** Creating AST consumer for: " << file << "\n";
- SourceManager &sm = CI.getSourceManager();
- TheRewriter.setSourceMgr(sm, CI.getLangOpts());
+@@ -24,7 +24,7 @@ InstrumentAction::CreateASTConsumer(clang::CompilerInstance &CI, clang::StringRe
-- return new MyASTConsumer(TheRewriter);
-+ return std::unique_ptr<ASTConsumer>(new MyASTConsumer(TheRewriter));
+ // Hang onto a reference to this so we can read from it later
+ InstrumentASTConsumer = new RewriteASTConsumer(TheRewriter);
+- return InstrumentASTConsumer;
++ return std::unique_ptr<clang::ASTConsumer>(InstrumentASTConsumer);
}
unsigned int
-diff --git a/instrument/instrumenter.h b/instrument/instrumenter.h
-index 3c2f019..08ed671 100644
---- a/instrument/instrumenter.h
-+++ b/instrument/instrumenter.h
-@@ -52,7 +52,7 @@ public:
- MyFrontendAction() {};
+diff --git a/instrument/instrument_action.h b/instrument/instrument_action.h
+index fd229db..3da8282 100644
+--- a/instrument/instrument_action.h
++++ b/instrument/instrument_action.h
+@@ -30,7 +30,7 @@ public:
+ InstrumentAction() {};
void EndSourceFileAction() override;
-- ASTConsumer *CreateASTConsumer(CompilerInstance &CI, StringRef file);
-+ std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI, StringRef file) override;
+- clang::ASTConsumer *CreateASTConsumer(clang::CompilerInstance &, clang::StringRef) override;
++ std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(clang::CompilerInstance &, clang::StringRef) override;
private:
- Rewriter TheRewriter;
+ clang::Rewriter TheRewriter;
diff --git a/instrument/main.cc b/instrument/main.cc
-index c497dc9..cd589b0 100644
+index 17e90ed..763e6d1 100644
--- a/instrument/main.cc
+++ b/instrument/main.cc
-@@ -83,7 +85,7 @@ instrument(int argc, char *argv[], std::vector<std::string> const &source_files)
+@@ -67,6 +67,8 @@ instrument(int argc, char *argv[], std::vector<std::string> const &source_files)
+ // Append original command line verbatim
+ clang_argv.insert(clang_argv.end(), argv, argv + argc);
+
++ clang_argv.push_back("-I/opt/local/libexec/llvm-3.7/lib/clang/3.7/include");
++
+ // give clang it's <source files> -- <native command line> arg style
+ int clang_argc = clang_argv.size();
+ clang::tooling::CommonOptionsParser op(clang_argc, &clang_argv[0], ToolingCategory);
+@@ -78,7 +80,7 @@ instrument(int argc, char *argv[], std::vector<std::string> const &source_files)
// that will return a new MyFrontendAction object every time. To
// further customize this, we could create our own factory class.
// int ret = Tool.run(new MFAF(inst_files));
-- int ret = Tool.run(newFrontendActionFactory<MyFrontendAction>());
-+ int ret = Tool.run(&(*newFrontendActionFactory<MyFrontendAction>()));
+- int ret = Tool.run(clang::tooling::newFrontendActionFactory<InstrumentAction>());
++ int ret = Tool.run(&(*clang::tooling::newFrontendActionFactory<InstrumentAction>()));
if (ret)
warnx("Instrumentation failed");
return ret;