aboutsummaryrefslogtreecommitdiff
path: root/clang/examples/PrintFunctionNames
AgeCommit message (Collapse)AuthorFilesLines
2016-10-10[Examples] Fix use of sema.LateParsedTemplateMap in clang/examples.Justin Lebar1-2/+3
llvm-svn: 283778
2016-08-05Reapply r276973 "Adjust Registry interface to not require plugins to export ↵John Brawn1-1/+1
a registry" This differs from the previous version by being more careful about template instantiation/specialization in order to prevent errors when building with clang -Werror. Specifically: * begin is not defined in the template and is instead instantiated when Head is. I think the warning when we don't do that is wrong (PR28815) but for now at least do it this way to avoid the warning. * Instead of performing template specializations in LLVM_INSTANTIATE_REGISTRY instead provide a template definition then do explicit instantiation. No compiler I've tried has problems with doing it the other way, but strictly speaking it's not permitted by the C++ standard so better safe than sorry. Original commit message: Currently the Registry class contains the vestiges of a previous attempt to allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a plugin would have its own copy of a registry and export it to be imported by the tool that's loading the plugin. This only works if the plugin is entirely self-contained with the only interface between the plugin and tool being the registry, and in particular this conflicts with how IR pass plugins work. This patch changes things so that instead the add_node function of the registry is exported by the tool and then imported by the plugin, which solves this problem and also means that instead of every plugin having to export every registry they use instead LLVM only has to export the add_node functions. This allows plugins that use a registry to work on Windows if LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used. llvm-svn: 277806
2016-07-28Revert r276973 "Adjust Registry interface to not require plugins to export a ↵John Brawn1-1/+1
registry" Buildbot failures when building with clang -Werror. Reverting while I try to figure this out. llvm-svn: 277008
2016-07-28Reapply r276856 "Adjust Registry interface to not require plugins to export ↵John Brawn1-1/+1
a registry" This version has two fixes compared to the original: * In Registry.h the template static members are instantiated before they are used, as clang gives an error if you do it the other way around. * The use of the Registry template in clang-tidy is updated in the same way as has been done everywhere else. Original commit message: Currently the Registry class contains the vestiges of a previous attempt to allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a plugin would have its own copy of a registry and export it to be imported by the tool that's loading the plugin. This only works if the plugin is entirely self-contained with the only interface between the plugin and tool being the registry, and in particular this conflicts with how IR pass plugins work. This patch changes things so that instead the add_node function of the registry is exported by the tool and then imported by the plugin, which solves this problem and also means that instead of every plugin having to export every registry they use instead LLVM only has to export the add_node functions. This allows plugins that use a registry to work on Windows if LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used. llvm-svn: 276973
2016-07-27Revert r276856 "Adjust Registry interface to not require plugins to export a ↵John Brawn1-1/+1
registry" This is causing a huge pile of buildbot failures. llvm-svn: 276857
2016-07-27Adjust Registry interface to not require plugins to export a registryJohn Brawn1-1/+1
Currently the Registry class contains the vestiges of a previous attempt to allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a plugin would have its own copy of a registry and export it to be imported by the tool that's loading the plugin. This only works if the plugin is entirely self-contained with the only interface between the plugin and tool being the registry, and in particular this conflicts with how IR pass plugins work. This patch changes things so that instead the add_node function of the registry is exported by the tool and then imported by the plugin, which solves this problem and also means that instead of every plugin having to export every registry they use instead LLVM only has to export the add_node functions. This allows plugins that use a registry to work on Windows if LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used. Differential Revision: http://reviews.llvm.org/D21385 llvm-svn: 276856
2016-06-09[CMake] Cleaning up CMake feature gating on 2.8.12Chris Bieneman1-1/+1
CMake 2.8.12 introduced interface libraries and some related policies. This removes the conditional block because we're now past 2.8.12. llvm-svn: 272312
2016-02-11Revert r260265, "clang-cl: Support loading plugins on Windows"NAKAMURA Takumi1-1/+0
It causes memory exhaust on mingw-w64(x64). Investigating. llvm-svn: 260536
2016-02-09clang-cl: Support loading plugins on WindowsEhsan Akhgari1-0/+1
This builds on the support being added to LLVM to import and export registries from DLLs. This will allow us to pick up the registry entries added in the DLL's copy of FrontendPluginRegistry. This will allow us to use plugins on Windows using: $ clang-cl -Xclang -load -Xclang plugin.dll \ -Xclang -add-plugin -Xclang foo llvm-svn: 260265
2016-01-26Remove autoconf supportChris Bieneman1-28/+0
Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 llvm-svn: 258862
2015-06-22Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko1-1/+1
llvm-svn: 240353
2015-06-22Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko1-1/+1
The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
2015-05-17Don't leak TemplateIds when a plugin parses late-parsed templates at TU end.Nico Weber1-2/+53
In -fdelayed-template-parsing mode, templates that aren't used are not parsed at all. For some diagnostic plugins, this is a problem since they want to analyse the contents of the template function body. What has been suggested on cfe-dev [1] is to explicitly parse interesting templates in HandleTranslationUnit(); IWYU does this for example [2]. This is workable, but since the delayed parsing doesn't run below a call to ParseTopLevelDecl(), no DestroyTemplateIdAnnotationsRAIIObj object is on the stack to clean up TemplateIds that are created during parsing. To fix this, let ~Parser() clean them up in delayed template parsing mode instead of leaking (or asserting in +Assert builds). (r219810, relanded in r220400, fixed the same problem in incremental processing mode; the review thread of r219810 has a good discussion of the problem.) To test this, give the PrintFunctionNames plugin a flag to force parsing of a template and add a test that uses it in -fdelayed-template-parsing mode. Without the Parser.cpp change, that test asserts. 1: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-August/038415.html 2: https://code.google.com/p/include-what-you-use/source/detail?r=566 llvm-svn: 237531
2015-04-11Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko1-3/+3
Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
2015-01-23Replace size() calls on containers with empty() calls where appropriate. NFCAlexander Kornienko1-1/+1
http://reviews.llvm.org/D7090 Patch by Gábor Horváth! llvm-svn: 226914
2014-08-10Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)David Blaikie1-2/+3
After post-commit review and community discussion, this seems like a reasonable direction to continue, making ownership semantics explicit in the source using the type system. llvm-svn: 215323
2014-07-17Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie1-3/+2
This reverts commit r213307. Reverting to have some on-list discussion/confirmation about the ongoing direction of smart pointer usage in the LLVM project. llvm-svn: 213325
2014-07-17unique_ptr-ify ownership of ASTConsumersDavid Blaikie1-2/+3
(after fixing a bug in MultiplexConsumer I noticed the ownership of the nested consumers was implemented with raw pointers - so this fixes that... and follows the source back to its origin pushing unique_ptr ownership up through there too) llvm-svn: 213307
2014-07-13[CMake] Give explicit dependencies to a couple of modules, ↵NAKAMURA Takumi1-0/+9
PrintFunctionNames and SampleAnalyzerPlugin, for Win32.DLL. llvm-svn: 212906
2014-07-13PrintFunctionNames/CMakeLists.txt: Fix a comment.NAKAMURA Takumi1-1/+1
llvm-svn: 212905
2014-07-11Instantiate llvm::Registry<clang::PluginASTAction> in FrontendAction.cpp.NAKAMURA Takumi1-1/+0
- Plugins don't need to export _ZN4llvm8Registry*. - Win32.DLL cannot merge common symbols among DLLs. Static members in llvm::Registry should be instantiated in a parent. llvm-svn: 212821
2014-02-21[CMake] Get rid of explicit dependencies to include/clang/*.inc and ↵NAKAMURA Takumi1-10/+0
introduce CLANG_TABLEGEN_TARGETS. This does; - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list. - List of targets is added to LLVM_COMMON_DEPENDS. - all clang libraries and targets depend on generated headers. You might wonder this would be regression, but in fact, this is little loss. - Almost all of clang libraries depend on tblgen'd files and clang-tblgen. - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild. - Each library's dependencies to tblgen'd files might vary along headers' structure. It made hard to track and update *really optimal* dependencies. Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS. llvm-svn: 201842
2014-02-13[examples] Add tablegen'd ClangCommentCommandList as a dependency for plugins.Jordan Rose1-0/+1
Also, remove library dependencies for the sample analyzer-plugin. The only library changes that would require a rebuild should be in headers, which should already implicitly be marked as dependencies. llvm-svn: 201350
2014-02-12[examples] Use loadable modules instead of shared libraries for Clang plugins.Jordan Rose2-17/+2
This avoids linking in extra copies of, say, LLVMSupport. llvm-svn: 201256
2014-01-23[CMake] Parameterize MODULE and SHARED in add_clang_library().NAKAMURA Takumi1-3/+1
llvm-svn: 199902
2013-12-30Don't use PrintFunctionNames.exports on Windows.Nico Weber1-3/+6
llvm-svn: 198187
2013-12-29Fix typo in comment.Nico Weber1-1/+1
llvm-svn: 198186
2013-12-29[cmake] Set in LLVM_EXPORTED_SYMBOL_FILE PrintFunctionNames/CMakeLists.txt.Nico Weber1-0/+8
The corresponding Makefile sets it too. Also tweak add_clang_library to support LLVM_EXPORTED_SYMBOL_FILE for modules. llvm-svn: 198185
2013-12-21Fix getCustomDiagID() usage in example codeAlp Toker1-3/+3
This was setting a bad example. DiagIDs are a limited resource and the message argument is evaluated as a format string. llvm-svn: 197855
2013-12-10[CMake] Update target_link_libraries() and LLVM_LINK_COMPONENTS for each ↵NAKAMURA Takumi1-2/+5
CMakeLists.txt. llvm-svn: 196916
2012-12-20Revert r170801, which breaks the mingw build.Douglas Gregor1-0/+1
llvm-svn: 170804
2012-12-20Eliminate errors when running the 'PrintFunctionNames' plugin, from Li Qun!Douglas Gregor1-1/+0
llvm-svn: 170801
2012-12-04Sort the #include lines for examples/...Chandler Carruth1-1/+1
llvm-svn: 169241
2012-07-27libclang, examples: [CMake] Add dependencies to tblgen'd headers.NAKAMURA Takumi1-0/+9
llvm-svn: 160849
2012-06-21Remove a goofy CMake hack and use the standard CMake facilities toChandler Carruth1-5/+5
express library-level dependencies within Clang. This is no more verbose really, and plays nicer with the rest of the CMake facilities. It should also have no change in functionality. llvm-svn: 158888
2012-04-26Reverted unintentional commit.Manuel Klimek1-2/+1
llvm-svn: 155629
2012-04-26Adds a small tutorial on how to write RAV based ASTFrontendActions.Manuel Klimek1-1/+2
llvm-svn: 155627
2011-12-18examples: flesh out PFN readmeDylan Noblesmith1-0/+4
Show how to actually use the arguments it has. llvm-svn: 146845
2011-11-19Update signature of HandleTopLevelDecl.Douglas Gregor1-1/+3
llvm-svn: 145001
2011-09-27Fix examples for r140478. PR11021.Eli Friedman1-2/+2
llvm-svn: 140618
2011-02-19Re-instate r125819 and r125820 with no functionality changePeter Collingbourne1-24/+1
llvm-svn: 126060
2011-02-19Revert 125820 and 125819 to fix PR9266.Rafael Espindola1-1/+24
llvm-svn: 126050
2011-02-18Move CompilerInstance::LLVMContext and LLVMContext ownership to CodeGenActionPeter Collingbourne1-24/+1
This removes the final dependency edge from any lib outside of CodeGen to core. As a result we can, and do, trim the dependency on core from libclang, PrintFunctionNames, the unit tests and c-index-test. While at it, review and trim other unneeded dependencies. llvm-svn: 125820
2011-02-14[analyzer] Introduce libclangStaticAnalyzerFrontend and move ↵Argyrios Kyrtzidis1-0/+1
Checkers/AnalysisConsumer.cpp into Frontend lib. llvm-svn: 125499
2011-02-10CMake: LLVM_NO_RTTI must be obsolete now!NAKAMURA Takumi1-2/+0
llvm-svn: 125275
2011-01-26make `make` work in examples/PrintFucntionNames on Mac. I checked that it ↵Nico Weber2-5/+11
still works on Linux. llvm-svn: 124325
2011-01-19Fix name to match reality.Nick Lewycky1-1/+1
llvm-svn: 123813
2010-12-23Chris Lattner has strong opinions about directoryTed Kremenek1-2/+2
layout. :) Rename the 'EntoSA' directories to 'StaticAnalyzer'. Internally we will still use the 'ento' namespace for the analyzer engine (unless there are further sabre rattlings...). llvm-svn: 122514
2010-12-23Rename headers: 'clang/GR' 'clang/EntoSA' andTed Kremenek1-2/+2
update Makefile. llvm-svn: 122493
2010-12-22[analyzer] Refactoring: Move checkers into lib/GR/Checkers and their own ↵Argyrios Kyrtzidis1-0/+1
library, libclangGRCheckers llvm-svn: 122422