summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/PartialDiagnostic.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-18/+18
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834 91177308-0d34-0410-b5e6-96231b3b80d8
* [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-02-161-28/+32
| | | | | | other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325412 91177308-0d34-0410-b5e6-96231b3b80d8
* Customize the SFINAE diagnostics for enable_if to provide the failed condition.Douglas Gregor2017-07-051-0/+9
| | | | | | | | | | | | | | | | | | | | When enable_if disables a particular overload resolution candidate, rummage through the enable_if condition to find the specific condition that caused the failure. For example, if we have something like: template< typename Iter, typename = std::enable_if_t<Random_access_iterator<Iter> && Comparable<Iterator_value_type<Iter>>>> void mysort(Iter first, Iter last) {} and we call "mysort" with "std::list<int>" iterators, we'll get a diagnostic saying that the "Random_access_iterator<Iter>" requirement failed. If we call "mysort" with "std::vector<something_not_comparable>", we'll get a diagnostic saying that the "Comparable<...>" requirement failed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307196 91177308-0d34-0410-b5e6-96231b3b80d8
* SourceRanges are small and trivially copyable, don't them by reference.Craig Topper2015-10-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249259 91177308-0d34-0410-b5e6-96231b3b80d8
* Header guard canonicalization, clang part.Benjamin Kramer2014-08-131-2/+2
| | | | | | Modifications made by clang-tidy with minor tweaks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215557 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean DiagRanges. Fix a possible problem introduced in r209468.Alexander Kornienko2014-05-231-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209491 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove limits on the number of fix-it hints and ranges in the DiagnosticsEngine.Alexander Kornienko2014-05-221-16/+7
| | | | | | | | | | | | | | | | | | | Summary: The limits on the number of fix-it hints and ranges attached to a diagnostic are arbitrary and don't apply universally to all users of the DiagnosticsEngine. The way the limits are enforced may lead to diagnostics generating invalid sets of fixes. I suggest removing the limits, which will also simplify the implementation. Reviewers: rsmith Reviewed By: rsmith Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D3879 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209468 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'Craig Topper2014-05-061-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208063 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace LLVM-style type traits with C++11 standard ones.Benjamin Kramer2014-03-071-2/+2
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203241 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Remove use of LLVM_HAS_RVALUE_REFERENCES from Clang. This macroChandler Carruth2014-03-011-4/+0
| | | | | | is now always 1, as we're requiring C++11 now! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202584 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor all diagnosing of TypoCorrections through a common function, inRichard Smith2013-08-171-0/+21
| | | | | | | | preparation for teaching this function how to diagnose a correction that includes importing a module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188602 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-1/+1
| | | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify PDiag's move assignment overload a bit, the self-move check isn't ↵Benjamin Kramer2012-12-061-9/+5
| | | | | | | | actually necessary. This just empties out the diag, which is fine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169542 91177308-0d34-0410-b5e6-96231b3b80d8
* Add move semantics to PartialDiagnostic, which can be very expensive to copy.Benjamin Kramer2012-12-061-0/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169535 91177308-0d34-0410-b5e6-96231b3b80d8
* Documentation cleanup:James Dennett2012-07-021-13/+15
| | | | | | | | | | | | * Primarily, added \brief to most of include/clang/Basic, instead of prefixing the comments with "DeclaredName - "; * Made some brief summaries significantly briefer; * Fixed up some erroneous uses of \see and \arg; * Fixed up some extraneous backslashes in \code...\endcode blocks; * Fixed up some typos/spelling errors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159616 91177308-0d34-0410-b5e6-96231b3b80d8
* Documentation cleanup: reformatting/fixing up file comments so that they haveJames Dennett2012-07-021-4/+5
| | | | | | | | | \file and \brief markup and appear in Doxygen's summaries (and eventually at http://clang.llvm.org/doxygen/files.html). Fixed up another couple of minor glitches in the docs at the same time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159517 91177308-0d34-0410-b5e6-96231b3b80d8
* When we suppress an error due to SFINAE, stash the diagnostic away with theRichard Smith2012-05-071-0/+24
| | | | | | | | | | | | | | | | | | | | overload candidate, and include its message in any subsequent 'candidate not viable due to substitution failure' note we may produce. To keep the note small (since the 'overload resolution failed' diagnostics are often already very verbose), the text of the SFINAE diagnostic is included as part of the text of the note, and any notes which were attached to it are discarded. There happened to be spare space in OverloadCandidate into which a PartialDiagnosticAt could be squeezed, and this patch goes to lengths to avoid unnecessary PartialDiagnostic copies, resulting in no slowdown that I could measure. (Removal in passing of some PartialDiagnostic copies has resulted in a slightly smaller clang binary overall.) Even on a torture test, I was unable to measure a memory increase of above 0.2%. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156297 91177308-0d34-0410-b5e6-96231b3b80d8
* [Basic] PartialDiagnostic: Manual split out the cold part of freeStorage(), theDaniel Dunbar2012-03-081-0/+10
| | | | | | | hot path will typically profitably get inlined (based on what I see from the users of PartialDiagnostic). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152322 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my patches which removed Diagnostic.h includes by moving some ↵Benjamin Kramer2012-02-071-73/+77
| | | | | | | | | | | | | | | | | | operator overloads out of line. This seems to negatively affect compile time onsome ObjC tests (which use a lot of partial diagnostics I assume). I have to come up with a way to keep them inline without including Diagnostic.h everywhere. Now adding a new diagnostic requires a full rebuild of e.g. the static analyzer which doesn't even use those diagnostics. This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99. This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789. This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7. This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f. This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150006 91177308-0d34-0410-b5e6-96231b3b80d8
* Move Storage and StorageAllocator out of the PartialDiagnostic class so we ↵Benjamin Kramer2012-02-041-77/+73
| | | | | | | | | can forward declare them. Let ASTContext allocate the storage in its BumpPtrAllocator. This will help us remove ASTContext's depedency on PartialDiagnostic.h soon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149780 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the fixed array of FixitHints to a SmallVector to lift offArgyrios Kyrtzidis2012-02-031-18/+6
| | | | | | the limit on the number of fixits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149676 91177308-0d34-0410-b5e6-96231b3b80d8
* Workaround for compilers that don't implement C++ DR45, from Tom Honermann!Douglas Gregor2011-11-091-2/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144161 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix all 80 col violations in include/clang/Basic, plus any trailing ↵David Blaikie2011-10-201-51/+51
| | | | | | whitespace in the files I'm touching anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142564 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't crash when trying to emit too many fixits. Also, keep some constants inMatt Beaumont-Gay2011-10-031-2/+4
| | | | | | sync between DiagnosticsEngine and PartialDiagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141006 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename DiagnosticInfo to Diagnostic as per issue 5397David Blaikie2011-09-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140493 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-9/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
* now that we have a centralized place to do so, add some using declarations forChris Lattner2011-07-201-2/+2
| | | | | | | | some common llvm types: stringref and smallvector. This cleans up the codebase quite a bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135576 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | | | Luis Felipe Strano Moraes! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129559 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance Sema::DiagRuntimeBehavior() to delay some diagnostics to see if the ↵Ted Kremenek2011-02-231-1/+1
| | | | | | | | | | related code is reachable. This suppresses some diagnostics that occur in unreachable code (e.g., -Warray-bound). We only pay the cost of doing the reachability analysis when we issue one of these diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126290 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120297 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce support for emitting diagnostics (warnings + their notes)Douglas Gregor2010-10-121-2/+51
| | | | | | | | | | | | | | | | | that are suppressed during template argument deduction. This change queues diagnostics computed during template argument deduction. Then, if the resulting function template specialization or partial specialization is chosen by overload resolution or partial ordering (respectively), we will emit the queued diagnostics at that point. This addresses most of PR6784. However, the check for unnamed/local template arguments (which existed before this change) is still only skin-deep, and needs to be extended to look deeper into types. It must be improved to finish PR6784. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116373 91177308-0d34-0410-b5e6-96231b3b80d8
* introduce a new CharSourceRange class, and enhance the diagnostics routinesChris Lattner2010-06-181-3/+9
| | | | | | | | | | | | | | | | | | | to use them instead of SourceRange. CharSourceRange is just a SourceRange plus a bool that indicates whether the range has the end character resolved or whether the end location is the start of the end token. While most of the compiler wants to think of ranges that have ends that are the start of the end token, the printf diagnostic stuff wants to highlight ranges within tokens. This is transparent to the diagnostic stuff. To start taking advantage of the new capabilities, you can do something like this: Diag(..) << CharSourceRange::getCharRange(Begin,End) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106338 91177308-0d34-0410-b5e6-96231b3b80d8
* Resolve a layering violation by making AddTaggedVal public forChandler Carruth2010-04-021-23/+10
| | | | | | | | | PartialDiagnostic objects, and hoisting the stream operator for QualType into Type.h with the operator for the normal DiagnosticBuilder. Also remove the no longer needed friend declaration for the DeclarationName stream operator. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100169 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-311-16/+14
| | | | | | | the C-only "optimization". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100022 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor2010-03-311-14/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100018 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor2010-03-311-16/+14
| | | | | | | | | term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100008 91177308-0d34-0410-b5e6-96231b3b80d8
* When copying a partial diagnostic into a DependentDiagnostic, allocateDouglas Gregor2010-03-291-4/+18
| | | | | | | | | | storage for that partial diagnostic via the ASTContext's BumpPtrAllocator rather than using up slots in the ASTContext's cache. Now that we do this, we don't have to worry about destroying dependent diagnostics when destroying a DependentStoredDeclsMap. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99854 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize PartialDiagnostic's memory-allocation behavior by placing aDouglas Gregor2010-03-291-22/+88
| | | | | | | | | | | | | | | cache of PartialDiagnostic::Storage objects into an allocator within the ASTContext. This eliminates a significant amount of malloc traffic, for a 10% performance improvement in -fsyntax-only wall-clock time with 403.gcc's combine.c. Also, eliminate the RequireNonAbstractType hack I put in earlier, which was but a symptom of this larger problem. Fixes <rdar://problem/7806091>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99849 91177308-0d34-0410-b5e6-96231b3b80d8
* Perform access control for the implicit base and member destructor callsJohn McCall2010-03-161-0/+4
| | | | | | | | required when emitting a destructor definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98609 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark PartialDiagnostic.h as a C++ headerSebastian Redl2010-01-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94363 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't emit string-comparison or self-comparison warnings inDouglas Gregor2010-01-121-1/+37
| | | | | | | | | | | unevaluated contexts, because they only matter for code that will actually be evaluated at runtime. As part of this, I had to extend PartialDiagnostic to support fix-it hints. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93266 91177308-0d34-0410-b5e6-96231b3b80d8
* Give PartialDiagnostic copy semantics rather than move semantics, since we ↵Douglas Gregor2009-12-121-7/+22
| | | | | | typically pass it by reference git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91212 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary pointers from PartialDiagnosticDouglas Gregor2009-12-121-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91211 91177308-0d34-0410-b5e6-96231b3b80d8
* Add fixit hint to bitwise precedence warning.Sebastian Redl2009-10-261-3/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85129 91177308-0d34-0410-b5e6-96231b3b80d8
* Add CheckCallReturnType and start using it for regular call expressions. ↵Anders Carlsson2009-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This will improve error messages. For struct B; B f(); void g() { f(); } We now get t.cpp:6:3: error: calling 'f' with incomplete return type 'struct B' f(); ^~~ t.cpp:3:3: note: 'f' declared here B f(); ^ t.cpp:1:8: note: forward declaration of 'struct B' struct B; ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83692 91177308-0d34-0410-b5e6-96231b3b80d8
* WIP implementation of explicit instantiation of function templates,Douglas Gregor2009-09-251-0/+6
| | | | | | | | | | member functions of class template specializations, and static data members. The mechanics are (mostly) present, but the semantic analysis is very weak. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82789 91177308-0d34-0410-b5e6-96231b3b80d8
* New RequireNonAbstractType function.Anders Carlsson2009-08-271-2/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80183 91177308-0d34-0410-b5e6-96231b3b80d8
* The PartialDiagnostic constructor doesn't need to be explicit.Anders Carlsson2009-08-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80164 91177308-0d34-0410-b5e6-96231b3b80d8
* More improvements to PartialDiagnostic.Anders Carlsson2009-08-261-6/+53
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80158 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the partially implemented PartialDiagnostic class.Anders Carlsson2009-08-261-0/+97
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80106 91177308-0d34-0410-b5e6-96231b3b80d8