History log of /llvm-project/clang/lib/Basic/Module.cpp (Results 101 – 125 of 135)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 77944868 02-Mar-2014 Richard Smith <richard-llvm@metafoo.co.uk>

Add [extern_c] attribute for modules, allowing a C module to be imported within an extern "C" block in C++ code.

llvm-svn: 202615


Revision tags: llvmorg-3.4.0
# 0761a8a0 17-Dec-2013 Daniel Jasper <djasper@google.com>

Modules: Don't warn upon missing headers while reading the module map.

Instead, mark the module as unavailable so that clang errors as soon as
someone tries to build this module.

This works towards

Modules: Don't warn upon missing headers while reading the module map.

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

show more ...


Revision tags: llvmorg-3.4.0-rc3, llvmorg-3.4.0-rc2, llvmorg-3.4.0-rc1
# e9bcf5b7 04-Nov-2013 Dmitri Gribenko <gribozavr@gmail.com>

Include non-explicit submodules in exported module list

This change fixes Richard's testcase for r193815. Now we include non-explicit
submodules into the list of exports.

The test failed previousl

Include non-explicit submodules in exported module list

This change fixes Richard's testcase for r193815. Now we include non-explicit
submodules into the list of exports.

The test failed previously because:
- recursive_visibility_a1.inner is not imported (only recursive_visibility_a1 is),
- thus the 'inner' submodule is not showing up in any of the import lists,
- and because of this getExportedModules() is not returning the
correct module set -- it only considers modules that are imported.

The fix is to make Module::getExportedModules() include non-explicit submodules
into the list of exports.

llvm-svn: 194018

show more ...


# dde17e74 01-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk>

Simplify computation of visible module set.

llvm-svn: 193850


# dc360d57 31-Oct-2013 Dmitri Gribenko <gribozavr@gmail.com>

Clang modules: collect exports recursively

This change makes Module::buildVisibleModulesCache() collect exported modules
recursively.

While computing a set of exports, getExportedModules() iterates

Clang modules: collect exports recursively

This change makes Module::buildVisibleModulesCache() collect exported modules
recursively.

While computing a set of exports, getExportedModules() iterates over the set of
imported modules and filters it. But it does not consider the set of exports
of those modules -- it is the responsibility of the caller to do this.

Here is a certain instance of this issue. Module::isModuleVisible says that
CoreFoundation.CFArray submodule is not visible from Cocoa. Why?

- Cocoa imports Foundation.
- Foundation has an export restriction: "export *".
- Foundation imports CoreFoundation. (Just the top-level module.)
- CoreFoundation exports CoreFoundation.CFArray.

To decide which modules are visible from Cocoa, we collect all exported modules
from immediate imports in Cocoa:

> visibleModulesFro(Cocoa) = exported(Foundation) + exported(CoreData) + exported(AppKit)

To find out which modules are exported, we filter imports according to
restrictions:

> exported(Foundation) = filterByModuleMapRestrictions(imports(Foundation))

Because Foundation imports CoreFoundation (not CoreFoundation.CFArray), the
CFArray submodule is considered not exported from Foundation, and is not
visible from Cocoa (according to Module::isModuleVisible).

llvm-svn: 193815

show more ...


# a3feee2a 28-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk>

Allow a new syntax in a module requires-declaration:

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 b

Allow a new syntax in a module requires-declaration:

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

show more ...


# ba7f2f71 24-Sep-2013 Daniel Jasper <djasper@google.com>

Module use declarations (II)

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 or

Module use declarations (II)

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

show more ...


# 0e5d7b8c 25-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk>

When we perform dependent name lookup during template instantiation, it's not
sufficient to only consider names visible at the point of instantiation,
because that may not include names that were vis

When we perform dependent name lookup during template instantiation, it's not
sufficient to only consider names visible at the point of instantiation,
because that may not include names that were visible when the template was
defined. More generally, if the instantiation backtrace goes through a module
M, then every declaration visible within M should be available to the
instantiation. Any of those declarations might be part of the interface that M
intended to export to a template that it instantiates.

The fix here has two parts:

1) If we find a non-visible declaration during name lookup during template
instantiation, check whether the declaration was visible from the defining
module of all entities on the active template instantiation stack. The defining
module is not the owning module in all cases: we look at the module in which a
template was defined, not the module in which it was first instantiated.

2) Perform pending instantiations at the end of a module, not at the end of the
translation unit. This is general goodness, since it significantly cuts down
the amount of redundant work that is performed in every TU importing a module,
and also implicitly adds the module containing the point of instantiation to
the set of modules checked for declarations in a lookup within a template
instantiation.

There's a known issue here with template instantiations performed while
building a module, if additional imports are added later on. I'll fix that
in a subsequent commit.

llvm-svn: 187167

show more ...


Revision tags: llvmorg-3.3.1-rc1
# 61ac906b 08-Jul-2013 Craig Topper <craig.topper@gmail.com>

Use SmallVectorImpl::reverse_iterator instead of SmallVector to avoid specifying the vector size.

llvm-svn: 185784


# b53e5483 20-Jun-2013 Lawrence Crowl <crowl@google.com>

This patch adds new private headers to the module map. Private
headers may be included from within the module, but not from outside
the module.

llvm-svn: 184471


Revision tags: llvmorg-3.3.0, llvmorg-3.3.0-rc3, llvmorg-3.3.0-rc2, llvmorg-3.3.0-rc1
# fb912657 20-Mar-2013 Douglas Gregor <dgregor@apple.com>

<rdar://problem/12368093> Extend module maps with a 'conflict' declaration, and warn when a newly-imported module conflicts with an already-imported module.

llvm-svn: 177577


# 8d932427 20-Mar-2013 Douglas Gregor <dgregor@apple.com>

Make sure that Module::ConfigMacrosExhaustive gets initialized and deserialized correctly.

This fixes regressions introduced in r177466 that caused several
module tests to fail sporadically.

llvm-s

Make sure that Module::ConfigMacrosExhaustive gets initialized and deserialized correctly.

This fixes regressions introduced in r177466 that caused several
module tests to fail sporadically.

llvm-svn: 177481

show more ...


# 35b13ece 20-Mar-2013 Douglas Gregor <dgregor@apple.com>

<rdar://problem/10796651> Introduce configuration macros into module maps.

Configuration macros are macros that are intended to alter how a
module works, such that we need to build different module

<rdar://problem/10796651> Introduce configuration macros into module maps.

Configuration macros are macros that are intended to alter how a
module works, such that we need to build different module variants
for different values of these macros. A module can declare its
configuration macros, in which case we will complain if the definition
of a configation macro on the command line (or lack thereof) differs
from the current preprocessor state at the point where the module is
imported. This should eliminate some surprises when enabling modules,
because "#define CONFIG_MACRO ..." followed by "#include
<module/header.h>" would silently ignore the CONFIG_MACRO setting. At
least it will no longer be silent about it.

Configuration macros are eventually intended to help reduce the number
of module variants that need to be built. When the list of
configuration macros for a module is exhaustive, we only need to
consider the settings for those macros when building/finding the
module, which can help isolate modules for various project-specific -D
flags that should never affect how modules are build (but currently do).

llvm-svn: 177466

show more ...


# 3c5305c1 13-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com>

[Modules] Resolve top-headers of modules lazily.

This allows resolving top-header filenames of modules to FileEntries when
we need them, not eagerly.

Note that that this breaks ABI for libclang fun

[Modules] Resolve top-headers of modules lazily.

This allows resolving top-header filenames of modules to FileEntries when
we need them, not eagerly.

Note that that this breaks ABI for libclang functions
clang_Module_getTopLevelHeader / clang_Module_getNumTopLevelHeaders
but this is fine because they are experimental and not widely used yet.

llvm-svn: 176975

show more ...


# 8739f7b7 19-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com>

[modules] Refactor code from ASTReader::makeModuleVisible() into a new function,
Module::getExportedModules() so it can be reused.

llvm-svn: 175548


# 6ddfca91 14-Jan-2013 Douglas Gregor <dgregor@apple.com>

Implement parsing, AST, (de-)serialization, and placeholder global
metadata for linking against the libraries/frameworks for imported
modules.

The module map language is extended with a new "link" d

Implement parsing, AST, (de-)serialization, and placeholder global
metadata for linking against the libraries/frameworks for imported
modules.

The module map language is extended with a new "link" directive that
specifies what library or framework to link against when a module is
imported, e.g.,

link "clangAST"

or

link framework "MyFramework"

Importing the corresponding module (or any of its submodules) will
eventually link against the named library/framework.

For now, I've added some placeholder global metadata that encodes the
imported libraries/frameworks, so that we can test that this
information gets through to the IR. The format of the data is still
under discussion.

llvm-svn: 172437

show more ...


# f857950d 12-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com>

Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h

llvm-svn: 172323


# 2bf7fdb7 02-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk>

s/CPlusPlus0x/CPlusPlus11/g

llvm-svn: 171367


Revision tags: llvmorg-3.2.0, llvmorg-3.2.0-rc3
# 3a02247d 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com>

Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/util

Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

llvm-svn: 169237

show more ...


Revision tags: llvmorg-3.2.0-rc2, llvmorg-3.2.0-rc1
# 59527666 15-Oct-2012 Douglas Gregor <dgregor@apple.com>

Introduce the notion of excluded headers into the module map
description. Previously, one could emulate this behavior by placing
the header in an always-unavailable submodule, but Argyrios guilted me

Introduce the notion of excluded headers into the module map
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

show more ...


# 43af5132 29-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com>

In the Module class, add a reference to the corresponding AST file.

llvm-svn: 164873


Revision tags: llvmorg-3.1.0, llvmorg-3.1.0-rc3, llvmorg-3.1.0-rc2, llvmorg-3.1.0-rc1
# 3ec6663b 02-Feb-2012 Douglas Gregor <dgregor@apple.com>

Back out my heinous hack that tricked the module generation mechanism
into using non-absolute system includes (<foo>)...

... and introduce another hack that is simultaneously more heineous
and more

Back out my heinous hack that tricked the module generation mechanism
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

show more ...


# 0070c0bf 30-Jan-2012 Douglas Gregor <dgregor@apple.com>

Introduce TargetInfo::hasFeature() to query various feature names in
each of the targets. Use this for module requirements, so that we can
pin the availability of certain modules to certain target fe

Introduce TargetInfo::hasFeature() to query various feature names in
each of the targets. Use this for module requirements, so that we can
pin the availability of certain modules to certain target features,
e.g., provide a module for xmmintrin.h only when SSE support is
available.

Use these feature names to provide a nearly-complete module map for
Clang's built-in headers. Only mm_alloc.h and unwind.h are missing,
and those two are fairly specialized at the moment. Finishes
<rdar://problem/10710060>.

llvm-svn: 149227

show more ...


# 89929282 30-Jan-2012 Douglas Gregor <dgregor@apple.com>

Thread a TargetInfo through to the module map; we'll need it for
target-specific module requirements.

llvm-svn: 149224


# a686e1b0 27-Jan-2012 Douglas Gregor <dgregor@apple.com>

Introduce module attributes into the module map grammar, along with a
single attribute ("system") that allows us to mark a module as being a
"system" module. Each of the headers that makes up a syste

Introduce module attributes into the module map grammar, along with a
single attribute ("system") that allows us to mark a module as being a
"system" module. Each of the headers that makes up a system module is
considered to be a system header, so that we (for example) suppress
warnings there.

If a module is being inferred for a framework, and that framework
directory is within a system frameworks directory, infer it as a
system framework.

llvm-svn: 149143

show more ...


123456