summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* Save out a correct lookup table if a lookup table entry is stale (it containsRichard Smith2014-03-254-0/+20
| | | | | | | | | an out-of-date external decls list). This happens if we declare some names, force the lookup table for the decl context to be built, import a module that adds more decls for the name, then write out our module without looking up the name. llvm-svn: 204694
* Add missing file from r204570.Richard Smith2014-03-231-0/+5
| | | | llvm-svn: 204574
* If a name is injected into an imported inline namespace without reopening thatRichard Smith2014-03-233-0/+13
| | | | | | | namespace, we need to update both the visible names of that namespace and of its enclosing namespace set. llvm-svn: 204570
* When we inject a declaration into a namespace, add the primary DeclContext toRichard Smith2014-03-233-0/+12
| | | | | | | the update set rather than the current DeclContext. Add test for the local extern case too. llvm-svn: 204568
* If a template instantation introduces a name into a namespace, we need to writeRichard Smith2014-03-233-0/+12
| | | | | | | out a visible update record for that namespace even if it was never declared in this module. llvm-svn: 204554
* If an update record makes a declaration interesting, pass it to the consumer.Richard Smith2014-03-233-3/+14
| | | | llvm-svn: 204550
* Emit an update record if we instantiate the definition of a function templateRichard Smith2014-03-224-0/+27
| | | | | | | | specialization from a module. (This can also happen for function template specializations in PCHs if they're instantiated eagerly, because they're constexpr or have a deduced return type.) llvm-svn: 204547
* Refactor: move loading pending instantiations from chained PCHs to a more ↵Richard Smith2014-03-221-0/+3
| | | | | | appropriate place, so that we only ask the external source once. llvm-svn: 204535
* PR19215: When writing/reading a PCH that imported a module, store the locationRichard Smith2014-03-214-0/+14
| | | | | | | at which that PCH imported each visible submodule of the module. Such locations are needed when synthesizing macro directives resulting from the import. llvm-svn: 204417
* Prevent lookup of subframework modules by name without parent frameworkBen Langmuir2014-03-201-0/+5
| | | | | | | | | | | | | We were 'allowing' the following import @import Sub; where Sub is a subframework of Foo and we had a -F path inside Foo.framework/Frameworks and no module map file for Sub. This would later hit assertion failures in debug builds. Now we should correctly diagnose this as a module not found error. llvm-svn: 204368
* Add a new spelling for module map files 'module.modulemap'Ben Langmuir2014-03-1917-0/+45
| | | | | | | | | | | | | | | This name, while more verbose, plays more nicely with tools that use file extensions to determine file types. The existing spelling 'module.map' will continue to work, but the new spelling will take precedence. In frameworks, this new filename will only go in a new 'Modules' sub-directory. Similarly, add a module.private.modulemap corresponding to module_private.map. llvm-svn: 204261
* Use the expansion location of the file name when finding the module.Manuel Klimek2014-03-194-0/+33
| | | | | | | | The spelling location of stringified strings is not a file location. Optimally, we'll want to solve the problem (as the FIXME states) by handing in the right FileEntry of the #include location. llvm-svn: 204220
* modify declare-use.S to work when full toolchain not presentMatthew Curtis2014-03-181-1/+1
| | | | | | | | Test doesn't actually require production of an object file and for some targets (e.g. hexagon) an assembler is not always available when lit tests are run. llvm-svn: 204144
* clang/test/Modules/cxx-templates.cpp: Tweak for dos path.NAKAMURA Takumi2014-03-181-1/+1
| | | | llvm-svn: 204116
* AST dumper: if we have multiple implicit instantiations of the same classRichard Smith2014-03-181-0/+11
| | | | | | | template specialization (from different modules), dump them all, so that every declaration is dumped somewhere. llvm-svn: 204100
* Don't verify module inclusions in assembler files.Daniel Jasper2014-03-143-0/+9
| | | | llvm-svn: 203929
* [Modules] Emit the module file paths as dependencies of the PCH when we are ↵Argyrios Kyrtzidis2014-03-141-0/+12
| | | | | | | | | | | building one. This is because the PCH is tied to the module files, if one of the module files changes or gets removed the build system should re-build the PCH file. rdar://16321245 llvm-svn: 203885
* [Modules] Make sure that the synthesized file "__inferred_module.map" ↵Argyrios Kyrtzidis2014-03-141-0/+8
| | | | | | | | doesn't show up as dependency of a module file. Follow-up for rdar://15459210 llvm-svn: 203882
* Add an option -fmodules-validate-system-headersBen Langmuir2014-03-121-0/+25
| | | | | | | | When enabled, always validate the system headers when loading a module. The end result of this is that when these headers change, we will notice and rebuild the module. llvm-svn: 203630
* clang/test/Modules/include-relative.c REQUIRES shell due to chdir.NAKAMURA Takumi2014-03-111-0/+1
| | | | llvm-svn: 203550
* If a visibility update record is found for a DeclContext after that Decl hasRichard Smith2014-03-115-0/+12
| | | | | | | already been loaded, apply that update record to the Decl immediately, rather than adding it to a pending list and never applying it. llvm-svn: 203534
* If a module map is found in a relative -I path, convert the filenames within itRichard Smith2014-03-113-0/+13
| | | | | | | | to absolute paths when building the includes file for the module. Without this, the module build would fail, because the relative paths we were using are not necessarily relative to a directory in our include path. llvm-svn: 203528
* When a type's definition is instantiated, the definition becomes visible, evenRichard Smith2014-03-107-0/+82
| | | | | | | | | if the type's declaration was previously instantiated in an unimported module. (For an imported type definition, this already worked, because the source location is set to the location of the definition, but for locally-instantiated type definitions, it did not.) llvm-svn: 203425
* Module [extern_c] attribute: inherit to submodules, don't write 'extern "C"'Richard Smith2014-03-084-4/+21
| | | | | | blocks when building in C mode, and serialize and deserialize the attribute. llvm-svn: 203317
* Tweak some test paths to match on WindowsBen Langmuir2014-03-071-4/+4
| | | | llvm-svn: 203215
* Add a bunch of missing changes from r203208Ben Langmuir2014-03-071-5/+7
| | | | | | Somehow lost these in a git operation. llvm-svn: 203210
* Add dependencies from imported modules with -MDBen Langmuir2014-03-071-0/+20
| | | | | | | | Add module dependencies to the dependency files created by -MD/-MMD/etc. by attaching an ASTReaderListener that will call into the dependency file generator when a module input file is seen in the serialized AST. llvm-svn: 203208
* Fix crash if a submodule overrides one of its own macros, and add support forRichard Smith2014-03-065-0/+17
| | | | | | | | submodule macro overriding within the same top-level module (necessary for the testcase to be remotely reasonable). Incidentally reduces the number of libc++ testsuite regressions with modules enabled from 7 to 6. llvm-svn: 203063
* clang/test/Modules/recursive.c: Tweak expressions for win32.NAKAMURA Takumi2014-03-061-2/+2
| | | | llvm-svn: 203034
* When building a module from the command line via -emit-module, add an entry toRichard Smith2014-03-051-2/+2
| | | | | | | the module build stack for the module being built, so we can correctly detect recursive module builds. llvm-svn: 203006
* If a #include finds a file relative to the current file, don't forget to checkRichard Smith2014-03-055-3/+20
| | | | | | whether it's part of a module. llvm-svn: 203005
* Fix typo that resulted in names at TU scope getting lost sometimes after aRichard Smith2014-03-041-0/+8
| | | | | | module import. llvm-svn: 202771
* Add [extern_c] attribute for modules, allowing a C module to be imported ↵Richard Smith2014-03-026-0/+77
| | | | | | within an extern "C" block in C++ code. llvm-svn: 202615
* If a module A exports a macro M, and a module B imports that macro and #undef'sRichard Smith2014-03-017-8/+127
| | | | | | | | | | | | | | it, importers of B should not see the macro. This is complicated by the fact that A's macro could also be visible through a different path. The rules (as hashed out on cfe-commits) are included as a documentation update in this change. With this, the number of regressions in libc++'s testsuite when modules are enabled drops from 47 to 7. Those remaining 7 are also macro-related, and are due to remaining bugs in this change (in particular, the handling of submodules is imperfect). llvm-svn: 202560
* Consistently print anonymous namespace names as "<anonymous namespace>"David Blaikie2014-02-141-2/+2
| | | | | | | | | | | For some reason we have two bits of code handling this printing: lib/AST/Decl.cpp: OS << "<anonymous namespace>"; lib/AST/TypePrinter.cpp: OS << "<anonymous namespace>::"; it would be nice if we only had one... llvm-svn: 201437
* libclang: report error code for bad PCH filesDmitri Gribenko2014-02-121-1/+1
| | | | | | | | | | | | | | | | | | | This commit improves libclang to report the error condition when CXTranslationUnit can not be created because of a stale PCH file. This allows the caller, for example, to rebuild the PCH file and retry the request. There two are APIs in libclang that return a CXTranslationUnit and don't support reporting detailed errors (the only error condition is a NULL result). For these APIs, a second, superior, version is introduced -- clang_createTranslationUnit2 and clang_parseTranslationUnit2. These functions return a CXTranslationUnit indirectly and also return an error code. Old functions are still supported and are nothing more than convenience wrappers that ignore extended error codes. As a cleanup, this commit also categorizes some libclang errors in the functions I had to modify anyway. llvm-svn: 201249
* Don't use find | xargs in ↵Dmitri Gribenko2014-02-121-3/+3
| | | | | | | | test/Modules/fmodules-validate-once-per-build-session.c With -fdisable-module-hash, we can implement this with a simple 'cp'. llvm-svn: 201231
* clang/test/Modules/fmodules-validate-once-per-build-session.c: Tweak for ↵NAKAMURA Takumi2014-02-121-3/+3
| | | | | | | | gnuwin32 with %/t (instead of %t). xargs didn't handle dosish paths, while find foo\bar\ emits dosish paths. llvm-svn: 201228
* 'svn add' files I forgot for r201224 (Add an option to allow Clang verifyDmitri Gribenko2014-02-121-0/+45
| | | | | | source files for a module only once during) llvm-svn: 201225
* DR101, PR12770: If a function is declared in the same context as aRichard Smith2014-02-061-3/+2
| | | | | | | | using-declaration, and they declare the same function (either because the using-declaration is in the same namespace as the declaration it imports, or because they're both extern "C"), they do not conflict. llvm-svn: 200897
* Fix comment typo in test.Richard Smith2014-01-311-1/+3
| | | | llvm-svn: 200584
* Fix autolinking when modules are imported in pch filesBen Langmuir2014-01-314-3/+16
| | | | | | | | | | | | Add the ImportDecl to the set of interesting delcarations that are deserialized eagerly when an AST file is loaded (rather than lazily like most decls). This is required to get auto linking to work when there is no explicit import in the main file. Also resolve a FIXME to rename 'ExternalDefinitions', since that is only one of the things that need eager deserialization. The new name is 'EagerlyDeserializedDecls'. The corresponding AST bitcode is also renamed. llvm-svn: 200505
* Require a module.map file to load a moduleBen Langmuir2014-01-2216-21/+21
| | | | | | | | Removes some old code that allowed a module to be loaded from a pcm file even if the module.map could not be found. Also update a number of tests that relied on the old behavior. llvm-svn: 199852
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-141-1/+0
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* Enable layering check in unavailable modules.Daniel Jasper2013-12-201-0/+2
| | | | | | | | | | | | | | | If a header file belonging to a certain module is not found on the filesystem, that header gets marked as unavailable. Now, the layering warning (-fmodules-decluse) should still warn about headers of this module being wrongfully included. Currently, headers belonging to those modules are just treated as not belonging to modules at all which means they can be included freely from everywhere. To implement this (somewhat) cleanly, I have moved most of the layering checks into the ModuleMap. This will also help with showing FixIts later. llvm-svn: 197805
* Add missing file from r197485.Daniel Jasper2013-12-171-0/+2
| | | | | | (Yes, the irony is not lost on me :-) ). llvm-svn: 197486
* Modules: Don't warn upon missing headers while reading the module map.Daniel Jasper2013-12-174-2/+12
| | | | | | | | | | | | | | | Instead, mark the module as unavailable so that clang errors as soon as someone tries to build this module. This works towards the long-term goal of not stat'ing 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 unblock us and moves us into the right direction. Also changed the implementation to reuse the same DiagnosticsEngine. llvm-svn: 197485
* Revert "Modules: Make missing headers in a module.map a warning not an error."Daniel Jasper2013-12-163-5/+1
| | | | | | This was committed accidentally. llvm-svn: 197389
* Modules: Make missing headers in a module.map a warning not an error.Daniel Jasper2013-12-163-1/+5
| | | | | | | | | | | | | | | | 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
* Move the input files for the unnecessary-module-map-parsing test to Inputs.Manuel Klimek2013-12-134-3/+3
| | | | | | | Needed to change rename.m to set the right include path so we don't import a broken module due to recursive module checking. llvm-svn: 197222
OpenPOWER on IntegriCloud