summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Retire llvm::alignOf in favor of C++11 alignof.Benjamin Kramer2016-10-201-1/+1
| | | | | | No functionality change intended. llvm-svn: 284730
* Use StringRef for MemoryBuffer identifier API (NFC)Mehdi Amini2016-10-011-2/+2
| | | | llvm-svn: 283043
* Fix some Clang-tidy modernize-use-using and Include What You Use warnings; ↵Eugene Zelenko2016-09-071-9/+26
| | | | | | | | other minor fixes. Differential revision: https://reviews.llvm.org/D24115 llvm-svn: 280870
* [NFC] Header cleanupMehdi Amini2016-07-181-2/+1
| | | | | | | | | | 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
* [Lex] Try to fix a 'comparison is always false' warning. NFC.George Burgess IV2016-06-161-1/+1
| | | | llvm-svn: 272867
* Patch for r272584 (http://reviews.llvm.org/rL272584) to address ↵Taewook Oh2016-06-131-41/+41
| | | | | | | | clang-x64-ninja-win7 buildbot failure. Patch by Eric Niebler llvm-svn: 272592
* Use the name of the file on disk to issue a new diagnostic about ↵Taewook Oh2016-06-131-0/+148
| | | | | | | | | | | non-portable #include and #import paths. Differential Revision: http://reviews.llvm.org/D19843 Corresponding LLVM change: http://reviews.llvm.org/D19842 Re-commit of r272562 after addressing clang-x86-win2008-selfhost failure. llvm-svn: 272584
* Revert r272562 for build bot failure (clang-x86-win2008-selfhost)Taewook Oh2016-06-131-148/+0
| | | | llvm-svn: 272572
* Use the name of the file on disk to issue a new diagnostic about ↵Taewook Oh2016-06-131-0/+148
| | | | | | | | | | | | | non-portable #include and #import paths. Differential Revision: http://reviews.llvm.org/D19843 Corresponding LLVM change: http://reviews.llvm.org/D19842 Re-commit after addressing issues with of generating too many warnings for Windows and asan test failures. Patch by Eric Niebler llvm-svn: 272562
* Revert commit r271708Taewook Oh2016-06-041-67/+0
| | | | llvm-svn: 271761
* Use the name of the file on disk to issue a new diagnostic about ↵Taewook Oh2016-06-031-0/+67
| | | | | | | | | | | non-portable #include and #import paths. Differential Revision: http://reviews.llvm.org/D19843 Corresponding LLVM change: http://reviews.llvm.org/D19842 Patch by Eric Niebler llvm-svn: 271708
* Modules: set SystemHeader to true if we are building a system module.Manman Ren2016-05-171-3/+6
| | | | | | | | | | | | If we are processing a #include from a module build, we should treat it as a system header if we're building a system module. Passing an optional flag to HeaderSearch::LookupFile. Before this, the testing case will crash when accessing a freed FileEntry. rdar://26214027 llvm-svn: 269730
* [modules] When diagnosing a missing module import, suggest adding a #include ifRichard Smith2016-04-271-0/+56
| | | | | | | the current language doesn't have an import syntax and we can figure out a suitable file to include. llvm-svn: 267802
* [modules] Extend r266113 to cope with submodules.Richard Smith2016-04-121-1/+3
| | | | llvm-svn: 266116
* [modules] When an incompatible module file is explicitly provided for a module,Richard Smith2016-04-121-1/+4
| | | | | | | | and we fall back to textual inclusion, don't require the module as a whole to be marked available; it's OK if some other file in the same module is missing, just as it would be if the header were explicitly marked textual. llvm-svn: 266113
* Diagnose missing macro argument following charize operator.Andy Gibbs2016-04-011-2/+3
| | | | | | | For completeness, add a test-case for the equivalent stringize operator diagnostic too. llvm-svn: 265177
* [modules] Don't diagnose non-modular includes from modular files that areRichard Smith2016-03-141-3/+7
| | | | | | implementation units of modules rather than interface units. llvm-svn: 263449
* Revert "Don't convert a char to a const char *"David Majnemer2016-02-241-1/+1
| | | | | | | | This reverts commit r261780. It turns out the original code was just fine. An overload for ltrim which takes char was added but the Doxygen docs haven't seemed to pick it up. llvm-svn: 261784
* Don't convert a char to a const char *David Majnemer2016-02-241-1/+1
| | | | | | This fixes PR26728. llvm-svn: 261780
* [modules] Flatten -fmodule-name= and -fmodule-implementation-of= into a singleRichard Smith2016-02-191-20/+17
| | | | | | | | | | | | option. Previously these options could both be used to specify that you were compiling the implementation file of a module, with a different set of minor bugs in each case. This change removes -fmodule-implementation-of, and instead tracks a flag to determine whether we're currently building a module. -fmodule-name now behaves the same way that -fmodule-implementation-of previously did. llvm-svn: 261372
* Simplify users of StringRef::{l,r}trim (clang) (NFC)Vedant Kumar2016-02-161-1/+1
| | | | | | | r260925 introduced a version of the *trim methods which is preferable when trimming a single kind of character. Update all users in clang. llvm-svn: 260927
* Fix remaining Clang-tidy readability-redundant-control-flow warnings; other ↵Eugene Zelenko2016-02-121-10/+3
| | | | | | | | minor fixes. Differential revision: http://reviews.llvm.org/D17218 llvm-svn: 260757
* Simplify EnterTokenStream API to make it more robust for memory managementDavid Blaikie2016-02-091-4/+4
| | | | | | | | | | | | | | | While this won't help fix things like the bug that r260219 addressed, it seems like good tidy up to have anyway. (it might be nice if "makeArrayRef" always produced a MutableArrayRef & let it decay to an ArrayRef when needed - then I'd use that for the MutableArrayRefs in this patch) If we had std::dynarray I'd use that instead of unique_ptr+size_t, ideally (but then it'd have to be threaded down through the Preprocessor all the way - no idea how painful that would be) llvm-svn: 260246
* Refactor: Simplify boolean conditional return statements in lib/LexAlexander Kornienko2015-12-281-7/+3
| | | | | | | | | | | | | | Summary: Use clang-tidy to simplify boolean conditional return statements Reviewers: dblaikie Subscribers: dblaikie, cfe-commits Patch by Richard Thomson! Differential Revision: http://reviews.llvm.org/D10017 llvm-svn: 256499
* Replace SM.getFileEntryForID(Lexer->getFileID()) with Lexer->getFileEntry().Yaron Keren2015-12-181-5/+3
| | | | llvm-svn: 255993
* In Objective-C, ignore attempts to redefine the ARC/GC qualifier macros.John McCall2015-12-101-0/+24
| | | | | | | | | | | | | | This works around existing system headers which unconditionally redefine these macros. This is reasonably safe to do because we used to warn about it anyway (outside of system headers). Continue to warn if the redefinition would have changed the expansion. Still permit redefinition if the macro is explicitly #undef'ed first. rdar://23788307 llvm-svn: 255311
* Change MacroInfo::setArgumentList to take an ArrayRef instead of pointer and ↵Craig Topper2015-10-221-3/+3
| | | | | | size. While there use std::copy intead of a manual loop. llvm-svn: 250987
* Refactor module lookup when looking up a header file, and wire through the ↵Richard Smith2015-10-161-7/+10
| | | | | | requesting module. No functionality change. llvm-svn: 250554
* Replace double negation of !FileID.isInvalid() with FileID.isValid().Yaron Keren2015-10-031-1/+1
| | | | | | +couple more of double-negated !SourceLocation.isInvalid() unfixed in r249228. llvm-svn: 249235
* [modules] PR20507: Avoid silent textual inclusion.Sean Silva2015-08-171-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If a module was unavailable (either a missing requirement on the module being imported, or a missing file anywhere in the top-level module (and not dominated by an unsatisfied `requires`)), we would silently treat inclusions as textual. This would cause all manner of crazy and confusing errors (and would also silently "work" sometimes, making the problem difficult to track down). I'm really not a fan of the `M->isAvailable(getLangOpts(), getTargetInfo(), Requirement, MissingHeader)` function; it seems to do too many things at once, but for now I've done things in a sort of awkward way. The changes to test/Modules/Inputs/declare-use/module.map were necessitated because the thing that was meant to be tested there (introduced in r197805) was predicated on silently falling back to textual inclusion, which we no longer do. The changes to test/Modules/Inputs/macro-reexport/module.modulemap are just an overlooked missing header that seems to have been missing since this code was committed (r213922), which is now caught. Reviewers: rsmith, benlangmuir, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10423 llvm-svn: 245228
* [modules] Make the include guard optimization fire a bit more when consideringRichard Smith2015-07-011-1/+2
| | | | | | | | | | | re-entering a modular header. When we do the include guard check, we're in the visibility state for the file with the #include; the include guard may not be visible there, but we don't actually need it to be: if we've already parsed the submodule we're considering entering, it's always safe to skip it. llvm-svn: 241135
* Introduced pragmas for audited nullability regions.Douglas Gregor2015-06-191-0/+9
| | | | | | | | | | | | | | | | | Introduce the clang pragmas "assume_nonnull begin" and "assume_nonnull end" in which we make default assumptions about the nullability of many unannotated pointers: - Single-level pointers are inferred to __nonnull - NSError** in a (function or method) parameter list is inferred to NSError * __nullable * __nullable. - CFErrorRef * in a (function or method) parameter list is inferred to CFErrorRef __nullable * __nullable. - Other multi-level pointers are never inferred to anything. Implements rdar://problem/19191042. llvm-svn: 240156
* [clang] Refactoring of conditions so they use isOneOf() instead of multiple ↵Daniel Marjamaki2015-06-181-2/+2
| | | | | | is(). llvm-svn: 240008
* [modules] Simplify -cc1 interface for enabling implicit module maps.Richard Smith2015-06-161-6/+3
| | | | | | | | | | | | | We used to have a flag to enable module maps, and two more flags to enable implicit module maps. This is all redundant; we don't need any flag for enabling module maps in the abstract, and we don't usually have -fno- flags for -cc1. We now have just a single flag, -fimplicit-module-maps, that enables implicitly searching the file system for module map files and loading them. The driver interface is unchanged for now. We should probably rename -fmodule-maps to -fimplicit-module-maps at some point. llvm-svn: 239789
* Revert r237609 for now.Richard Smith2015-05-191-4/+5
| | | | | | | | | | | | glibc's headers use __need_* macros to selectively export parts of themselves to each other. This requires us to enter those files repeatedly when building a glibc module. This can be unreverted once we have a better mechanism to deal with that non-modular aspect of glibc (possibly some way to mark a header as "textual if this macro is defined"). llvm-svn: 237718
* [modules] When a file is listed as a non-textual header in a module map, don'tRichard Smith2015-05-181-5/+4
| | | | | | | | | | enter it more than once, even if it doesn't have #include guards -- we already know that it is intended to have the same effect every time it's included, and it's already had that effect. This particularly helps with local submodule visibility builds, where the include guard macro may not be visible in the includer, but will become visible the moment we enter the included file. llvm-svn: 237609
* [modules] Refactor and simplify #include handling.Richard Smith2015-05-181-115/+102
| | | | | | | Fix a tiny bug where we'd try to load a module file for the module we're in the middle of building. llvm-svn: 237552
* [modules] If we see a #include that maps to a module, but use of precompiled ↵Richard Smith2015-05-181-22/+17
| | | | | | modules is disabled, track submodule visibility anyway if -fmodules-local-submodule-visibility is enabled. This, in effect, gives modules semantics but without precompilation. llvm-svn: 237550
* [modules] Rearrange preprocessor module visibility handling, no observable ↵Richard Smith2015-05-141-23/+40
| | | | | | change intended. llvm-svn: 237331
* Switch PPCallbacks to take the new MacroDefinition instead of ↵Richard Smith2015-05-041-8/+5
| | | | | | MacroDirective*, in order to preserve full information on module macro expansion. llvm-svn: 236404
* [modules] Remove dead code from Module for tracking macro import locations.Richard Smith2015-05-021-5/+4
| | | | llvm-svn: 236376
* [modules] Start moving the module visibility information off the Module itself.Richard Smith2015-05-011-1/+5
| | | | | | | It has no place there; it's not a property of the Module, and it makes restoring the visibility set when we leave a submodule more difficult. llvm-svn: 236300
* Remove dead code: a MacroDirective can't be imported or ambiguous any more.Richard Smith2015-04-301-9/+0
| | | | llvm-svn: 236197
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-291-14/+20
| | | | | | | | | | | | | | 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
* [modules] Incrementally compute the list of overridden module macros based onRichard Smith2015-04-271-0/+1
| | | | | | | the active module macros at the point of definition, rather than reconstructing it from the macro history. No functionality change intended. llvm-svn: 235941
* [modules] Refactor creation of ModuleMacros and create them when importing ↵Richard Smith2015-04-231-8/+13
| | | | | | from local submodules. llvm-svn: 235669
* [modules] Properly attribute macros to modules if they're in a file ↵Richard Smith2015-04-231-3/+8
| | | | | | textually included into a file in the module. llvm-svn: 235661
* [modules] Store a ModuleMacro* on an imported macro directive rather than ↵Richard Smith2015-04-231-14/+6
| | | | | | duplicating the info within it. llvm-svn: 235644
* [modules] Determine the set of macros exported by a submodule at the end of ↵Richard Smith2015-04-231-0/+2
| | | | | | | | | | | that submodule. Previously we'd defer this determination until writing the AST, which doesn't allow us to use this information when building other submodules of the same module. This change also allows us to use a uniform mechanism for writing module macro records, independent of whether they are local or imported. llvm-svn: 235614
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-181-5/+5
| | | | | | | | | | | | | | | Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
OpenPOWER on IntegriCloud