llvm-project/clang/lib/AST
James Dennett 2def1e8ad6 Allow any comment to be a trailing comment when -fparse-all-comments is on.
This helps with freeform documentation styles, where otherwise code like
  enum class E {
    E1,  // D1
    E2   // D2
  };
would result in D1 being associated with E2. To properly associate E1
with D1 and E2 with D2, this patch allows all raw comments C such that
C.isParseAllComments() to participate in trailing comment checks inside
getRawCommentForDeclNoCache. This takes care of linking the intended
documentation with the intended decls. There remains an issue with code
like:
  foo();  // DN
  int x;
To prevent DN from being associated with x, this patch adds a new test
on preceding-line comments C (where C.isParseAllComments() and also
C's kind is RCK_OrdinaryBCPL or RCK_OrdinaryC) that checks whether C
is the first non-whitespace thing on C's starting line.

Patch from Luke Zarko <zarko@google.com>, D11069 reviewed by rsmith.

llvm-svn: 242317
2015-07-15 19:13:39 +00:00
..
APValue.cpp Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created. 2014-08-27 06:28:36 +00:00
ASTConsumer.cpp Introduce a PCHContainerOperations interface (NFC). 2015-06-20 18:53:08 +00:00
ASTContext.cpp Implement variance for Objective-C type parameters. 2015-07-07 03:58:54 +00:00
ASTDiagnostic.cpp AST: Avoid reading an unitialized value 2015-07-08 18:32:26 +00:00
ASTDumper.cpp Implement variance for Objective-C type parameters. 2015-07-07 03:58:54 +00:00
ASTImporter.cpp The AST importer had a bug where it would enter into an infinite recursion 2015-07-07 06:20:12 +00:00
ASTTypeTraits.cpp Fix bug in DynTypedMatcher::constructVariadic() that would cause false negatives. 2014-10-06 13:14:30 +00:00
AttrImpl.cpp Devirtualize Attr and all subclasses. 2015-03-19 16:06:49 +00:00
CMakeLists.txt MS ABI: Don't use the Itanium scheme for numbering lambdas 2014-08-22 04:22:50 +00:00
CXXABI.h Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
CXXInheritance.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
Comment.cpp Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. 2014-08-30 16:55:39 +00:00
CommentBriefParser.cpp Some refactoring in my patch on document 2013-03-02 02:39:57 +00:00
CommentCommandTraits.cpp Fix for PR21254 - Assertion in comment parser 2014-10-15 16:18:20 +00:00
CommentLexer.cpp Comment parsing: fix an assertion failure on a verbatim block terminated with "**/" 2015-04-15 23:45:43 +00:00
CommentParser.cpp [C++11] Use 'nullptr'. AST edition. 2014-05-12 05:36:57 +00:00
CommentSema.cpp [C++11] Use 'nullptr'. AST edition. 2014-05-12 05:36:57 +00:00
Decl.cpp [OpenMP] Add TLS-based implementation for threadprivate directive. 2015-07-13 22:54:53 +00:00
DeclBase.cpp Parsing, semantic analysis, and AST for Objective-C type parameters. 2015-07-07 03:57:15 +00:00
DeclCXX.cpp [modules] When determining the visible module set during template 2015-07-08 02:22:15 +00:00
DeclFriend.cpp [C++11] Use 'nullptr'. AST edition. 2014-05-12 05:36:57 +00:00
DeclGroup.cpp Replace custom alignment enforcement with LLVM_ALIGNAS. 2015-04-02 12:25:07 +00:00
DeclObjC.cpp DeclObjC: Move computing the type of self into a separate function (NFC). 2015-07-08 22:15:59 +00:00
DeclOpenMP.cpp [C++11] Use 'nullptr'. AST edition. 2014-05-12 05:36:57 +00:00
DeclPrinter.cpp Implement variance for Objective-C type parameters. 2015-07-07 03:58:54 +00:00
DeclTemplate.cpp [modules] Improve diagnostic for a template-id that's invalid because a default 2015-06-17 20:16:32 +00:00
DeclarationName.cpp [C++11] Use 'nullptr'. AST edition. 2014-05-12 05:36:57 +00:00
Expr.cpp Substitute type arguments into uses of Objective-C interface members. 2015-07-07 03:57:53 +00:00
ExprCXX.cpp Replace the broken LambdaCapture::isInitCapture API. 2015-05-07 18:48:18 +00:00
ExprClassification.cpp Implementing C99 partial re-initialization behavior (DR-253) 2015-06-10 00:27:52 +00:00
ExprConstant.cpp [OPENMP] Introduced type trait "__builtin_omp_required_simd_align" for default simd alignment. 2015-07-02 03:40:19 +00:00
ExternalASTSource.cpp Add a function to ExternalASTSource that returns a descriptor that 2015-06-30 17:39:43 +00:00
InheritViz.cpp InheritViz: Hide implementation details 2015-03-09 15:03:20 +00:00
ItaniumCXXABI.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
ItaniumMangle.cpp Implement the Objective-C __kindof type qualifier. 2015-07-07 03:58:42 +00:00
Makefile
Mangle.cpp This patch fixes a crash involving use of predefined 2014-12-02 18:42:51 +00:00
MicrosoftCXXABI.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
MicrosoftMangle.cpp [MS ABI] nullptr data member ptrs are mangled differently for classes vs fns 2015-07-02 09:43:11 +00:00
NSAPI.cpp [ObjC] Add NSValue support for objc_boxed_expressions 2015-06-26 05:28:36 +00:00
NestedNameSpecifier.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
ParentMap.cpp Switch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ pattern to range for loops. 2015-07-02 21:03:14 +00:00
RawCommentList.cpp Allow any comment to be a trailing comment when -fparse-all-comments is on. 2015-07-15 19:13:39 +00:00
RecordLayout.cpp CXXInfo memory should be released after calling the destructor 2014-05-24 07:19:25 +00:00
RecordLayoutBuilder.cpp Fix "the the" in comments/documentation/etc. 2015-06-19 01:52:53 +00:00
SelectorLocationsKind.cpp
Stmt.cpp [OPENMP 4.0] Initial support for 'omp cancel' construct. 2015-07-02 11:25:17 +00:00
StmtIterator.cpp StmtIterator: Put stmt and decl group pointer into a union. 2015-07-03 15:12:36 +00:00
StmtPrinter.cpp [OPENMP 4.0] Initial support for 'omp cancel' construct. 2015-07-02 11:25:17 +00:00
StmtProfile.cpp Switch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ pattern to range for loops. 2015-07-02 21:03:14 +00:00
StmtViz.cpp
TemplateBase.cpp Use APSInt::isSameValue instead of operator== in a place where two APSInt's 2015-01-09 00:58:16 +00:00
TemplateName.cpp [C++11] Use 'nullptr'. AST edition. 2014-05-12 05:36:57 +00:00
Type.cpp [libclang] Implement proper code-completion in an ObjC type parameter position. 2015-07-07 06:20:36 +00:00
TypeLoc.cpp C++ support for Objective-C lightweight generics. 2015-07-07 03:58:14 +00:00
TypePrinter.cpp Implement the Objective-C __kindof type qualifier. 2015-07-07 03:58:42 +00:00
VTTBuilder.cpp Update for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool> as per the C++ standard's associative container concept. 2014-11-19 07:49:47 +00:00
VTableBuilder.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00