| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead, mark the module as unavailable so that clang errors as soon as
someone tries to build this module.
A better long-term strategy might be to not stat the header files at all
while reading the module map and instead read them only when the module
is being built (there is a corresponding FIXME in parseHeaderDecl()).
However, it seems non-trivial to get there and this would be a temporary
solution to unblock us.
Also changed the implementation to reuse the same DiagnosticsEngine as
otherwise warnings can't be enabled or disabled with command-line flags.
llvm-svn: 197388
|
|
|
|
|
|
|
|
|
|
|
|
| |
The warning for backslash and newline separated by whitespace was missed in
this code path.
backslash<whitespace><newline> is handled differently from compiler to compiler
so it's important to warn consistently where there's ambiguity.
Matches similar handling of block comments and non-comment lines.
llvm-svn: 197331
|
|
|
|
|
|
| |
Raw lexers don't have a preprocessor so we need to null check.
llvm-svn: 197245
|
|
|
|
|
|
| |
Fixes rdar://15644663.
llvm-svn: 197165
|
|
|
|
|
|
|
|
|
|
|
| |
Includes might always pull in arbitrary header or data files outside of
modules. Among others, this includes builtin includes, which do not have
a module (story) yet.
Also cleanup implementation of ModuleMap::findModuleForHeader() to be
non-recursive.
llvm-svn: 197034
|
|
|
|
|
|
| |
appease FileManager.
llvm-svn: 196865
|
|
|
|
| |
llvm-svn: 196859
|
|
|
|
|
|
| |
3-state enum.
llvm-svn: 196648
|
|
|
|
| |
llvm-svn: 196584
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to make the migration to modules easier, it seems to be helpful
to allow a 1:1 mapping between target names of a current build system
and the corresponding C++ modules. As such targets commonly contain
characters like "-". ":" and "/", allowing arbitrary quote-escaped
strings seems to be a straightforward option.
After several offline discussions, the precise mechanisms for C++
module names especially regarding submodules and import statements has
yet to be determined. Thus, this patch only enables string literals as
names inside the module map files which can be used by automatic module
import (through #include).
Also improve the error message on missing use-declarations.
llvm-svn: 196573
|
|
|
|
|
|
|
|
| |
libclang.
Patch by Erik Verbruggen!
llvm-svn: 196487
|
|
|
|
|
|
| |
re-org, and an update of the new PPCallbacks test (soon to be moved to clang from extra), rather the unittest.
llvm-svn: 196407
|
|
|
|
|
|
|
|
| |
handle them (pr9537)"
It broke clang tests on some hosts with +Asserts. Seems "STDC" clashes.
llvm-svn: 196376
|
|
|
|
|
|
|
| |
And refactor to have just one place in code that sets up the empty
pragma handlers.
llvm-svn: 196372
|
|
|
|
|
|
|
|
|
|
|
| |
Before, there SourceManager would not return a FileEntry for a
SourceLocation of a macro expansion (if the header name itself is
defined in a macro). We'd then fallback to assume that the module
currently being built is the including module. However, in this case we
are actually interested in the spelling location of the filename loc in
order to derive the including module.
llvm-svn: 196311
|
|
|
|
| |
llvm-svn: 196123
|
|
|
|
|
|
| |
curlies.
llvm-svn: 195802
|
|
|
|
|
|
|
| |
the duplicated documentation from .cpp files so that it's not processed by
Doxygen and hence doesn't generate duplicate output.
llvm-svn: 195799
|
|
|
|
|
|
|
|
|
| |
module. Use the marker to diagnose cases where we try to transition between
submodules when not at the top level (most likely because a closing brace was
missing at the end of a header file, but is also possible if submodule headers
attempt to do something fundamentally non-modular, like our .def files).
llvm-svn: 195543
|
|
|
|
| |
llvm-svn: 194897
|
|
|
|
|
|
|
|
|
|
|
|
| |
representing the module import rather than making the module immediately
visible. This serves two goals:
* It avoids making declarations in the module visible prematurely, if we
walk past the #include during a tentative parse, for instance, and
* It gives a diagnostic (although, admittedly, not a very nice one) if
a header with a corresponding module is included anywhere other than
at the top level.
llvm-svn: 194782
|
|
|
|
|
|
|
|
|
|
|
|
| |
The preprocessor currently recognizes module declarations to load a
module based on seeing the 'import' keyword followed by an
identifier. This sequence is fairly unlikely in C (one would need a
type named 'import'), but is more common in Objective-C (where a
variable named 'import' can cause problems). Since import declarations
currently require a leading '@', recognize that in the preprocessor as
well. Fixes <rdar://problem/15084587>.
llvm-svn: 194225
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'##'
After lexing a '##', we would look ahead and check to see if it was
followed by '__VA_ARGS__'. After doing so, we would then go ahead and
lex the token.
However we would fail in the case where the '##' was followed by a '#'
followed by an identifier because we would have lexed the '#' separately
from the identifier, bypassing our parameter validation logic.
Instead, lex the tokens coming after the '##' later.
This fixes PR17804.
llvm-svn: 194059
|
|
|
|
|
|
| |
... in case someone decides to -I/usr/include <rdar://problem/15235948>.
llvm-svn: 193893
|
|
|
|
|
|
|
|
|
|
|
|
| |
requires ! feature
The purpose of this is to allow (for instance) the module map for /usr/include
to exclude <tgmath.h> and <complex.h> when building in C++ (these headers are
instead provided by the C++ standard library in this case, and the glibc C
<tgmath.h> header would otherwise try to include <complex.h>, resulting in a
module cycle).
llvm-svn: 193549
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows using virtual file mappings on the original SourceManager to
map in virtual module.map files. Without this patch, the ModuleMap
search will find a module.map file (as the FileEntry exists in the
FileManager), but will be unable to get the content from the
SourceManager (as ModuleMap previously created its own SourceManager).
Two problems needed to be fixed which this patch exposed:
1. Storing the inferred module map
When writing out a module, the ASTWriter stores the names of the files
in the main source manager; when loading the AST again, the ASTReader
errs out if such a file is found missing, unless it is overridden.
Previously CompilerInstance's compileModule method would store the
inferred module map to a temporary file; the problem with this approach
is that now that the module map is handled by the main source manager,
the ASTWriter stores the name of the temporary module map as source to
the compilation; later, when the module is loaded, the temporary file
has already been deleted, which leads to a compilation error. This patch
changes the inferred module map to instead inject a virtual file into
the source manager. This both saves some disk IO, and works with how the
ASTWriter/ASTReader handle overridden source files.
2. Changing test input in test/Modules/Inputs/*
Now that the module map file is handled by the main source manager, the
VerifyDiagnosticConsumer will not ignore diagnostics created while
parsing the module map file. The module test test/Modules/renamed.m uses
-I test/Modules/Inputs and triggers recursive loading of all module maps
in test/Modules/Inputs, some of which had conflicting names, thus
leading errors while parsing the module maps. Those diagnostics already
occur on trunk, but before this patch they would not break the test, as
they were ignored by the VerifyDiagnosticConsumer. This patch thus
changes the module maps that have been recently introduced which broke
the invariant of compatible modules maps in test/Modules/Inputs.
llvm-svn: 193314
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch changes two things:
a) Allow a header to be part of multiple modules. The reasoning is that
in existing codebases that have a module-like build system, the same
headers might be used in several build targets. Simple reasons might be
that they defined different classes that are declared in the same
header. Supporting a header as a part of multiple modules will make the
transistion easier for those cases. A later step in clang can then
determine whether the two modules are actually compatible and can be
merged and error out appropriately. The later check is similar to what
needs to be done for template specializations anyway.
b) Allow modules to be stored in a directory tree separate from the
headers they describe.
Review: http://llvm-reviews.chandlerc.com/D1951
llvm-svn: 193151
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The C and C++ standards disallow using universal character names to
refer to some characters, such as basic ascii and control characters,
so we reject these sequences in the lexer. However, when the
preprocessor isn't being used on C or C++, it doesn't make sense to
apply these restrictions.
Notably, accepting these characters avoids issues with unicode escapes
when GHC uses the compiler as a preprocessor on haskell sources.
Fixes rdar://problem/14742289
llvm-svn: 193067
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'final'
Summary: Some MS headers use these features.
Reviewers: rnk, rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1948
llvm-svn: 192936
|
|
|
|
|
|
| |
ABI mangling for qualified id<...>. Fixes <rdar://problem/14799110>.
llvm-svn: 192643
|
|
|
|
|
|
| |
If the edit distance between the two macros is more than 50%, DefinedMacro may not be header guard or can be header guard of another header file or it might be defining something completely different set by the build environment.
llvm-svn: 192547
|
|
|
|
|
|
|
|
| |
This partially addresses PR17435, but it doesn't actually implement the
pragma. If we implement it, we should map levels 1-4 to something like
-Wall and level 0 to something like -w.
llvm-svn: 191833
|
|
|
|
| |
llvm-svn: 191607
|
|
|
|
|
|
| |
here goes to Larisse Voufo.
llvm-svn: 191549
|
|
|
|
|
|
|
|
| |
miscompilation.
Investigating yet. It seems msc16 miscompiles s[1] to be folded.
llvm-svn: 191485
|
|
|
|
|
|
| |
in a #line directive.
llvm-svn: 191443
|
|
|
|
| |
llvm-svn: 191424
|
|
|
|
|
|
| |
Dennett.
llvm-svn: 191420
|
|
|
|
|
|
| |
yet approved by full committee, but was unanimously supported by EWG.
llvm-svn: 191417
|
|
|
|
|
|
|
| |
Previously the code would reduce a run of backslashes to a single
backslash, and now it will properly leave behind every other backslash.
llvm-svn: 191382
|
|
|
|
|
|
| |
to handle constant expressions.
llvm-svn: 191336
|
|
|
|
| |
llvm-svn: 191292
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this option, arbitrarily named module map files can be specified
to be loaded as required for headers in the respective (sub)directories.
This, together with the extern module declaration allows for specifying
module maps in a modular fashion without the need for files called
"module.map".
Among other things, this allows a directory to contain two modules that
are completely independent of one another.
Review: http://llvm-reviews.chandlerc.com/D1697.
llvm-svn: 191284
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Review: http://llvm-reviews.chandlerc.com/D1546.
I have picked up this patch form Lawrence
(http://llvm-reviews.chandlerc.com/D1063) and did a few changes.
From the original change description (updated as appropriate):
This patch adds a check that ensures that modules only use modules they
have so declared. To this end, it adds a statement on intended module
use to the module.map grammar:
use module-id
A module can then only use headers from other modules if it 'uses' them.
This enforcement is off by default, but may be turned on with the new
option -fmodules-decluse.
When enforcing the module semantics, we also need to consider a source
file part of a module. This is achieved with a compiler option
-fmodule-name=<module-id>.
The compiler at present only applies restrictions to the module directly
being built.
llvm-svn: 191283
|
|
|
|
|
|
|
|
| |
literal operators. Also, for now, allow the proposed C++1y "il", "i", and "if"
suffixes too. (Will revert the latter if LWG decides not to go ahead with that
change after all.)
llvm-svn: 191274
|
|
|
|
| |
llvm-svn: 190984
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this patch, Lex() would recurse whenever the current lexer changed (e.g.
upon entry into a macro). This patch turns the recursion into a loop: the
various lex routines now don't return a token when the current lexer changes,
and at the top level Preprocessor::Lex() now loops until it finds a token.
Normally, the recursion wouldn't end up being very deep, but the recursion depth
can explode in edge cases like a bunch of consecutive macros which expand to
nothing (like in the testcase test/Preprocessor/macro_expand_empty.c in this
patch).
<rdar://problem/14569770>
llvm-svn: 190980
|
|
|
|
|
|
| |
Patch by Eelis van der Weegen.
llvm-svn: 190971
|
|
|
|
|
|
|
|
|
| |
This removes __has_feature(objc_msg_lookup_stret), as it is not required
anymore after this patch.
Patch by Jonathan Schleifer!
llvm-svn: 190791
|
|
|
|
|
|
|
|
|
|
|
| |
Unlike C++11's "thread_local" keyword, C11's "_Thread_local" is in the
reserved namespace, meaning we provide it unconditionally; it is marked
as KEYALL in TokenKinds.def.
This means that like all the other C11 keywords, we can expose its
presence through __has_extension().
llvm-svn: 190755
|