aboutsummaryrefslogtreecommitdiff
path: root/clang/examples/PrintFunctionNames/PrintFunctionNames.cpp
AgeCommit message (Collapse)AuthorFilesLines
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
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
2012-12-04Sort the #include lines for examples/...Chandler Carruth1-1/+1
llvm-svn: 169241
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-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
2010-08-02Frontend: Change PluginASTAction::ParseArgs to take a CompilerInstance objectDaniel Dunbar1-4/+16
for use in reporting diagnostics. - We don't want to use the Action's own CompilerInstance, because that is only initialized during file processing and I like that invariant. Also, if ParseArgs returns false then abandon execution. Also, remove unused PluginASTAction::PrintHelp virtual method. llvm-svn: 110039
2010-07-26Make a variable static.Dan Gohman1-1/+1
llvm-svn: 109438
2010-06-16Frontend: Allow passing -cc1 level arguments to plugins. Patch by Troy ↵Daniel Dunbar1-1/+14
Straszheim! llvm-svn: 106113
2009-12-11Update docs/comments/utils/examples to refer to clang -cc1 instead of clang-cc.Daniel Dunbar1-2/+2
llvm-svn: 91176
2009-11-15Add a trivial example plugin, which prints the names of the top-level decls.Daniel Dunbar1-0/+44
- The build scriptage is about twice as long as the code, which is nice. :) llvm-svn: 88826