summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLookup.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Ensure code complete with !LoadExternal sees all local decls.Sam McCall2018-01-161-1/+2
| | | | | | | | | | | | | | | | | | | | | Summary: noload_lookups() was too lazy: in addition to avoiding external decls, it avoided populating the lazy lookup structure for internal decls. This is the right behavior for the existing callsite in ASTDumper, but I think it's not a very useful default, so we populate it by default. While here: - remove an unused test file accidentally added in r322371. - remove lookups_begin()/lookups_end() in favor of lookups().begin(), which is more common and more efficient. Reviewers: ilya-biryukov Subscribers: cfe-commits, rsmith Differential Revision: https://reviews.llvm.org/D42077 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322548 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeComplete] Add an option to omit results from the preamble.Sam McCall2018-01-121-27/+39
| | | | | | | | | | | | | | | | | | | | | | | Summary: Enumerating the contents of a namespace or global scope will omit any decls that aren't already loaded, instead of deserializing them from the PCH. This allows a fast hybrid code completion where symbols from headers are provided by an external index. (Sema already exposes the information needed to do a reasonabl job of filtering them). Clangd plans to implement this hybrid. This option is just a hint - callers still need to postfilter results if they want to *avoid* completing decls outside the main file. Reviewers: bkramer, ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41989 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322371 91177308-0d34-0410-b5e6-96231b3b80d8
* When name lookup finds a non-imported declaration and looks back along theRichard Smith2018-01-061-29/+28
| | | | | | | | | | | redecl chain for an imported declaration, make sure to check the IDNS of prior imported decls. Otherwise we can end up finding an invisible friend declaration and incorrectly believing that it should be visible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321916 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Small const correctness fixHamza Sood2017-12-271-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321494 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Retain multiple using-directives in the same scope even if they ↵Richard Smith2017-10-301-3/+3
| | | | | | | | | | | | | name the same namespace. They might have different visibility, and thus discarding all but one of them can result in rejecting valid code. Also fix name lookup to cope with multiple using-directives being found that denote the same namespace, where some are not visible -- don't cache an "already visited" state for a using-directive that we didn't visit because it was hidden. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316965 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] When finding the owning module of an instantiated context in templateRichard Smith2017-10-181-1/+1
| | | | | | | | instantiation, follow lexical parents not semantic ones: we want to find the module where the pattern was written. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316055 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Avoid iterator invalidation when code completing.Benjamin Kramer2017-10-131-2/+4
| | | | | | | | | | | | It's possible for the code completion consumer to add new decls to the current scope while lookup happens on it. Avoid this by making a copy first. Sadly I wasn't able to get a self-contained test case for this as it requires code completion + precompiled preamble + the stars aligning to deserialize at exactly the right time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315772 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Fix visibility checking for using declarations via ADL.Richard Smith2017-10-111-6/+14
| | | | | | | | We want to check whether the using (shadow) declaration itself is visible, not whether its target is visible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315408 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Only take visible using-directives into account during name lookup.Richard Smith2017-10-111-14/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315402 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules TS] Module ownership semantics for redeclarations.Richard Smith2017-10-101-1/+29
| | | | | | | | | | | | | | | | | | When declaring an entity in the "purview" of a module, it's never a redeclaration of an entity in the purview of a default module or in no module ("in the global module"). Don't consider those other declarations as possible redeclaration targets if they're not visible, and reject any cases where we pick a prior visible declaration that violates this rule. This reinstates r315251 and r315256, reverted in r315309 and r315308 respectively, tweaked to avoid triggering a linkage calculation when declaring implicit special members (this exposed our pre-existing issue with typedef names for linkage changing the linkage of types whose linkage has already been computed and cached in more cases). A testcase for that regression has been added in r315366. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315379 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Modules TS] Module ownership semantics for redeclarations."Eric Liu2017-10-101-29/+1
| | | | | | This reverts commit r315251. See the original commit thread for reason. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315309 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules TS] Module ownership semantics for redeclarations.Richard Smith2017-10-091-1/+29
| | | | | | | | | | | When declaring an entity in the "purview" of a module, it's never a redeclaration of an entity in the purview of a default module or in no module ("in the global module"). Don't consider those other declarations as possible redeclaration targets if they're not visible, and reject any cases where we pick a prior visible declaration that violates this rule. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315251 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply Sema: allow imaginary constants via GNU extension if UDL overloads ↵Tim Northover2017-08-091-6/+10
| | | | | | | | | | | | | | | | | | not present. C++14 added user-defined literal support for complex numbers so that you can write something like "complex<double> val = 2i". However, there is an existing GNU extension supporting this syntax and interpreting the result as a _Complex type. This changes parsing so that such literals are interpreted in terms of C++14's operators if an overload is present but otherwise falls back to the original GNU extension. (We now have more robust diagnostics for implicit conversions so the libc++ test that caused the original revert still passes). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310478 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Fix operator lookup to consider local extern declarations.Eric Fiselier2017-07-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Previously Clang was not considering operator declarations that occur at function scope. This is incorrect according to [over.match.oper]p3 > The set of non-member candidates is the result of the unqualified lookup of operator@ in the context of the expression according to the usual rules for name lookup in unqualified function calls. This patch changes operator name lookup to consider block scope declarations. This patch fixes PR27027. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35297 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309530 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules ts] Improve merging of module-private declarations.Richard Smith2017-07-051-32/+60
| | | | | | | | | | | These cases occur frequently for declarations in the global module (above the module-declaration) in a Modules TS module interface. When we merge a definition from another module into such a module-private definition, ensure that we transitively make everything lexically within that definition visible to that translation unit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307129 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules ts] Declarations from a module interface unit are only visible outsideRichard Smith2017-07-051-6/+22
| | | | | | | the module if declared in an export block. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307115 91177308-0d34-0410-b5e6-96231b3b80d8
* PR33552: Distinguish between declarations that are owned by no module andRichard Smith2017-06-231-2/+2
| | | | | | | | | | | | | | | | | | | | declarations that are owned but unconditionally visible. This allows us to set declarations as visible even if they have a local owning module, without losing information. In turn, that means that our Objective-C support can keep on incorrectly assuming the "hidden" bit on the declaration is the whole story with regard to name visibility. This will also be useful once we support the C++ Modules TS export semantics. Objective-C name visibility is still incorrect in any case where the "hidden" bit is not the complete story: for instance, in Objective-C++ the set of visible categories will be wrong during template instantiation, and with local submodule visibility enabled it will be wrong when building modules. Fixing that will require a major overhaul of how visibility is handled for Objective-C (and particularly for categories). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306075 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for Bug 33471: Preventing operator auto from resolving to a template ↵Erich Keane2017-06-201-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | operator. As the bug report says, struct A { template<typename T> operator T(); }; void foo() { A().operator auto(); } causes: "undeduced type in IR-generation UNREACHABLE executed at llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:208!" The problem is that in this case, "T" is being deduced as "auto", which I believe is incorrect. The 'operator auto' implementation in Clang is standards compliant, however there is a defect report against core (1670). Differential Revision: https://reviews.llvm.org/D34370 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305812 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash when an 'import a module' TypoCorrection has its CorrectionDeclsRichard Smith2017-06-051-7/+6
| | | | | | | | | | | | | replaced by visible decls. Make sure that all paths through checkCorrectionVisibility set the RequiresImport flag appropriately, so we don't end up using a stale value. Patch by Jorge Gorbe! Differential Revision: https://reviews.llvm.org/D30963 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304745 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-031-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304651 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Sema: allow imaginary constants via GNU extension if UDL overloads ↵Tim Northover2017-05-241-10/+6
| | | | | | | | | not present." This reverts commit r303697. It broke libc++ tests that were specifically checking incompatibility in C++14 mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303813 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Fix overly conservative assertion for import diagnosticBruno Cardoso Lopes2017-05-231-2/+0
| | | | | | | | | | | | | | | | We currenltly assert when want to diagnose a missing import and the decl in question is already visible. It turns out that the decl in question might be visible because another decl from the same module actually made the module visible in a previous error diagnostic. Remove the assertion and avoid re-exporting the module if it's already visible. rdar://problem/27975402 Differential Revision: https://reviews.llvm.org/D32828 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303705 91177308-0d34-0410-b5e6-96231b3b80d8
* Sema: allow imaginary constants via GNU extension if UDL overloads not present.Tim Northover2017-05-231-6/+10
| | | | | | | | | | | | | C++14 added user-defined literal support for complex numbers so that you can write something like "complex<double> val = 2i". However, there is an existing GNU extension supporting this syntax and interpreting the result as a _Complex type. This changes parsing so that such literals are interpreted in terms of C++14's operators if an overload is present but otherwise falls back to the original GNU extension. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303694 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove last (unnecessary) use of mapping from SourceLocation to Module andRichard Smith2017-05-191-2/+2
| | | | | | | | | | remove the mechanism for doing so. This mechanism was incorrect in the presence of preprocessed modules (and #pragma clang module begin/end). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303469 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Switch from inferring owning modules based on source location toRichard Smith2017-05-181-44/+60
| | | | | | | | | | | | | | | | inferring based on the current module at the point of creation. This should result in no functional change except when building a preprocessed module (or more generally when using #pragma clang module begin/end to switch module in the middle of a file), in which case it allows us to correctly track the owning module for declarations. We can't map from FileID to module in the preprocessed module case, since all modules would have the same FileID. There are still a couple of remaining places that try to infer a module from a source location; I'll clean those up in follow-up changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303322 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] When creating a declaration, cache its owning module immediatelyRichard Smith2017-05-171-57/+0
| | | | | | | | | | | | | | | | rather than waiting until it's queried. Currently this is only applied to local submodule visibility mode, as we don't yet allocate storage for the owning module in non-local-visibility modules compilations. This reinstates r302965, reverted in r303037, with a fix for the reported crash, which occurred when reparenting a local declaration to be a child of a hidden imported declaration (specifically during template instantiation). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303224 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r302965 - [modules] When creating a declaration, cache its owningDaniel Jasper2017-05-151-0/+57
| | | | | | | | | module immediately Also revert dependent r302969. This is leading to crashes. Will provide more details reproduction instructions to Richard. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303037 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] When creating a declaration, cache its owning module immediatelyRichard Smith2017-05-121-57/+0
| | | | | | | | | | | rather than waiting until it's queried. Currently this is only applied to local submodule visibility mode, as we don't yet allocate storage for the owning module in non-local-visibility modules compilations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302965 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary mapping from SourceLocation to Module.Richard Smith2017-05-111-3/+3
| | | | | | | | | When we parse a redefinition of an entity for which we have a hidden existing declaration, make it visible in the current module instead of mapping the current source location to its containing module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302842 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeCompletion] Provide member completions for dependent expressions whoseAlex Lorenz2017-05-111-14/+32
| | | | | | | | | | | | | | | type is a TemplateSpecializationType or InjectedClassNameType Fixes PR30847. Partially fixes PR20973 (first position only). PR17614 is still not working, its expression has the dependent builtin type. We'll have to teach the completion engine how to "resolve" dependent expressions to fix it. rdar://29818301 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302797 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Properly look up the owning module for an instantiation of a ↵Richard Smith2017-04-211-11/+4
| | | | | | | | | | | | | | | | merged template. When looking for the template instantiation pattern of a templated entity, consistently select the definition of the pattern if there is one. This means we'll pick the same owning module when we start instantiating a template that we'll later pick when determining which modules are visible during that instantiation. This reinstates r300650, reverted in r300659, with a fix for a regression reported by Chandler after commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300938 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r300653 and r300650. The underlying commit fixes one issue withChandler Carruth2017-04-191-5/+17
| | | | | | | | | | modules but exposes much more widespread issues. Example and more information is on the review thread for r300650. Original commit summary: [modules] Properly look up the owning module for an instantiation of a merged template. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300659 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Properly look up the owning module for an instantiation of a ↵Richard Smith2017-04-191-17/+5
| | | | | | | | | | | | | merged template. When looking for the template instantiation pattern of a templated entity, consistently select the definition of the pattern if there is one. This means we'll pick the same owning module when we start instantiating a template that we'll later pick when determining which modules are visible during that instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300650 91177308-0d34-0410-b5e6-96231b3b80d8
* Rangify for loop, NFC.Yaron Keren2017-04-121-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300043 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out some common code between SpecialMemberExceptionSpecInfo and ↵Richard Smith2017-02-241-25/+25
| | | | | | | | | SpecialMemberDeletionInfo. To simplify this, convert SpecialMemberOverloadResult to a value type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296073 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ActiveTemplateInstantiation to CodeSynthesisContext in preparation forRichard Smith2017-02-231-9/+7
| | | | | | | | using it for other kinds of context (where we currently produce context notes in a highly ad-hoc manner). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295919 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix assertion failure due to implicit special member lookup lacking a source ↵Richard Smith2017-02-151-4/+7
| | | | | | location. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295149 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++1z] Synthesize implicit deduction guides from constructors on demand. RankRichard Smith2017-02-141-2/+8
| | | | | | | | | | | | | | | | | | | | such guides below explicit ones, and ensure that references to the class's template parameters are not treated as forwarding references. We make a few tweaks to the wording in the current standard: 1) The constructor parameter list is copied faithfully to the deduction guide, without losing default arguments or a varargs ellipsis (which the standard wording loses by omission). 2) If the class template declares no constructors, we add a T() -> T<...> guide (which will only ever work if T has default arguments for all non-pack template parameters). 3) If the class template declares nothing that looks like a copy or move constructor, we add a T(T<...>) -> T<...> guide. #2 and #3 follow from the "pretend we had a class type with these constructors" philosophy for deduction guides. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295007 91177308-0d34-0410-b5e6-96231b3b80d8
* Change how we handle diagnose_if attributes.George Burgess IV2017-01-281-2/+1
| | | | | | | | | | | | | | This patch changes how we handle argument-dependent `diagnose_if` attributes. In particular, we now check them in the same place that we check for things like passing NULL to Nonnull args, etc. This is basically better in every way than how we were handling them before. :) This fixes PR31638, PR31639, and PR31640. Differential Revision: https://reviews.llvm.org/D28889 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293360 91177308-0d34-0410-b5e6-96231b3b80d8
* PR0091R3: Implement parsing support for using templates as types.Richard Smith2017-01-261-0/+1
| | | | | | | | | | | | | | | | This change adds a new type node, DeducedTemplateSpecializationType, to represent a type template name that has been used as a type. This is modeled around AutoType, and shares a common base class for representing a deduced placeholder type. We allow deduced class template types in a few more places than the standard does: in conditions and for-range-declarators, and in new-type-ids. This is consistent with GCC and with discussion on the core reflector. This patch does not yet support deduced class template types being named in typename specifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293207 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] UsingShadowDecl shouldn't be hidden by the UsingDecl that owns itAlex Lorenz2017-01-231-0/+6
| | | | | | | | | rdar://23454249 Differential Revision: https://reviews.llvm.org/D28514 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292805 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the diagnose_if attribute to clang.George Burgess IV2017-01-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `diagnose_if` can be used to have clang emit either warnings or errors for function calls that meet user-specified conditions. For example: ``` constexpr int foo(int a) __attribute__((diagnose_if(a > 10, "configurations with a > 10 are " "expensive.", "warning"))); int f1 = foo(9); int f2 = foo(10); // warning: configuration with a > 10 are expensive. int f3 = foo(f2); ``` It currently only emits diagnostics in cases where the condition is guaranteed to always be true. So, the following code will emit no warnings: ``` constexpr int bar(int a) { foo(a); return 0; } constexpr int i = bar(10); ``` We hope to support optionally emitting diagnostics for cases like that (and emitting runtime checks) in the future. Release notes will appear shortly. :) Differential Revision: https://reviews.llvm.org/D27424 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291418 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix name hiding and redeclaration checking for dependent localRichard Smith2016-12-181-3/+6
| | | | | | | using-declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290072 91177308-0d34-0410-b5e6-96231b3b80d8
* [Frontend] Allow attaching an external sema source to compiler instance and ↵Benjamin Kramer2016-11-161-0/+4
| | | | | | | | | | | extra diags to TypoCorrections This can be used to append alternative typo corrections to an existing diag. include-fixer can use it to suggest includes to be added. Differential Revision: https://reviews.llvm.org/D26745 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287128 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete a trivially true check for a variable 'S' being null.Chandler Carruth2016-11-041-1/+1
| | | | | | | | | | | | | The exact same test guards entry into the loop in which this test occurs, and there is nothing inside the loop that assigns to the variable, so it has already been checked for null. This was flagged by PVS-Studio as well, but the report is actually wrong -- this is not a case where we dereference a variable prior to testing it for null, this is a case where we have a redundant test for null after we already performed the exact same test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285983 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert accidentally checked in change in r281315.Vassil Vassilev2016-09-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281316 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify. NFC.Vassil Vassilev2016-09-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281315 91177308-0d34-0410-b5e6-96231b3b80d8
* C++ Modules TS: Add parsing and some semantic analysis support forRichard Smith2016-09-081-2/+2
| | | | | | | | export-declarations. These don't yet have an effect on name visibility; we still export everything by default. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280999 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Apply ODR merging for function scoped tags only in C++ mode.Vassil Vassilev2016-09-081-1/+6
| | | | | | | | | | | | 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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280984 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Don't emit initializers for VarDecls within a module eagerly wheneverRichard Smith2016-07-201-2/+3
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276159 91177308-0d34-0410-b5e6-96231b3b80d8