summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/Inputs
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] When we merge two definitions of a function, mark the retainedRichard Smith2016-09-122-0/+13
| | | | | | | definition as visible in the discarded definition's module, as we do for other kinds of definition. llvm-svn: 281258
* Modules: for ObjectiveC try to keep the definition invariant.Manman Ren2016-09-0917-0/+49
| | | | | | | | | | | | When deserializing ObjCInterfaceDecl with definition data, if we already have a definition, try to keep the definition invariant; also pull in the categories even if it is not what getDefinition returns (this effectively combines categories). rdar://27926200 rdar://26708823 llvm-svn: 281119
* Modules: revert r280728.Manman Ren2016-09-094-12/+0
| | | | | | | In post-commit review, Richard suggested a better way to fix this. rdar://27926200 llvm-svn: 281078
* [modules] Apply ODR merging for function scoped tags only in C++ mode.Vassil Vassilev2016-09-084-0/+12
| | | | | | | | | | | In C mode, if we have a visible declaration but not a visible definition, a tag defined in the declaration should be have a visible definition. In C++ we rely on the ODR merging, whereas in C we cannot because each declaration of a function gets its own set of declarations in its prototype scope. Patch developed in collaboration with Richard Smith! llvm-svn: 280984
* Modules: Fix an assertion in DeclContext::buildLookup.Manman Ren2016-09-064-0/+12
| | | | | | | | | | When calling getMostRecentDecl, we can pull in more definitions from a module. We call getPrimaryContext afterwards to make sure that we buildLookup on a primary context. rdar://27926200 llvm-svn: 280728
* [Modules] Add 'gnuinlineasm' to the 'requires-declaration' feature-list.Bruno Cardoso Lopes2016-08-303-0/+10
| | | | | | | | | | | | | This adds support for modules that require (no-)gnu-inline-asm environment, such as the compiler builtin cpuid submodule. This is the gnu-inline-asm variant of https://reviews.llvm.org/D23871 Differential Revision: https://reviews.llvm.org/D23905 rdar://problem/26931199 llvm-svn: 280159
* Fix regression introduced by r279164: only pass definitions as the PatternDefRichard Smith2016-08-232-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | to DiagnoseUninstantiableTemplate, teach hasVisibleDefinition to correctly determine whether a function definition is visible, and mark both the function and the template as visible when merging function template definitions to provide hasVisibleDefinition with the relevant information. The change to always pass the right declaration as the PatternDef to DiagnoseUninstantiableTemplate also caused those checks to happen before other diagnostics in InstantiateFunctionDefinition, giving worse diagnostics for the same situations, so I sunk the relevant diagnostics into DiagnoseUninstantiableTemplate. Those parts of this patch are based on changes in reviews.llvm.org/D23492 by Vassil Vassilev. This reinstates r279486, reverted in r279500, with a fix to DiagnoseUninstantiableTemplate to only mark uninstantiable explicit instantiation declarations as invalid if we actually diagnosed them. (When we trigger an explicit instantiation of a class member from an explicit instantiation declaration for the class, it's OK if there is no corresponding definition and we certainly don't want to mark the member invalid in that case.) This previously caused a build failure during bootstrap. llvm-svn: 279557
* Revert r279486 "Fix regression introduced by r279164"Chandler Carruth2016-08-232-3/+0
| | | | | | | Build bots seem unhappy and as Richard was leaving he asked me to revert this for him. Doing so. llvm-svn: 279500
* Fix regression introduced by r279164: only pass definitions as the PatternDefRichard Smith2016-08-222-0/+3
| | | | | | | | | | | | | | | | to DiagnoseUninstantiableTemplate, teach hasVisibleDefinition to correctly determine whether a function definition is visible, and mark both the function and the template as visible when merging function template definitions to provide hasVisibleDefinition with the relevant information. The change to always pass the right declaration as the PatternDef to DiagnoseUninstantiableTemplate also caused those checks to happen before other diagnostics in InstantiateFunctionDefinition, giving worse diagnostics for the same situations, so I sunk the relevant diagnostics into DiagnoseUninstantiableTemplate. Those parts of this patch are based on changes in reviews.llvm.org/D23492 by Vassil Vassilev. llvm-svn: 279486
* Module debug info: Don't assert when encountering an incomplete definitionAdrian Prantl2016-08-223-0/+25
| | | | | | | | | | in isDefinedInClangModule() and assume that the incomplete definition is not defined in the module. This broke the -gmodules self host recently. rdar://problem/27894367 llvm-svn: 279485
* PR28794: Don't try to instantiate function templates which are not visible.Vassil Vassilev2016-08-184-0/+28
| | | | | | Reviewed by Richard Smith. llvm-svn: 279164
* Module: add -fprebuilt-module-path to support loading prebuilt modules.Manman Ren2016-08-182-0/+2
| | | | | | | | | | | | | In this mode, there is no need to load any module map and the programmer can simply use "@import" syntax to load the module directly from a prebuilt module path. When loading from prebuilt module path, we don't support rebuilding of the module files and we ignore compatible configuration mismatches. rdar://27290316 Differential Revision: http://reviews.llvm.org/D23125 llvm-svn: 279096
* PR28438: Update the information on an identifier with local definitions beforeRichard Smith2016-08-184-0/+5
| | | | | | | | trying to write out its macro graph, in case we imported a module that added another module macro between the most recent local definition and the end of the module. llvm-svn: 279024
* Module debug info: Fix a bug in handling record decls without fields.Adrian Prantl2016-08-171-0/+6
| | | | | | | | | | | The previous condition would erroneously mark all CXXRecordDecls that didn't have any fields as being defined in a clang module. This patch fixes the condition to only apply to explicit template instantiations. <rdar://problem/27771823> llvm-svn: 278952
* Modules: add command line option fmodules-disable-diagnostic-validationManman Ren2016-07-263-0/+6
| | | | | | | | | | | | | | | | | | | | | | With PCH+Module, sometimes compiler gives a hard error: Module file ‘<some-file path>.pcm' is out of date and needs to be rebuilt This happens when we have a pch importing a module and the module gets overwritten by another compiler instance after we build the pch (one example is that both compiler instances hash to the same pcm file but use different diagnostic options). When we try to load the pch later on, the compiler notices that the imported module is out of date (modification date, size do not match) but it can't handle this out of date pcm (i.e it does not know how to rebuild the pch). This commit introduces a new command line option so for PCH + module, we can turn on this option and if two compiler instances only differ in diagnostic options, the latter instance will not invalidate the original pcm. rdar://26675801 Differential Revision: http://reviews.llvm.org/D22773 llvm-svn: 276769
* [modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.Vassil Vassilev2016-07-225-0/+23
| | | | | | | | | | | | | | | Processing update records (and loading a module, in general) might trigger unexpected calls to the ASTWriter (being a mutation listener). Now we have a mechanism to suppress those calls to the ASTWriter but notify other possible mutation listeners. Fixes https://llvm.org/bugs/show_bug.cgi?id=28332 Patch by Cristina Cristescu and me. Reviewed by Richard Smith (D21800). llvm-svn: 276473
* Add regression test for PR27699.Vassil Vassilev2016-07-224-0/+10
| | | | llvm-svn: 276469
* [modules] Don't emit initializers for VarDecls within a module eagerly wheneverRichard Smith2016-07-205-0/+8
| | | | | | | | | | | | we first touch any part of that module. Instead, defer them until the first time that module is (transitively) imported. The initializer step for a module then recursively initializes modules that its own headers imported. For example, this avoids running the <iostream> global initializer in programs that don't actually use iostreams, but do use other parts of the standard library. llvm-svn: 276159
* Revert r275481, r275490. This broke modules bootstrap.Richard Smith2016-07-155-8/+0
| | | | llvm-svn: 275624
* Add test inputs missed by r275481.Richard Smith2016-07-145-0/+8
| | | | llvm-svn: 275490
* [modules] Allow emission of update records for predefined __va_list_tag.Vassil Vassilev2016-06-202-0/+10
| | | | | | | | | | | Handles the cases where old __va_list_tag is coming from a module and the new is not, needing an update record. Fixes https://llvm.org/bugs/show_bug.cgi?id=27890 Patch by Cristina Cristescu, Richard Smith and me. llvm-svn: 273159
* PCH + module: make sure we write out macros associated with builtin identifiers.Manman Ren2016-05-313-0/+13
| | | | | | | | | | | | | | | | | | | | | | When we import a module that defines a builtin identifier from prefix header and precompile the prefix header, the macro information related to the identifier is lost. If we don't precompile the prefix header, the source file can still see the macro information. The reason is that we write out the identifier in the pch but not the macro information since the macro is not defined locally. This is related to r251565. In that commit, if we read a builtin identifier from a module that wasn't "interesting" to that module, we will still write it out to a PCH that imports that module. The fix is to write exported module macros for PCH as well. rdar://24666630 Differential Revision: http://reviews.llvm.org/D20383 llvm-svn: 271310
* [modules] Ask the canonical decl whether the constructor was defaulted.Vassil Vassilev2016-05-244-0/+42
| | | | | | | | | | | In case of template instantiations query the template instantiation pattern, which had actually '=default'. Fixes https://llvm.org/bugs/show_bug.cgi?id=27739 Patch reviewed by Richard Smith. llvm-svn: 270553
* PR27754: CXXRecordDecl::data() needs to perform an update even if it's calledRichard Smith2016-05-175-0/+15
| | | | | | on a declaration that already knows the location of the DefinitionData object. llvm-svn: 269858
* Modules: set SystemHeader to true if we are building a system module.Manman Ren2016-05-174-0/+9
| | | | | | | | | | | | 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
* [ModuleMap][CrashReproducer] Collect headers from inner frameworksBruno Cardoso Lopes2016-05-136-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) Collect headers under inner frameworks (frameworks inside other other frameworks). (2) Make sure we also collect the right header files inside them. More info on (2): Consider a dummy framework module B, with header Frameworks/B/B.h. Now consider that another framework A, with header Frameworks/A/A.h, has a layout with a inner framework Frameworks/A/Frameworks/B/B.h, where the "B/B.h" part is a symlink for Frameworks/B/B.h. Also assume that Frameworks/A/A.h includes <B/B.h>. When parsing header Frameworks/A/A.h, framework module lookup is performed in search for B, and it happens that "Frameworks/A/Frameworks/B/B.h" path is registered in the module instead of real "Frameworks/B/B.h". This occurs because "Frameworks/A/Frameworks/B/B.h" is scanned first by the FileManager, when looking for inner framework modules under Frameworks/A/Frameworks. This makes Frameworks/A/Frameworks/B/B.h the default cached named inside the FileManager for the B.h file UID. This leads to modules being built without consistent paths to underlying header files. This is usually not a problem in regular compilation flow, but it's an issue when running the crash reproducer. The issue is that clangs collect "Frameworks/A/Frameworks/B/B.h" but not "Frameworks/B/B.h" into the VFS, leading to err_mmap_umbrella_clash. So make sure we also collect the original header. Differential Revision: http://reviews.llvm.org/D20194 rdar://problem/25880368 llvm-svn: 269502
* [modules] Enforce the rules that an explicit or partial specialization must beRichard Smith2016-05-053-0/+62
| | | | | | | | declared before it is used. Because we don't use normal name lookup to find these, the normal code to filter out non-visible names from name lookup results does not apply. llvm-svn: 268585
* Fix CodeCompletion & TypoCorrection when combining a PCH with ModulesBen Langmuir2016-05-042-0/+8
| | | | | | | | | | | | | | This commit fixes the IdentifierIterator to actually include identifiers from a PCH or precompiled preamble when there is also a global module index. This was causing code-completion (outside of C++) and typo-correction to be missing global identifiers defined in the PCH/preamble. Typo-correction has been broken since we first started using the module index, whereas code-completion only started relying on identifier iterator in r232793. rdar://problem/25642879 llvm-svn: 268471
* Adding a test for a compiler crash that was fixed in r248069.Douglas Yung2016-05-032-0/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D19048 llvm-svn: 268344
* Method Pool in modules: we make sure that if a module contains an entry forManman Ren2016-04-295-0/+32
| | | | | | | | | | | | | | | a selector, the entry should be complete, containing everything introduced by that module and all modules it imports. Before writing out the method pool of a module, we sync up the out of date selectors by pulling in methods for the selectors, from all modules it imports. In ReadMethodPool, after pulling in the method pool entry for module A, this lets us skip the modules that module A imports. rdar://problem/25900131 llvm-svn: 268091
* Reland r267691 fixing PR27535.Vassil Vassilev2016-04-283-0/+39
| | | | llvm-svn: 267882
* [modules] When diagnosing a missing module import, suggest adding a #include ifRichard Smith2016-04-2717-0/+39
| | | | | | | the current language doesn't have an import syntax and we can figure out a suitable file to include. llvm-svn: 267802
* Revert r267691, it caused PR27535.Nico Weber2016-04-273-39/+0
| | | | llvm-svn: 267744
* [modules] Fix Decl's Used invariant.Vassil Vassilev2016-04-273-0/+39
| | | | | | | | | | | | | | | | | | | | The Decl::isUsed has a value for every decl. In non-module builds it is very difficult (but possible) to break this invariant but when we walk up the redecl chain we find the neccessary information. When deserializing the decls from a module it is much more difficult to update correctly this invariant. The patch centralizes the information whether a decl is used in the canonical decl marking the entire entity as being used. Fixes https://llvm.org/bugs/show_bug.cgi?id=27401 Patch by Cristina Cristescu and me. Thanks to Richard Smith who helped to debug and understand the issue! Reviewed by Richard Smith. llvm-svn: 267691
* PR27513: When determining which declaration to put into an exported lookupRichard Smith2016-04-2611-0/+33
| | | | | | | | | | | table for a module / PCH, never map from a normal declaration of a class to an injected-class-name declaration (or vice versa). Those declarations live in distinct lookup tables and should not be confused. We really shouldn't be using a CXXRecordDecl to represent an injected-class-name in the first place; I've filed PR27532 so we don't forget. llvm-svn: 267632
* Module debugging: Also correctly handle typedef'd foward-declared members.Adrian Prantl2016-04-261-4/+5
| | | | | | Thanks again to Richard Smith for pointing this out. llvm-svn: 267630
* Module debugging: Add testcase for member classes of class template ↵Adrian Prantl2016-04-261-0/+9
| | | | | | specializations. llvm-svn: 267612
* Module Debugging: Fix the condition for determining whether a templateAdrian Prantl2016-04-251-1/+13
| | | | | | | | | | | | | | | | | | instantiation is in a module. This patch fixes the condition for determining whether the debug info for a template instantiation will exist in an imported clang module by: - checking whether the ClassTemplateSpecializationDecl is complete and - checking that the instantiation was in a module by looking at the first field. I also added a negative check to make sure that a typedef to a forward-declared template (with the definition outside of the module) is handled correctly. http://reviews.llvm.org/D19443 rdar://problem/25553724 llvm-svn: 267464
* Module Debugging: Emit the canonical debug info for Objective-C classesAdrian Prantl2016-04-201-0/+6
| | | | | | | | | | | | | in the compile unit that contains their implementation even if their interface is declared in a module. The private @implementation of an @interface may have additional hidden ivars so we should not defer to the public version of the type that is found in the module. <rdar://problem/25541798> llvm-svn: 266937
* Fix off-by-one error in worst-case number of offsets needed for an AST record.Richard Smith2016-04-141-0/+5
| | | | llvm-svn: 266353
* PR25501: Delay loading visible updates for a declaration until after we'veRichard Smith2016-04-086-0/+16
| | | | | | | | | | | processed update records. If an update record adds a definition, we need to merge that with any pre-existing definition to determine which the canonical definition is before we apply the visible update, otherwise we wouldn't know where to apply it. Thanks to Vassil Vassilev for help reducing this and tracking down the problem. llvm-svn: 265848
* [modules] Handle merged fields in designated initializers.Richard Smith2016-04-081-0/+4
| | | | llvm-svn: 265838
* [modules] Add forgotten test case to r265597.Vassil Vassilev2016-04-064-0/+9
| | | | llvm-svn: 265599
* [VFS] Handle empty entries in directory traversalBruno Cardoso Lopes2016-03-304-0/+13
| | | | | | | | | | | | | The VFS YAML files contain empty directory entries to describe that it's returning from a subdirectory before describing new files in the parent. In the future, we should properly sort and write YAML files avoiding such empty dirs and mitigate the extra recurson cost. However, since this is used by previous existing YAMLs, make the traversal work in their presence. rdar://problem/24499339 llvm-svn: 264970
* Canonicalize UnaryTransformType types when they don't have a known ↵Vassil Vassilev2016-03-303-0/+32
| | | | | | | | | | underlying type. Fixes https://llvm.org/bugs/show_bug.cgi?id=26014 Reviewed by Richard Smith. llvm-svn: 264937
* [modules] Write out identifiers if the ID is local, too.Vassil Vassilev2016-03-304-0/+7
| | | | | | | | | | | | | | | | | In some cases a slot for an identifier is requested but it gets written to another module, causing an assertion. At the point when we start serializing Rtypes, we have no imported IdentifierID for float_round_style. We start serializing stuff and allocate an ID for it. Then, during the serialization process, we pull in the identifier info for it from TSchemaHelper. Finally, WriteIdentifierTable decides that the identifier has not changed since it was deserialized, so doesn't emit it. Fixes https://llvm.org/bugs/show_bug.cgi?id=27041 Discussed on IRC with Richard Smith. Agreed on post commit review if needed. llvm-svn: 264913
* [modules] Add a regression test for PR21547.Vassil Vassilev2016-03-302-0/+17
| | | | llvm-svn: 264908
* Use a simpler set of mock headers for the vfs+modules crash recovery tests.Benjamin Kramer2016-03-173-0/+11
| | | | | | | | | | The System/ mock is large and too complex for this test. It can cause the tests to fail in mysterious ways as it depends on the resource dir being present, which is not really supported for driver tests (using %clang instead of %clang_cc1). Copy the tree and trim out all the %unnecessary fat. llvm-svn: 263718
* [modules] Fix adding a templated friend functions to a namespace from ↵Vassil Vassilev2016-03-163-0/+49
| | | | | | | | | | | | | | another module. When clang adds argument dependent lookup candidates, it can perform template instantiation. For example, it can instantiate a templated friend function and register it in the enclosing namespace's lookup table. Fixes https://llvm.org/bugs/show_bug.cgi?id=24954 Reviewed by Richard Smith. llvm-svn: 263634
* [modules] Don't diagnose non-modular includes from modular files that areRichard Smith2016-03-141-0/+4
| | | | | | implementation units of modules rather than interface units. llvm-svn: 263449
OpenPOWER on IntegriCloud