summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* [Wdocumentation] Implement \anchorMark de Wever2019-12-211-0/+9
| | | | Differential revision: https://reviews.llvm.org/D69223
* [libclang] Fix CXTranslationUnit_KeepGoingIvan Donchevskii2019-03-071-0/+3
| | | | | | | | | | | | | | | | | | Since commit 56f548bbbb7e4387a69708f70724d00e9e076153 [modules] Round-trip -Werror flag through explicit module build. the behavior of CXTranslationUnit_KeepGoing changed: Unresolved #includes are fatal errors again. As a consequence, some templates are not instantiated and lead to confusing errors. Revert to the old behavior: With CXTranslationUnit_KeepGoing fatal errors are mapped to errors. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D58501 llvm-svn: 355586
* [Preprocessor] Don't avoid entering included files after hitting a fatal error.Volodymyr Sapsai2018-12-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Change in r337953 violated the contract for `CXTranslationUnit_KeepGoing`: > Do not stop processing when fatal errors are encountered. Use different approach to fix long processing times with multiple inclusion cycles. Instead of stopping preprocessing for fatal errors, do this after reaching the max allowed include depth and only for the files that were processed already. It is likely but not guaranteed those files cause a cycle. rdar://problem/46108547 Reviewers: erik.pilkington, arphaman Reviewed By: erik.pilkington Subscribers: jkorous, dexonsmith, ilya-biryukov, Dmitry.Kozhevnikov Differential Revision: https://reviews.llvm.org/D55095 llvm-svn: 348641
* [Tooling] Clear the PreambleSrcLocCache when preamble is discarded during ↵Alex Lorenz2018-03-123-0/+12
| | | | | | | | | | | reparsing This ensures that diagnostics are not remapped to incorrect preamble locations after the second reparse with a remapped header file occurs. rdar://37502480 llvm-svn: 327322
* [Sema] Add implicit members even for invalid CXXRecordDeclsIlya Biryukov2018-02-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It should be safe, since other code paths are already generating implicit members even in invalid CXXRecordDecls (e.g. lookup). If we don't generate implicit members on CXXRecordDecl's completion, they will be generated by next lookup of constructors. This causes a crash when the following conditions are met: - a CXXRecordDecl is invalid, - it is provided via ExternalASTSource (e.g. from PCH), - it has inherited constructors (they create ShadowDecls), - lookup of its constructors was not run before ASTWriter serialized it. This may require the ShadowDecls created for inherited constructors to be removed from the class, but that's no longer possible since class is provided by ExternalASTSource. See provided lit test for an example. Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42810 llvm-svn: 324062
* [libclang] Store unsaved file hashes when recording parsing invocationsAlex Lorenz2017-12-051-0/+2
| | | | | | | | | | | | Storing the contents of unsaved files is too expensive. Instead a hash is stored with a record invocation. When a reproducer is generated, Clang will compare the stored hashes to the new hashes to determine if the contents of a file has changed. This way we'll know when a reproducer was generated for a different source to the one that triggered the original crash. rdar://35322543 llvm-svn: 319729
* [Frontend] Verify that the bitstream is not empty before readingAlex Lorenz2017-07-071-0/+0
| | | | | | | | | | | | | | the serialised diagnostics Clang should avoid calling report_fatal_error when the file with the serialised diagnostics is empty. This commit changes Clang's serialised diagnostic reader, now it reports an appropriate error instead of crashing. rdar://31939877 Differential Revision: https://reviews.llvm.org/D35069 llvm-svn: 307384
* [Modules] Don't infinite recurse on implicit import of circular modules in ↵Ben Langmuir2016-02-115-0/+24
| | | | | | | | | | | | | | preamble Update the Preprocessor's VisibleModuleSet when typo-correction creates an implicit module import so that we won't accidentally write an invalid SourceLocation into the preamble AST. This would later lead to infinite recursion when loading the preamble AST because we use the value in ImportLocs to prevent visiting a module twice. rdar://problem/24440990 llvm-svn: 260543
* [libclang] Allow code-completion when pointing at the end-of-file.Argyrios Kyrtzidis2014-10-181-0/+3
| | | | llvm-svn: 220135
* Avoid a crash after loading an #undef'd macro in code completionBen Langmuir2014-09-302-0/+4
| | | | | | | | | | | In code-completion, don't assume there is a MacroInfo for everything, since we aren't serializing the def corresponding to a later #undef in the same module. Also setup the HadMacro bit correctly for undefs to avoid an assertion failure. rdar://18416901 llvm-svn: 218694
* Fix the rececl chain for redeclarations of predefined declsBen Langmuir2014-08-181-0/+3
| | | | | | | | | Predefined decls like 'Protocol' in objc are not loaded from AST files, so we cannot rely on loading the canonical decl to complete the redecl chain for redeclarations of these decls. The broken redecl chain was non-circular, so looping over redecls() would hang. llvm-svn: 215929
* This test is XFAILed on Windows, but I cannot see a reason as to why it ↵Aaron Ballman2014-05-191-2/+0
| | | | | | | | should be failing. The original commit which XFAILed this was r111581, which suggested something was wrong with file remapping, but that may have been subsequently fixed. Removing the XFAIL, but will watch the build bots to see if any go red because of this. Local testing on Windows succeeds. llvm-svn: 209130
* Comment parsing: remove HTML attribute validationDmitri Gribenko2014-04-301-2/+2
| | | | | | | | | | | | Since the community says that a blacklist is not good enough, and I don't have enough time now to implement a proper whitelist, let's just remove the attribute validation. But, nevertheless, we can still communicate in the generated XML if our parser found an issue with the HTML. But this bit is best-effort and is specifically called out in the schema as such. llvm-svn: 207712
* Comment parsing: in the generated XML file, mark HTML that is safe to passDmitri Gribenko2014-04-221-1/+10
| | | | | | | | | | | through to the output even if the input comment comes from an untrusted source Attribute filtering is currently based on a blacklist, which right now includes all event handler attributes (they contain JavaScipt code). It should be switched to a whitelist, but going over all of the HTML5 spec requires a significant amount of time. llvm-svn: 206882
* Honour -ivfsoverlay in ASTUnit to match clangBen Langmuir2014-04-154-0/+29
| | | | | | | This allows code indexing, etc. to use the VFS in the same way as the compiler. llvm-svn: 206309
* libclang/libIndex: USR generation: mangle source location into USRs for macros,Dmitri Gribenko2014-03-281-0/+1
| | | | | | unless the macro comes from a system header llvm-svn: 205064
* Comment parsing: when comment ranges are deserialized from multiple modules,Dmitri Gribenko2014-03-273-0/+17
| | | | | | | | | correctly order comments in SourceManager::isBeforeInTranslationUnit() order Unfortunately, this is not as simple as it was implemented previously, and actually requires doing a merge sort. llvm-svn: 204936
* Preserve -fretain-comments-from-system-headers in modulesBen Langmuir2014-01-091-0/+4
| | | | | | | | Preserves the setting of -fretain-comments-from-system-headers when building/saving/loading module files. This allows code completion to pick up documentation comments from system modules. llvm-svn: 198890
* [c-index-test] For the '-remap-file' option use a comma for separator which ↵Argyrios Kyrtzidis2013-12-051-1/+1
| | | | | | | | is more Windows friendly than the colon. llvm-svn: 196529
* [c-index-test] For the '-remap-file=' option use ':' instead of ';' for ↵Argyrios Kyrtzidis2013-12-051-1/+1
| | | | | | | | separator. lldb does not like semicolon as part of an option. llvm-svn: 196485
* Ignore test Inputs globally and remove redundant lit.local.cfg filesAlp Toker2013-11-151-1/+0
| | | | | | | | | | By adding a default config.excludes pattern we can avoid individual suppressions in subdirectories. This matches LLVM's lit.cfg which also excludes a few other common non-test filenames for consistency. llvm-svn: 194814
* Documentation parsing: add support for \throws \throw \exception commandsDmitri Gribenko2013-11-121-3/+7
| | | | llvm-svn: 194521
* [PCH] Fix a PCH serialization crash, with invalid code related to forward ↵Argyrios Kyrtzidis2013-08-071-0/+3
| | | | | | | | | | | | | | | | enum references. The problem was that an enum without closing semicolon could be associated as a forward enum in an erroneous declaration, leading to the identifier being associated with the enum decl but without a declaration actually referencing it. This resulted in not having it serialized before serializing the identifier that is associated with. Also prevent the ASTUnit from querying the serialized DeclID for an invalid top-level decl; it may not have been serialized. rdar://14539667 llvm-svn: 187914
* Comment parsing: allow "\param ..." to describe variadic argumentsDmitri Gribenko2013-06-242-4/+23
| | | | | | | | Original patch by Fariborz Jahanian; extended by me. Fixes rdar://14124644 llvm-svn: 184688
* Comment parsing: followup to r184610: allow multiple \returnsDmitri Gribenko2013-06-221-3/+6
| | | | | | | | | Remove unneeded member in CommentSema, add a test for the XML schema (the schema already allowed multiple paragraphs in <ResultDiscussion>, but there were no tests for that), fix HTML generation (it is not allowed to have <p> inside <dl>). llvm-svn: 184652
* Have SourceManager::getLocForEndOfFile() point at the "EOF" location of the ↵Argyrios Kyrtzidis2013-05-071-0/+0
| | | | | | | | | | | FileID. This fixes a crash due to SourceManager::getLocForEndOfFile() returning an off-by-one location when the the FileID is for an empty file. rdar://13803893 llvm-svn: 181285
* doxygen command. Add 'attention' command to list of similarFariborz Jahanian2013-02-261-0/+1
| | | | | | doxygen commands. // rdar://12379053 llvm-svn: 176127
* Comment parsing: improve the fidelity of XML output for many block commandsDmitri Gribenko2013-02-013-0/+44
| | | | | | | | | | | | | | This change introduces a 'kind' attribute for the <Para> tag, that captures the kind of the parent block command. For example: \todo Meow. used to be just <Para>Meow.</Para>, but now it is <Para kind="todo">Meow.</Para> llvm-svn: 174216
* Revert r167801, "[preprocessor] When #including something that contributes noDaniel Dunbar2012-11-131-0/+0
| | | | | | tokens at all,". This change broke External/Nurbs in LLVM test-suite. llvm-svn: 167858
* [preprocessor] When #including something that contributes no tokens at all,Argyrios Kyrtzidis2012-11-131-0/+0
| | | | | | | | | don't recursively continue lexing. This avoids a stack overflow with a sequence of many empty #includes. rdar://11988695 llvm-svn: 167801
* Introduce inferred framework modules into the module map file,Douglas Gregor2012-11-061-0/+1
| | | | | | | | | | | | | | allowing a module map to be placed one level above the '.framework' directories to specify that all .frameworks within that directory can be inferred as framework modules. One can also specifically exclude frameworks known not to work. This makes explicit (and more restricted) behavior modules have had "forever", where *any* .framework was assumed to be able to be built as a module. That's not necessarily true, so we white-list directories (with exclusions) when those directories have been audited. llvm-svn: 167482
* Comment to XML conversion: escape XML special chars correctly; use correctDmitri Gribenko2012-10-031-0/+11
| | | | | | regex for version tuples. llvm-svn: 165104
* [Doc parse]: SUpport for message in deprecated/unavailableFariborz Jahanian2012-10-022-2/+3
| | | | | | attribute going iinto XML document. llvm-svn: 165066
* [Doc parsing]: Add available and deprecated attribute infoFariborz Jahanian2012-10-022-0/+12
| | | | | | to XML output. // rdar://12378879 llvm-svn: 165039
* Add xml test for availability to comment-xml-schema.cFariborz Jahanian2012-10-011-1/+5
| | | | llvm-svn: 164961
* availability in structured documents. TakesFariborz Jahanian2012-10-011-0/+7
| | | | | | care of comments by Dimitri and Doug. llvm-svn: 164957
* Add tests for r163778.Ted Kremenek2012-09-131-0/+8
| | | | llvm-svn: 163812
* Comment XML: use xml:space="preserve" in Verbatim tags, so that XML tidy doesDmitri Gribenko2012-08-081-0/+1
| | | | | | not compress spaces in verbatim content. llvm-svn: 161531
* Comment AST: DeclInfo: add a special kind for enums.Dmitri Gribenko2012-08-071-0/+6
| | | | | | Comment XML: add a root node kind for enums. llvm-svn: 161442
* libclang API for comment-to-xml conversion.Dmitri Gribenko2012-08-0731-0/+297
| | | | | | | | | | | | The implementation also includes a Relax NG schema and tests for the schema itself. The schema is used in c-index-test to verify that XML documents we produce are valid. In order to do the validation, we add an optional libxml2 dependency for c-index-test. Credits for CMake part go to Doug Gregor. Credits for Autoconf part go to Eric Christopher. Thanks! llvm-svn: 161431
* Handle include directive with comments. It turns out that in this case ↵Dmitri Gribenko2012-06-211-0/+2
| | | | | | comments are not coming in source order. Instead of trying to std::sort() comments (which can be costly), just remove comments that are not in order. llvm-svn: 158940
* Ensure that we clean up after a failed module build and cope with theDouglas Gregor2012-01-292-0/+9
| | | | | | results in libclang. llvm-svn: 149200
* Implement code completion support for module import declarations, e.g.,Douglas Gregor2012-01-296-0/+17
| | | | | | | | | | | | @import <complete with module names here> or @import std.<complete with submodule names here> Addresses <rdar://problem/10710117>. llvm-svn: 149199
* [PCH] Fix reading from PCH of diagnostic pragmas.Argyrios Kyrtzidis2011-11-091-0/+1
| | | | | | | | | | | In certain cases ASTReader would call the normal DiagnosticsEngine API to initialize the state of diagnostic pragmas but DiagnosticsEngine would try to compare source locations leading to crash because the main FileID was not yet initialized. Yet another case of the ASTReader trying to use the normal APIs and inadvertently breaking invariants. Fix this by having the ASTReader set up the internal state directly. llvm-svn: 144153
* Add missing part of testDouglas Gregor2011-11-071-0/+14
| | | | llvm-svn: 143985
* Eliminate a hang while loading a sequence of redeclarable entities. InDouglas Gregor2011-10-261-0/+21
| | | | | | | | | | | essence, the redeclaration chain for a class could end up in an inconsistent state while deserializing multiple declarations in that chain, where the circular linked list was not, in fact, circular. Since only two redeclarations of the same entity will get loaded when we're in this state, restore circularity when both have been loaded. Fixes <rdar://problem/10324940> / PR11195. llvm-svn: 143037
* Revamp the SourceManager to separate the representation of parsedDouglas Gregor2011-07-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | source locations from source locations loaded from an AST/PCH file. Previously, loading an AST/PCH file involved carefully pre-allocating space at the beginning of the source manager for the source locations and FileIDs that correspond to the prefix, and then appending the source locations/FileIDs used for parsing the remaining translation unit. This design forced us into loading PCH files early, as a prefix, whic has become a rather significant limitation. This patch splits the SourceManager space into two parts: for source location "addresses", the lower values (growing upward) are used to describe parsed code, while upper values (growing downward) are used for source locations loaded from AST/PCH files. Similarly, positive FileIDs are used to describe parsed code while negative FileIDs are used to file/macro locations loaded from AST/PCH files. As a result, we can load PCH/AST files even during parsing, making various improvemnts in the future possible, e.g., teaching #include <foo.h> to look for and load <foo.h.gch> if it happens to be already available. This patch was originally written by Sebastian Redl, then brought forward to the modern age by Jonathan Turner, and finally polished/finished by me to be committed. llvm-svn: 135484
* Introduce a new libclang API, clang_isFileMultipleIncludeGuarded(),Douglas Gregor2011-05-042-0/+9
| | | | | | | | which determines whether a particular file is actually a header that is intended to be guarded from multiple inclusions within the same translation unit. llvm-svn: 130808
* When determining which preprocessed entities to traverse in libclang,Douglas Gregor2010-12-212-0/+8
| | | | | | | | take into account the region of interest. Otherwise, we may fail to traverse some important preprocessed entity cursors. Fixes <rdar://problem/8554072>. llvm-svn: 122350
* When setting the globally-visible declarations for a particularDouglas Gregor2010-09-242-0/+5
| | | | | | | | | | | | | identifier, we may have a Sema object but no translation unit scope (because parsing is finished). In this case, we still need to update the IdResolver, which might still be used when writing a PCH containing another PCH (without chaining). This bug manifested as a failure with precompiled preambles. Also, add a little environment-variable-sensitive logging for libclang. llvm-svn: 114774
OpenPOWER on IntegriCloud