summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make clang's rewrite engine a core featureAlp Toker2014-07-161-547/+0
| | | | | | | | | | | | | | | The rewrite facility's footprint is small so it's not worth going to these lengths to support disabling at configure time, particularly since key compiler features now depend on it. Meanwhile the Objective-C rewriters have been moved under the ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still potentially worth excluding from lightweight builds. Tests are now passing with any combination of feature flags. The flags historically haven't been tested by LLVM's build servers so caveat emptor. llvm-svn: 213171
* [C++11] Use 'nullptr'.Craig Topper2014-05-071-8/+10
| | | | llvm-svn: 208163
* write a line marker right before adding included fileLubos Lunak2014-05-011-0/+2
| | | | | | | | Enclosing the original #include directive inside #if 0 adds lines, so warning/errors messages would have the line number off in "In file included from <file>:<line>:", so add line marker to fix this. llvm-svn: 207795
* do not use "1" for line marker for the predefines "file" eitherLubos Lunak2014-05-011-1/+5
| | | | | | Similar to r207764. llvm-svn: 207794
* do not use "1" for line marker for the main fileLubos Lunak2014-05-011-2/+5
| | | | | | | | | | "1" means entering a new file (from a different one), but the main file is not included from anything (and this would e.g. confuse -Wunused-macros to not report unused macros in the main file, see pr15610, or also see pr18948). The line marker is still useful e.g. if the resulting file is renamed or used via a pipe. llvm-svn: 207764
* revert r207756Lubos Lunak2014-05-011-1/+0
| | | | | | | | There's nothing wrong with the change itself, but test/Frontend/rewrite-includes-messages.c fails without another not-yet-committed fix. llvm-svn: 207762
* do not warn about unknown pragmas in modes that do not handle them (pr9537)Lubos Lunak2014-05-011-7/+1
| | | | | | | And refactor to have just one place in code that sets up the empty pragma handlers. llvm-svn: 207758
* write a line marker right before adding included fileLubos Lunak2014-05-011-0/+1
| | | | | | | | Enclosing the original #include directive inside #if 0 adds lines, so warning/errors messages would have the line number off in "In file included from <file>:<line>:", so add line marker to fix this. llvm-svn: 207756
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-151-15/+10
| | | | | | class. llvm-svn: 203999
* Implement MSVC header search algorithm in MicrosoftMode.Will Wilson2013-12-271-1/+1
| | | | | | Follows algorithm described here: http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx llvm-svn: 198082
* Fix raw lex crash and -frewrite-includes noeol-at-eof failureAlp Toker2013-12-131-5/+5
| | | | | | Raw lexers don't have a preprocessor so we need to null check. llvm-svn: 197245
* Check the initial line number without going through PresumedLocAlp Toker2013-12-051-3/+2
| | | | | | | No practical difference in this case and would return 1 either way, but this is more self-explanatory. llvm-svn: 196511
* Add an assert to make it clear we're on the first lineAlp Toker2013-12-051-1/+3
| | | | | | A raw lexer in its initial state is guaranteed to be on line number one. llvm-svn: 196461
* Revert r196372, "do not warn about unknown pragmas in modes that do not ↵NAKAMURA Takumi2013-12-041-1/+7
| | | | | | | | handle them (pr9537)" It broke clang tests on some hosts with +Asserts. Seems "STDC" clashes. llvm-svn: 196376
* do not warn about unknown pragmas in modes that do not handle them (pr9537)Lubos Lunak2013-12-041-7/+1
| | | | | | | And refactor to have just one place in code that sets up the empty pragma handlers. llvm-svn: 196372
* InclusionRewriter: Avoid duplicated BOM checkAlp Toker2013-11-281-7/+3
| | | | | | | The lexer already knows its position in the file, so use that instead of guessing it might be 3. llvm-svn: 195910
* strip UTF-8 BOM in -frewrite-includes (PR#15664)Lubos Lunak2013-11-271-0/+5
| | | | llvm-svn: 195877
* Fix typo: inccrementallyBenjamin Kramer2013-10-131-1/+1
| | | | llvm-svn: 192551
* Address review comment on r189557.Eli Friedman2013-09-171-1/+3
| | | | | | | | | We need to escape filenames the same way in InclusionRewriter whether UseLineDirective is true or false. Review comment from http://llvm.org/bugs/show_bug.cgi?id=17018#c2 llvm-svn: 190834
* Properly escape filenames in line directives.Eli Friedman2013-08-291-1/+3
| | | | | | | Fixes PR17018. Only partial test coverage because I don't want to try to write a test which generates a file whose name contains a newline. llvm-svn: 189557
* [frontend] '-frewrite-includes' should not ignore headers included from ↵Argyrios Kyrtzidis2013-07-261-1/+12
| | | | | | | | command-line. rdar://14556182 llvm-svn: 187207
* avoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)Lubos Lunak2013-07-201-0/+8
| | | | llvm-svn: 186764
* fix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)Lubos Lunak2013-07-201-3/+30
| | | | | | | | Every #include is surrounded by #if 0 in order to comment it out, which adds lines. That is fixed up right after, but that all can be inside #if part that is not processed, so fix up also after every end of a conditional part. llvm-svn: 186763
* Have SourceManager::getLocForEndOfFile() point at the "EOF" location of the ↵Argyrios Kyrtzidis2013-05-071-1/+1
| | | | | | | | | | | 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
* rewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency.Benjamin Kramer2013-04-161-1/+119
| | | | | | | | | | | | | | This broke e.g. compiling a crash report from a glibc system on Darwin. Sadly, the implementation had to game the lexer a lot as we're not using a real preprocessor here. It also doesn't handle special cases like arbitrary macros in __has_include, but since this macro isn't common outside of clang's headers we can get away with that. Fixes PR14422. Differential Revision: http://llvm-reviews.chandlerc.com/D594 llvm-svn: 179616
* [frontend] -frewrite-includes: turn implicit module imports into @imports.Argyrios Kyrtzidis2013-04-101-15/+24
| | | | | | rdar://13610250 llvm-svn: 179145
* [frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo ↵Argyrios Kyrtzidis2013-04-101-3/+8
| | | | | | that indicates return from another file. llvm-svn: 179143
* Use trailing documentation comments properlyDmitri Gribenko2013-02-161-1/+1
| | | | | | Patch by Alexander Zinenko. llvm-svn: 175376
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Silencing an MSVC warning about */ being found outside of a comment.Aaron Ballman2012-10-021-1/+1
| | | | llvm-svn: 165007
* For PPCallbacks::InclusionDirective() add a parameter for the module, wheneverArgyrios Kyrtzidis2012-09-291-2/+4
| | | | | | | an inclusion directive was automatically turned into a module import, and PPCallbacks::moduleImport() for an explicit module import. llvm-svn: 164874
* Per discussion in ↵Argyrios Kyrtzidis2012-09-271-2/+2
| | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917/064551.html have PPCallbacks::InclusionDirective pass the character range for the filename quotes or brackets. rdar://11113134 & http://llvm.org/PR13880 llvm-svn: 164743
* Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek2012-09-011-0/+361
This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. llvm-svn: 163050
OpenPOWER on IntegriCloud