summaryrefslogtreecommitdiffstats
path: root/include/clang/Edit
Commit message (Collapse)AuthorAgeFilesLines
* [clang] Fix format specifiers fixits for nested macrosAlexander Shaposhnikov2017-06-201-4/+15
| | | | | | | | | | | | | | | ExpansionLoc was previously calculated incorrectly in the case of nested macros expansions. In this diff we build the stack of expansions where the last one is the actual expansion which should be used for grouping together the edits. The definition of MacroArgUse is adjusted accordingly. Test plan: make check-all Differential revision: https://reviews.llvm.org/D34268 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305845 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Fix format specifiers fixitsAlexander Shaposhnikov2017-06-081-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This diff fixes printf "fixits" in the case when there is a wrapping macro and the format string needs multiple replacements. In the presence of a macro there is an extra logic in EditedSource.cpp to handle multiple uses of the same macro argument (see the old comment inside EditedSource::canInsertInOffset) which was mistriggerred when the argument was used only once but required multiple adjustments), as a result the "fixit" was breaking down the format string by dropping the second format specifier, i.e. Log1("test 4: %s %s", getNSInteger(), getNSInteger()) was getting replaced with Log1("test 4: %ld ", (long)getNSInteger(), (long)getNSInteger()) (if one removed the macro and used printf directly it would work fine). In this diff we track the location where the macro argument is used and (as it was before) the modifications originating from all the locations except the first one are rejected, but multiple changes are allowed. Test plan: make check-all Differential revision: https://reviews.llvm.org/D33976 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305018 91177308-0d34-0410-b5e6-96231b3b80d8
* [ARCMigrate] When applying changes from remap files, disable the ↵Argyrios Kyrtzidis2017-04-281-1/+1
| | | | | | | | | 'adjustRemovals' functionality of EditedSource 'adjustRemovals' is used to avoid situation when removing a range inadvertently causes 2 separate identifiers to get joined into one. But it is not useful when the edits are character precise, as is the case with the remap files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301602 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275882 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll-back r250822.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250827 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250822 91177308-0d34-0410-b5e6-96231b3b80d8
* [Edit] Fix issue with tracking what macro argument inputs have been edited.Argyrios Kyrtzidis2015-09-111-2/+14
| | | | | | This was not working correctly, leading to erroneously rejecting valid edits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247462 91177308-0d34-0410-b5e6-96231b3b80d8
* [Edit] Use StringRef's copy method. No functional change intended.Benjamin Kramer2015-08-042-11/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@243968 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-225-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240353 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-225-5/+5
| | | | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240270 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'Craig Topper2014-05-062-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208063 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] Revert r191796, it's not needed anymore.Argyrios Kyrtzidis2014-04-282-11/+3
| | | | | | rdar://16223810 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207391 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Stop specifying size overrides for BumpPtrAllocators.Chandler Carruth2014-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | These don't seem to have any real point. Let's start with IndexingContext. I can't come up with any conceivable reason to have many hundereds of thousands of these alive in an address space which would make the 4x difference in allocated (but unused) memory for the string scratch buffer a significant memory usage problem. The EditedSource one is somewhat more surprising. This is an 8x increase in the memory allocated (but not used) per editted source file. However, for this to realistically be a problem, you would need to have over half a million editted source files in a single address space, and even that would only really have problems on 32-bit Windows where you really only have 2gb of virtual address space. And what's more important, the fix to this if it is actually an issue shouldn't be to shrink the allocator's size, it is to pass a single allocator into *many* edited source file objects and let them share the memory. These were the only two uses of custom sized BumpPtrAllocators (excluding ones in the JIT using a custom allocation strategy) in all of LLVM, Clang, LLD, LLDB, or Polly. I don't think we actually need this complexity in the primary BumpPtrAllocator at all and am planning to remove it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204910 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Simplify compare operators with std::tie.Benjamin Kramer2014-03-031-8/+4
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202755 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator: When doing migration, migrator must suggestFariborz Jahanian2013-10-012-3/+11
| | | | | | | | | migration of headers which have become system headers by user having put the .system_framework in the sdk directory. // rdar://15066802 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191796 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator: Remove semicolon after the typedefFariborz Jahanian2013-07-181-11/+0
| | | | | | | | declaration when converting to NS_ENUM. This required some code refactoring. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186619 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migration. migration to NS_ENUM/SN_OPTIONFariborz Jahanian2013-07-181-0/+6
| | | | | | | - wip. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186604 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjC migrator: build conforming interfaceFariborz Jahanian2013-07-161-0/+6
| | | | | | | | declaration (not yet used). wip. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186369 91177308-0d34-0410-b5e6-96231b3b80d8
* [Objective-C migrator] replace candidate user setter/getter withFariborz Jahanian2013-07-081-0/+9
| | | | | | | their equivalent property declaration. wip. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185873 91177308-0d34-0410-b5e6-96231b3b80d8
* [objc migrator]: More knobs to do migration toFariborz Jahanian2013-07-051-0/+5
| | | | | | | use of objc's properties. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185724 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallVectorImpl instead of SmallVector for iterators and references to ↵Craig Topper2013-07-041-1/+1
| | | | | | avoid specifying the vector size unnecessarily. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185610 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] Rewrite a NSDictionary dictionaryWithObjects:forKeys: to a ↵Argyrios Kyrtzidis2013-01-161-1/+3
| | | | | | | | | | | | | | | | | | dictionary literal if we can see the elements of the arrays. for example: NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"1", @"2", nil] forKeys:[NSArray arrayWithObjects:@"A", @"B", nil]]; --> NSDictionary *dict = @{ @"A" : @"1", @"B" : @"2" }; rdar://12428166 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172679 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort #include lines for all files under include/...Chandler Carruth2012-12-042-2/+2
| | | | | | | This is a simpler sort, entirely automatic with the help of llvm/utils/sort_includes.py -- no manual edits here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169238 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor recording the preprocessor conditional directive regions out ofArgyrios Kyrtzidis2012-12-042-7/+9
| | | | | | | | | PreprocessingRecord and into its own class, PPConditionalDirectiveRecord. Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord without needing a PreprocessingRecord. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169229 91177308-0d34-0410-b5e6-96231b3b80d8
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-1/+1
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
* Just use memcpy directly, uninitialized_copy requires an <algorithm> include.Benjamin Kramer2012-03-061-1/+1
| | | | | | Newer libstdc++s don't include it transitively everywhere. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152142 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new code migrator support for migrating existing Objective-C code to useTed Kremenek2012-03-065-0/+360
the new Objective-C NSArray/NSDictionary/NSNumber literal syntax. This introduces a new library, libEdit, which provides a new way to support migration of code that improves on the original ARC migrator. We now believe that most of its functionality can be refactored into the existing libraries, and thus this new library may shortly disappear. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152141 91177308-0d34-0410-b5e6-96231b3b80d8