summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaFixItUtils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* [Sema] Revert r329346 because of memory sanitizer failures.Eugene Zelenko2018-04-051-20/+9
| | | | llvm-svn: 329357
* [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-04-051-9/+20
| | | | | | other minor fixes (NFC). llvm-svn: 329346
* Wire a SourceLocation into IsDerivedFrom and move the RequireCompleteType callRichard Smith2015-12-181-1/+1
| | | | | | | | for the derived class into it. This is mostly just a cleanup, but could in principle be a bugfix if there is some codepath that reaches here and didn't previously require a complete type (I couldn't find any such codepath, though). llvm-svn: 256037
* Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFCCraig Topper2015-11-151-2/+2
| | | | llvm-svn: 253155
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-291-5/+2
| | | | | | | | | | | | | | Modules builds fundamentally have a non-linear macro history. In the interest of better source fidelity, represent the macro definition information faithfully: we have a linear macro directive history within each module, and at any point we have a unique "latest" local macro directive and a collection of visible imported directives. This also removes the attendent complexity of attempting to create a correct MacroDirective history (which we got wrong in the general case). No functionality change intended. llvm-svn: 236176
* PR17290: Use 'false' macro in fix-it hint for initializing a variable of typeRichard Smith2013-09-201-10/+18
| | | | | | | | | _Bool in C, if the macro is defined. Also teach FixItUtils to look at whether the macro was defined at the source location for which it is creating a fixit, rather than looking at whether it's defined *now*. This is especially relevant for analysis-based warnings which are delayed until end of TU. llvm-svn: 191057
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-2/+2
| | | | llvm-svn: 171367
* Drop the ASTContext.h include from Stmt.h and fix up transitive users.Benjamin Kramer2012-07-041-0/+1
| | | | | | | | | | | | | | This required moving the ctors for IntegerLiteral and FloatingLiteral out of line which shouldn't change anything as they are usually called through Create methods that are already out of line. ASTContext::Deallocate has been a nop for a long time, drop it from ASTVector and make it independent from ASTContext.h Pass the StorageAllocator directly to AccessedEntity so it doesn't need to have a definition of ASTContext around. llvm-svn: 159718
* Add FixItHint for -Wnull-conversion to initialize with an appropriate literal.David Blaikie2012-04-301-29/+41
| | | | | | Reviewed by Doug Gregor. llvm-svn: 155839
* Use character literals for vexing initialization fixit hints.David Blaikie2012-03-181-0/+8
| | | | | | | | | | | | | | | Instead of suggesting " = 0" for "char c();", suggest " = '\0'", and similarly for other char types (wide, 16, and 32). Add tests for all these, and since this means testing such hints under C++0x, add tests for some untested C++0x hint cases in the existing code, including suggesting nullptr for pointer initialization. This sets up the initialization helper to provide better type fidelity that will be especially helpful for non-assignment cases (such as fixit-correcting NULL usage in function calls (eg: foo(char) + foo(NULL) => foo('\0') instead of the less informative foo(0))) llvm-svn: 153008
* Refactor for clarity.Richard Smith2012-01-131-18/+24
| | | | llvm-svn: 148135
* Don't crash while trying to diagnose a function declared at block scope with anRichard Smith2012-01-131-2/+4
| | | | | | incomplete return type. llvm-svn: 148088
* Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:Richard Smith2012-01-121-0/+28
| | | | | | | | | | | | | | | | | | | | | | | - If the declarator is at the start of a line, and the previous line contained another declarator and ended with a comma, then that comma was probably a typo for a semicolon: int n = 0, m = 1, l = 2, // k = 5; myImportantFunctionCall(); // oops! - If removing the parentheses would correctly initialize the object, then produce a note suggesting that fix. - Otherwise, if there is a simple initializer we can suggest which performs value-initialization, then provide a note suggesting a correction to that initializer. Sema::Declarator now tracks the location of the comma prior to the declarator in the declaration, if there is one, to facilitate providing the note. The code to determine an appropriate initializer from the -Wuninitialized warning has been factored out to allow use in both that and -Wvexing-parse. llvm-svn: 148072
* Refactor the */& mismatch fixit generation out of SemaOverload and provide a ↵Anna Zaks2011-07-281-0/+160
simple conversion checking function. llvm-svn: 136376
OpenPOWER on IntegriCloud