diff options
author | Douglas Gregor <dgregor@apple.com> | 2013-01-14 17:21:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2013-01-14 17:21:00 +0000 |
commit | 6ddfca91e04e62089d685b31533b9a2d677d9a5e (patch) | |
tree | b803eaa1d88091fd5b65134468b8e922c1deb773 /clang/lib/Basic/Module.cpp | |
parent | 3778f27b2302c69ce1d9d4af70aab60143fd5b54 (diff) | |
download | bcm5719-llvm-6ddfca91e04e62089d685b31533b9a2d677d9a5e.tar.gz bcm5719-llvm-6ddfca91e04e62089d685b31533b9a2d677d9a5e.zip |
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
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r-- | clang/lib/Basic/Module.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 417c7e57453..5e5e431d311 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -257,6 +257,16 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { OS << "\n"; } + for (unsigned I = 0, N = LinkLibraries.size(); I != N; ++I) { + OS.indent(Indent + 2); + OS << "link "; + if (LinkLibraries[I].IsFramework) + OS << "framework "; + OS << "\""; + OS.write_escaped(LinkLibraries[I].Library); + OS << "\""; + } + if (InferSubmodules) { OS.indent(Indent + 2); if (InferExplicitSubmodules) |