summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTDiagnostic.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix cppcheck uninitialized variable in DiffTree() constructor warning. NFCI.Simon Pilgrim2020-01-131-2/+1
|
* Merge isVectorType() and getAs<VectorType> calls to silence clang static ↵Simon Pilgrim2020-01-131-2/+1
| | | | analyzer warning. NFCI.
* [Sema] Improve diagnostic about addr spaces for overload candidatesAnastasia Stulova2019-12-131-1/+16
| | | | | | | | | | Allow sending address spaces into diagnostics to simplify and improve error reporting. Improved wording of diagnostics for address spaces in overloading. Tags: #clang Differential Revision: https://reviews.llvm.org/D71111
* Rename TypeNodes.def to TypeNodes.inc for consistency across allJohn McCall2019-10-021-1/+1
| | | | | | | | our autogenerated files. NFC. As requested by Nico Weber. llvm-svn: 373425
* Recommit r359859 "[Attribute/Diagnostics] Print macro if definition is an ↵Leonard Chan2019-05-071-0/+5
| | | | | | | | attribute declaration" Updated with fix for read of uninitialized memory. llvm-svn: 360109
* Revert "[Attribute/Diagnostics] Print macro if definition is an attribute ↵Leonard Chan2019-05-031-5/+0
| | | | | | | | declaration" This reverts commit fc40cbd9d8c63e65eed3590ba925321afe782e1d. llvm-svn: 359859
* [Attribute/Diagnostics] Print macro if definition is an attribute declarationLeonard Chan2019-05-021-0/+5
| | | | | | | | | | | | | If an address_space attribute is defined in a macro, print the macro instead when diagnosing a warning or error for incompatible pointers with different address_spaces. We allow this for all attributes (not just address_space), and for multiple attributes declared in the same macro. Differential Revision: https://reviews.llvm.org/D51329 llvm-svn: 359826
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [Basic] Extend DiagnosticEngine to store and format Qualifiers.Anastasia Stulova2019-01-041-0/+14
| | | | | | | | | | | Qualifiers can now be streamed into the DiagnosticEngine using regular << operator. If Qualifiers are empty 'unqualified' will be printed in the diagnostic otherwise regular qual syntax is used. Differential Revision: https://reviews.llvm.org/D56198 llvm-svn: 350386
* Remove trailing spaceFangrui Song2018-07-301-6/+6
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-1/+1
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 331834
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-031-0/+1
| | | | llvm-svn: 304650
* PR30831: Teach template type diffing to cope with TemplateSpecializationTypesRichard Smith2016-10-281-7/+10
| | | | | | that desugar to non-TSTs (such as injected-class-names). llvm-svn: 285437
* Fix typos from r277797 and unused variable from r277889.Richard Trieu2016-08-061-4/+4
| | | | llvm-svn: 277900
* Fix crash in template type diffing.Richard Trieu2016-08-051-0/+6
| | | | | | | | | When the type being diffed is a type alias, and the orginal type is not a templated type, then there will be no unsugared TemplateSpecializationType. When this happens, exit early from the constructor. Also add assertions to the other iterator accessor to prevent the iterator from being used. llvm-svn: 277797
* [NFC] Header cleanupMehdi Amini2016-07-181-1/+0
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* [AST] Use ArrayRef in more interfacesDavid Majnemer2016-07-071-3/+2
| | | | | | | | | ArrayRef is a little better than passing around a pointer/length pair. No functional change is intended. llvm-svn: 274732
* Apply some suggestions from clang-tidy's performance-unnecessary-value-param.Benjamin Kramer2016-06-151-8/+8
| | | | | | No functionality change intended. llvm-svn: 272789
* Fix Clang crash with template type diffing.Richard Trieu2016-03-301-3/+8
| | | | | | | | | | Fixes https://llvm.org/bugs/show_bug.cgi?id=27129 which is crash involving type aliases and template type diffing. Template arguments for type aliases and template arguments for the underlying desugared type may not have one-to-one relations, which could mess us the attempt to get more information from the desugared type. For type aliases, ignore the iterator over the desugared type. llvm-svn: 264940
* Fix some Clang-tidy readability-redundant-control-flow warnings; other minor ↵Eugene Zelenko2016-02-101-4/+2
| | | | | | | | fixes. Differential revision: http://reviews.llvm.org/D17060 llvm-svn: 260414
* Template Type Diffing changeRichard Trieu2016-02-021-3/+9
| | | | | | | When all the arguments of a template are elided, print "A<...>" instead of "A<[2 * ...]>". Also remove comment fragment that means nothing. llvm-svn: 259445
* Fix a -Wparentheses warning in ASTDiagnostic.cpp.James Y Knight2016-01-151-1/+1
| | | | llvm-svn: 257871
* Fixing more issues with template type diffingRichard Trieu2016-01-151-16/+20
| | | | | | | | | | | | 1) Print qualifiers for templates with zero arguments 2) Add a few more tests for the template type diffing refactoring. Specifically, PR24587 has been fixed and has a test case from http://reviews.llvm.org/D15384 3) Adds asserts to check the DiffTree is in correct state when moving nodes 4) Rename the field FromType and ToType since it is heavily used within member functions. llvm-svn: 257870
* Add new diff modes to template type diffing.Richard Trieu2016-01-151-8/+168
| | | | | | | | Remove an old assertion that does not hold. It is possible for a template argument to be a declaration in one instantiation and an integer in another. Create two new diff kinds for these (decl vs int and int vs decl). llvm-svn: 257869
* Save the integer type for integral template arguments.Richard Trieu2016-01-151-25/+64
| | | | | | | | | Save the integer type when diffing integers in template type diffing. When integers are different sizes, print out the type along with the integer value. Also with the type information, print true and false instead of 1 and 0 for boolean values. llvm-svn: 257861
* Make template type diffing use the new desguared iterator.Richard Trieu2016-01-151-322/+158
| | | | | | | | | | | | | If available, use the canonical template argument to fill in information for template type diffing instead of attempting to special case and evaluate Expr's for the value. Since those are the values used in template instantiation, we don't have to worry about difference between our evaluator and theirs. Also move the nullptr template arguments from DiffKind::Expression to DiffKind::Declaration and allow DiffKind::Declaration to set an Expr. The only effect that should result is that a named nullptr will show up as 'ptr aka nullptr' in diagnostics. llvm-svn: 257853
* Change the TSTiterator in Template Type Diffing.Richard Trieu2016-01-141-80/+117
| | | | | | | | Modify the TSTiterator to have two internal iterators, which will walk the provided sugared type and the desugared type. This will provide better access to the template argument information. No functional changes. llvm-svn: 257838
* Refactor template type diffingRichard Trieu2016-01-141-226/+249
| | | | | | | | | | | | | | | 1) Instead of using pairs of From/To* fields, combine fields into a struct TemplateArgInfo and have two in each DiffNode. 2) Use default initialization in DiffNode so that the constructor shows the only field that is initialized differently on construction. 3) Use Set and Get functions per each DiffKind to make sure all fields for the diff is set. In one case, the Expr fields were not set. 4) Don't print boolean literals for boolean template arguments. This prevents printing 'false aka 0' Only #3 has a functional change, which is reflected in the test change. llvm-svn: 257831
* Support __builtin_ms_va_list.Charles Davis2015-09-171-1/+2
| | | | | | | | | | | | | | | | | | Summary: This change adds support for `__builtin_ms_va_list`, a GCC extension for variadic `ms_abi` functions. The existing `__builtin_va_list` support is inadequate for this because `va_list` is defined differently in the Win64 ABI vs. the System V/AMD64 ABI. Depends on D1622. Reviewers: rsmith, rnk, rjmccall CC: cfe-commits Differential Revision: http://reviews.llvm.org/D1623 llvm-svn: 247941
* Remove and forbid raw_svector_ostream::flush() calls.Yaron Keren2015-08-131-2/+0
| | | | | | | | | | After r244870 flush() will only compare two null pointers and return, doing nothing but wasting run time. The call is not required any more as the stream and its SmallString are always in sync. Thanks to David Blaikie for reviewing. llvm-svn: 244928
* PR10405 - Desugar FunctionType and TemplateSpecializationType if any type ↵Nikola Smiljanic2015-07-161-4/+56
| | | | | | that appears inside needs to be desugared. llvm-svn: 242371
* AST: Avoid reading an unitialized valueJustin Bogner2015-07-081-2/+2
| | | | | | | | | | Desugar doesn't necessarily initialize ShouldAKA, but as of r241542 it may read it. Fix the misuse of the API and initialize this before passing it in. Found by ubsan. llvm-svn: 241705
* Implement the Objective-C __kindof type qualifier.Douglas Gregor2015-07-071-1/+2
| | | | | | | | | | The __kindof type qualifier can be applied to Objective-C object (pointer) types to indicate id-like behavior, which includes implicit "downcasting" of __kindof types to subclasses and id-like message-send behavior. __kindof types provide better type bounds for substitutions into unspecified generic types, which preserves more type information. llvm-svn: 241548
* Handle Objective-C type arguments.Douglas Gregor2015-07-071-0/+10
| | | | | | | | | | | | | | | | | | | | | Objective-C type arguments can be provided in angle brackets following an Objective-C interface type. Syntactically, this is the same position as one would provide protocol qualifiers (e.g., id<NSCopying>), so parse both together and let Sema sort out the ambiguous cases. This applies both when parsing types and when parsing the superclass of an Objective-C class, which can now be a specialized type (e.g., NSMutableArray<T> inherits from NSArray<T>). Check Objective-C type arguments against the type parameters of the corresponding class. Verify the length of the type argument list and that each type argument satisfies the corresponding bound. Specializations of parameterized Objective-C classes are represented in the type system as distinct types. Both specialized types (e.g., NSArray<NSString *> *) and unspecialized types (NSArray *) are represented, separately. llvm-svn: 241542
* Update assumption in template diffing about integer template arguments.Richard Trieu2015-02-261-6/+14
| | | | | | | | | | Fix for PR22017. Integer template arguments are automatically bit extended to the size of the integer type. In template diffing, evaluated expressions were not having their results extending, leading to comparing two APSInt's with different widths. Apply the proper bit extending when evaluating template arguments. This mainly affected bool template arguments. llvm-svn: 230603
* When checking the template argument list, use a copy of that list for changesRichard Trieu2015-01-241-22/+14
| | | | | | | | | | | | | | | | | | | and only update the orginal list on a valid arugment list. When checking an individual expression template argument, and conversions are required, update the expression in the template argument. Since template arguments are speculatively checked, the copying of the template argument list prevents updating the template arguments when the list does not match the template. Additionally, clean up the integer checking code in the template diffing code. The code performs unneccessary conversions from APSInt to APInt. Fixes PR21758. This essentially reverts r224770 to recommits r224667 and r224668 with extra changes to prevent the template instantiation problems seen in PR22006. A test to catch the discovered problem is also added. llvm-svn: 226983
* [msan] Fix a uninitialized-use bug in the template argument diffingChandler Carruth2015-01-171-1/+2
| | | | | | | | | | | | | | | | | logic. In one place we would try to check for the difference between integers even if we were missing one of the integers. This would eventually end up reading uninitialized data out of the APSInt objects. The fix is to short circuit the sameness test when we don't have integers on both sides. This fixes a test failure I was seeing with MSan. Not sure whether other bots were seeing it or not, but yay MSan. In particular the feature to very carefully track origins back through stores throughout the program was invaluable. llvm-svn: 226375
* This reverts commit r224668 and r224667.Rafael Espindola2014-12-231-14/+21
| | | | | | | | | | r224667 broke bootstrap on Fedora 20 X86_64 (at least). See pr22006 for the details. r224668 depends on r224667. llvm-svn: 224770
* Fix a bunch of integer template argument problems in template type diffing.Richard Trieu2014-12-201-20/+10
| | | | | | | | | | | | | Reverts most of the changes from r168005. Since template arguments have proper conversions now, no extending of integers is needed. Further, since the integers are the correct size now, use APSInt::operator== instead of APSInt::hasSameValue since operator== will check the size and signness match. Prior to one comparison of APSInt's, check that both are valid. Previous, one could be uninitialized. Also changed APInt to APSInt in GetInt. This occassionally produced a sign flip, which will now be caught by operator==. llvm-svn: 224668
* Fix for PR21758Richard Trieu2014-12-201-1/+4
| | | | | | | | | When a non-type template argument expression needs a conversion to change it into the argument type, preserve that information by remaking the TemplateArgument with an expression that has those conversions. Also a small fix to template type diffing to handle the extra conversions in some cases. llvm-svn: 224667
* Refactor one of the larger functions for Type Diffing into smaller functions.Richard Trieu2014-08-271-185/+215
| | | | | | No functionality change. llvm-svn: 216526
* Change a few methods to static methods. No functionality change.Richard Trieu2014-08-271-12/+15
| | | | llvm-svn: 216519
* Refactor the diagnostic DeclContext printing. No functionality change.Richard Trieu2014-08-271-10/+6
| | | | llvm-svn: 216517
* If a template argument is non-evaluable expression, use the profile ID to seeRichard Trieu2014-07-261-7/+8
| | | | | | if the two arguments are equal. llvm-svn: 214008
* Pass the PrintingPolicy when converting types to strings in template typeRichard Trieu2014-07-251-5/+6
| | | | | | | diffing. This removes extra "struct"/"class" in the type names and gives "bool" instead of "_Bool" for booleans. llvm-svn: 213912
* Print "(default)" for default template template arguments to match theRichard Trieu2014-07-241-0/+1
| | | | | | printing of other types. llvm-svn: 213902
* Add support for nullptr template arguments to template type diffing.Richard Trieu2014-07-241-31/+107
| | | | llvm-svn: 213840
* Fix '&' printing for template arguments in parentheses in template diffing.Richard Trieu2014-07-221-3/+6
| | | | llvm-svn: 213613
* More gracefully handle parentheses in templare arguments in template diffing.Richard Trieu2014-07-221-1/+2
| | | | llvm-svn: 213611
* Fix a template diffing problem were an '&' is unexpectedly printed inRichard Trieu2014-07-221-6/+26
| | | | | | a template argument. llvm-svn: 213609
OpenPOWER on IntegriCloud