summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Module.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-05 17:28:06 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-05 17:28:06 +0000
commitf5eedd05db6dd136fd8a4368fe2f9ffd67f696f0 (patch)
tree96081e609965744502ed18baa14c451bdbf78bbb /clang/lib/Basic/Module.cpp
parent13231037f0e9cc4eeb7f0454c35c9c4100760bac (diff)
downloadbcm5719-llvm-f5eedd05db6dd136fd8a4368fe2f9ffd67f696f0.tar.gz
bcm5719-llvm-f5eedd05db6dd136fd8a4368fe2f9ffd67f696f0.zip
Implement support for wildcard exports in modules, allowing a module
to re-export anything that it imports. This opt-in feature makes a module behave more like a header, because it can be used to re-export the transitive closure of a (sub)module's dependencies. llvm-svn: 145811
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r--clang/lib/Basic/Module.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index 6bca55c754a..59fced5f16c 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -25,6 +25,18 @@ Module::~Module() {
}
+bool Module::isSubModuleOf(Module *Other) const {
+ const Module *This = this;
+ do {
+ if (This == Other)
+ return true;
+
+ This = This->Parent;
+ } while (This);
+
+ return false;
+}
+
std::string Module::getFullModuleName() const {
llvm::SmallVector<StringRef, 2> Names;
OpenPOWER on IntegriCloud