<div dir="ltr">You should make sure that all modules are linked with your binary the same way as it happens with tool/ClangTidyMain.cpp (the weird extern volatile variables around lines 244-254).<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 30, 2014 at 12:11 AM, Daniel Dilts <span dir="ltr"><<a href="mailto:diltsman@gmail.com" target="_blank">diltsman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I am attempting to directly integrate with clang-tidy. I am attempting to call runClangTidy with a set of parameters that, to the best I can tell, match what it gets called with when clang-tidy calls it. clang-tidy returns 2x ClangTidyError objects, but mine returns none. I would appreciate any comments on what I could be doing wrong in the following code. I am linking against rev 218612.</div><div><br></div><div> std::string error;<br> auto db = JSONCompilationDatabase::loadFromBuffer(R"(<br>[<br> {<br> "directory": "D:/llvm",<br> "command" : "D:/llvm/build/Debug/bin/clang.exe class_name.cpp",<br> "file" : "class_name.cpp"<br> }<br>]<br>)", error);<br> ClangTidyGlobalOptions globalOptions{{}};<br> auto options = ClangTidyOptions::getDefaults();<br> options.Checks = "*,-clang-analyzer-alpha*,-llvm-include-order,-google-*,";<br> options.User = "DiltsDa";<br> auto optionsProvider = llvm::make_unique<DefaultOptionsProvider>(globalOptions, options);<br> std::vector<std::string> files{ "class_name.cpp" };</div><div> std::vector<ClangTidyError> errors;<br> auto stats = runClangTidy(std::move(optionsProvider), *db, files, &errors);<br></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></blockquote></div>
</div></div>