summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* clang/test: Suppress two tests on win32 for now, since, not sure, in r169829 ↵NAKAMURA Takumi2012-12-121-0/+3
| | | | | | | | to r169831. "ansi-escape-sequences" is easy convenient to exclude win32. Please be patient. llvm-svn: 169945
* Don't use 'touch' in this test; it may be the cause of Windows-related failures.Douglas Gregor2012-12-111-1/+1
| | | | llvm-svn: 169922
* Use @import rather than @__experimental_modules_import, since theDouglas Gregor2012-12-1157-110/+110
| | | | | | latter is rather a mess to type. llvm-svn: 169919
* Fix an egregiously broken test. This pattern doesn't work:Richard Smith2012-12-051-4/+4
| | | | | | | | | RUN: a RUN: b || true lit expands it to a && b || true, and the || true applies to both commands (thus ignoring failures in 'a')! This is PR10867 again. llvm-svn: 169434
* test/Modules/build-fail-notes.m: Tweak to unbreak Win32 hosts to relax ↵NAKAMURA Takumi2012-12-051-2/+2
| | | | | | expressions, for now. llvm-svn: 169375
* PR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to beRichard Smith2012-12-051-1/+1
| | | | | | | the LHS of a token paste. Use "expanded from here" instead when we're not sure it's actually a macro. llvm-svn: 169373
* Fix test for Windows path separatorsDouglas Gregor2012-11-301-3/+3
| | | | llvm-svn: 169058
* Teach the serialized diagnostic writer to clone() itself, sharingDouglas Gregor2012-11-301-0/+12
| | | | | | | | | | state so that all of the various clones end up rendering their diagnostics into the same serialized-diagnostics file. This is important when we actually want failures during module build to be reported back to the translation unit that tried to import the not-yet-built or out-of-date module. <rdar://problem/12565727> llvm-svn: 169057
* When we're emitting a diagnostic with a source location in an importedDouglas Gregor2012-11-301-0/+7
| | | | | | | | | | | | | | module, provide a module import stack similar to what we would get for an include stack, e.g., In module 'DependsOnModule' imported from build-fail-notes.m:4: In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1: Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here @interface Module <rdar://problem/12696425> llvm-svn: 169042
* When an error occurs while building a module on demand, provide "WhileDouglas Gregor2012-11-303-3/+18
| | | | | | | | | building module 'Foo' imported from..." notes (the same we we provide "In file included from..." notes) in the diagnostic, so that we know how this module got included in the first place. This is part of <rdar://problem/12696425>. llvm-svn: 169021
* Keep track of modules that have failed to build. If we encounter anDouglas Gregor2012-11-291-0/+11
| | | | | | | | | | | | import of that module elsewhere, don't try to build the module again: it won't work, and the experience is quite dreadful. We track this information somewhat globally, shared among all of the related CompilerInvocations used to build modules on-the-fly, so that a particular Clang instance will only try to build a given module once. Fixes <rdar://problem/12552849>. llvm-svn: 168961
* If an excluded header does not exist, just ignore itDouglas Gregor2012-11-151-0/+1
| | | | llvm-svn: 168077
* When loading a module fails because it is out of date, rebuild thatDouglas Gregor2012-11-074-0/+28
| | | | | | module in place. <rdar://problem/10138913> llvm-svn: 167539
* Introduce inferred framework modules into the module map file,Douglas Gregor2012-11-063-0/+14
| | | | | | | | | | | | | | allowing a module map to be placed one level above the '.framework' directories to specify that all .frameworks within that directory can be inferred as framework modules. One can also specifically exclude frameworks known not to work. This makes explicit (and more restricted) behavior modules have had "forever", where *any* .framework was assumed to be able to be built as a module. That's not necessarily true, so we white-list directories (with exclusions) when those directories have been audited. llvm-svn: 167482
* Have the parser initialize Sema before it consumes the firstDouglas Gregor2012-11-052-0/+9
| | | | | | | | token. This is important because the first token could actually be after an #include that triggers a module import, which might use either Sema or the AST consumer before it would have been initialized. llvm-svn: 167423
* Make cpuid.h actually work with -std=c99 <rdar://problem/12552716>.Douglas Gregor2012-11-051-0/+1
| | | | | | | | While we're here, extend the module map to cover most of the newly-added instrinsic headers. Only wmmintrin.h is missing, because it needs to be split into AES/PCLMUL subheaders (as a separate commit). llvm-svn: 167398
* Correct test inovocations to use %clang_cc1 rather than direct invocation ↵David Tweed2012-10-251-1/+1
| | | | | | (so that it can have additional options set when trying to debug issues causing regressions). llvm-svn: 166681
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-198-0/+8
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* Introduce the notion of excluded headers into the module mapDouglas Gregor2012-10-151-4/+1
| | | | | | | | description. Previously, one could emulate this behavior by placing the header in an always-unavailable submodule, but Argyrios guilted me into expressing this idea properly. llvm-svn: 165921
* Add missing header from 165821Douglas Gregor2012-10-121-0/+2
| | | | llvm-svn: 165822
* Sanitize the names of modules determined based on the names of headersDouglas Gregor2012-10-123-0/+12
| | | | | | | or directories, to make sure that they are identifiers that are not keywords in any dialect. Fixes <rdar://problem/12489495>. llvm-svn: 165821
* Track which particular submodule #undef's a macro, so that the actualDouglas Gregor2012-10-126-6/+19
| | | | | | #undef only occurs if that submodule is imported. llvm-svn: 165773
* Diagnose the expansion of ambiguous macro definitions. This can happenDouglas Gregor2012-10-114-7/+25
| | | | | | | only with modules, when two disjoint modules #define the same identifier to different token sequences. llvm-svn: 165746
* Deserialize macro history when we deserialize an identifier that hasDouglas Gregor2012-10-114-0/+113
| | | | | | | | | | | | | | | | | | | | | | | | macro history. When deserializing macro history, we arrange history such that the macros that have definitions (that haven't been #undef'd) and are visible come at the beginning of the list, which is what the preprocessor and other clients of Preprocessor::getMacroInfo() expect. If additional macro definitions become visible later, they'll be moved toward the front of the list. Note that it's possible to have ambiguities, but we don't diagnose them yet. There is a partially-implemented design decision here that, if a particular identifier has been defined or #undef'd within the translation unit, that definition (or #undef) hides any macro definitions that come from imported modules. There's still a little work to do to ensure that the right #undef'ing happens. Additionally, we'll need to scope the update records for #undefs, so they only kick in when the submodule containing that update record becomes visible. llvm-svn: 165682
* Rework the (de-)serialization of macros, as stored inDouglas Gregor2012-10-094-0/+17
| | | | | | | | | | | | | | | | MacroInfo*. Instead of simply dumping an offset into the current file, give each macro definition a proper ID with all of the standard modules-remapping facilities. Additionally, when a macro is modified in a subsequent AST file (e.g., #undef'ing a macro loaded from another module or from a precompiled header), provide a macro update record rather than rewriting the entire macro definition. This gives us greater consistency with the way we handle declarations, and ties together macro definitions much more cleanly. Note that we're still not actually deserializing macro history (we never were), but it's far easy to do properly now. llvm-svn: 165560
* When we load a function or method body from an AST file, we checkDouglas Gregor2012-10-093-2/+4
| | | | | | | | | | whether that function/method already has a body (loaded from some other AST file), as introduced in r165137. Delay this check until after the redeclaration chains have been wired up. While I'm here, make the loading of method bodies lazy. llvm-svn: 165513
* Add redecls into their lexical DeclContext: this is what they assert on, and ↵Axel Naumann2012-10-021-0/+11
| | | | | | | | the merging should have set it correctly. This is especially relevant for templatedDecls that might be injected (and thus have their DeclContext set to) somewhere completely different. llvm-svn: 165005
* Only those InterestingDecls that got added to the AST should be passed to ↵Axel Naumann2012-10-023-11/+22
| | | | | | the ASTConsumer. llvm-svn: 165001
* Merge pending instantiations instead of overwriting existing ones.Axel Naumann2012-10-0210-78/+104
| | | | | | | | | | | Check whether a pending instantiation needs to be instantiated (or whether an instantiation already exists). Verify the size of the PendingInstantiations record (was only checking size of existing PendingInstantiations). Migrate Obj-C++ part of redecl-merge into separate test, now that this is growing. templates.mm: test that CodeGen has seen exactly one definition of template instantiations. redecl-merge.m: use "@" specifier for expected-diagnostics. llvm-svn: 164993
* The Redeclarable part of named decls is read before their name.Axel Naumann2012-10-011-5/+7
| | | | | | | | Lookup can nevertheless find them due to the serialized lookup table. For instance when reading a template decl's templatedDecl, it will search for existing decls that it could be a redeclaration of, and find the half-read template decl. Thus there is no point in asserting the names of decls. llvm-svn: 164932
* Also merge template redeclarations.Axel Naumann2012-10-013-0/+17
| | | | | | Don't require specializations (of existing and read template) to be unique. llvm-svn: 164931
* Bring ASTReader and Writer into sync for the case where a canonical template ↵Axel Naumann2012-10-014-0/+20
| | | | | | | | | specialization was written, which is non-canonical at the time of reading: force the reading of the ClassTemplateDecl if it was written. The easiest way out is to store whether the decl was canonical at the time of writing. Add test. llvm-svn: 164927
* Introduce builtin macros to determine whether we're building aDouglas Gregor2012-09-252-0/+18
| | | | | | | | | | specific module (__building_module(modulename)) and to get the name of the current module as an identifier (__MODULE__). Used to help headers behave differently when they're being included as part of building a module. Oh, the irony. llvm-svn: 164605
* When disambiguating an expression-statement from a declaraton-statement, if theRichard Smith2012-08-231-2/+5
| | | | | | | statement starts with an identifier for which name lookup will fail either way, look at later tokens to disambiguate in order to improve error recovery. llvm-svn: 162464
* Update VerifyDiagnosticConsumer to only get directives during parsing.Jordan Rose2012-08-103-1/+4
| | | | | | | | | | | | | | | | | | | | The old behavior was to re-scan any files (like modules) where we may have directives but won't actually be parsing during the -verify invocation. Now, we keep the old behavior in Debug builds as a sanity check (though modules are a known entity), and expect all legitimate directives to come from comments seen by the preprocessor. This also affects the ARC migration tool, which captures diagnostics in order to filter some out. This change adds an explicit cleanup to CaptureDiagnosticsConsumer in order to let its sub-consumer handle the real end of diagnostics. This was originally split into four patches, but the tests do not run cleanly without all four, so I've combined them into one commit. Patches by Andy Gibbs, with slight modifications from me. llvm-svn: 161650
* Fix a typo (the the => the)Sylvestre Ledru2012-07-231-1/+1
| | | | llvm-svn: 160622
* Allow -verify directives to be filtered by preprocessing.Jordan Rose2012-07-112-5/+6
| | | | | | | | | | | | | | | | | | | | | This is accomplished by making VerifyDiagnosticsConsumer a CommentHandler, which then only reads the -verify directives that are actually in live blocks of code. It also makes it simpler to handle -verify directives that appear in header files, though we still have to manually reparse some files depending on how they are generated. This requires some test changes. In particular, all PCH tests now have their -verify directives outside the "header" portion of the file, using the @line syntax added in r159978. Other tests have been modified mostly to make it clear what is being tested, and to prevent polluting the expected output with the directives themselves. Patch by Andy Gibbs! (with slight modifications) The new Frontend/verify-* tests exercise the functionality of this commit, as well as r159978, r159979, and r160053 (Andy's other -verify enhancements). llvm-svn: 160068
* Fix ASTReader handling of ImportDecls, from Meador Inge!Douglas Gregor2012-05-163-0/+14
| | | | llvm-svn: 156923
* There's some code in the PCH reader that looks like it's needlessly complex, butNick Lewycky2012-04-124-0/+21
| | | | | | | turns out that it's actually needed for C++ modules support. Since simplifying it didn't cause any test failures, I'll add a test for it. llvm-svn: 154582
* Added a new attribute, objc_root_class, which informs the compiler when a ↵Patrick Beard2012-04-061-2/+2
| | | | | | | | | root class is intentionally declared. The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698> llvm-svn: 154187
* Fix PR10447: lazily building name lookup tables for DeclContexts was broken.Richard Smith2012-03-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | The deferred lookup table building step couldn't accurately tell which Decls should be included in the lookup table, and consequently built different tables in some cases. Fix this by removing lazy building of DeclContext name lookup tables. In practice, the laziness was frequently not worthwhile in C++, because we performed lookup into most DeclContexts. In C, it had a bit more value, since there is no qualified lookup. In the place of lazy lookup table building, we simply don't build lookup tables for function DeclContexts at all. Such name lookup tables are not useful, since they don't capture the scoping information required to correctly perform name lookup in a function scope. The resulting performance delta is within the noise on my testing, but appears to be a very slight win for C++ and a very slight loss for C. The C performance can probably be recovered (if it is a measurable problem) by avoiding building the lookup table for the translation unit. llvm-svn: 152608
* Change @import to @__experimental_modules_import. We are not ready to ↵Ted Kremenek2012-03-0146-88/+88
| | | | | | | | commit to a particular syntax for modules, and don't have time to push it forward in the near future. llvm-svn: 151841
* Use -isystem rather than relying on -isysroot to work consistentlyDouglas Gregor2012-02-021-1/+1
| | | | llvm-svn: 149626
* Yet more data from failing buildbots...Douglas Gregor2012-02-021-1/+1
| | | | llvm-svn: 149624
* Drop -verify to get better diagnostics from failing buildbots. Plus, we ↵Douglas Gregor2012-02-021-1/+1
| | | | | | don't need it here llvm-svn: 149613
* Back out my heinous hack that tricked the module generation mechanismDouglas Gregor2012-02-026-16/+55
| | | | | | | | | | | | | | | | | | | | into using non-absolute system includes (<foo>)... ... and introduce another hack that is simultaneously more heineous and more effective. We whitelist Clang-supplied headers that augment or override system headers (such as float.h, stdarg.h, and tgmath.h). For these headers, Clang does not provide a module mapping. Instead, a system-supplied module map can refer to these headers in a system module, and Clang will look both in its own include directory and wherever the system-supplied module map suggests, then adds either or both headers. The end result is that Clang-supplied headers get merged into the system-supplied module for the C standard library. As a drive-by, fix up a few dependencies in the _Builtin_instrinsics module. llvm-svn: 149611
* test/Modules/compiler_builtins.m: Appease Cygwin to add -D__need_wint_t.NAKAMURA Takumi2012-02-011-1/+1
| | | | | | | | On Cygwin, at first, <stddef.h> is included without __need_wint_t. Next, <stddef.h> is included with __need_wint_t, though Modules feature would not process <stddef.h> twice. Then, wint_t is not found in system headers. llvm-svn: 149500
* test/Modules/compiler_builtins.m: Mark this as XFAIL:win32. MS limits.h ↵NAKAMURA Takumi2012-02-011-0/+2
| | | | | | provides size_t. llvm-svn: 149499
* Split compiler builtin module into "stdlib" builtins and "intrinsic"Douglas Gregor2012-01-311-4/+8
| | | | | | | | builds, and bring mm_alloc.h into the fold. Start playing some tricks with these builtin modules to mirror the include_next tricks that the headers already perform. llvm-svn: 149434
* Remove tgmath.h from the module map for now, because it currently causes aDouglas Gregor2012-01-301-3/+0
| | | | | | | cyclic module dependency due to its inclusion of math.h and complex.h. I'll take another shot at it later. llvm-svn: 149283
OpenPOWER on IntegriCloud