From 0adaa880993ad23186c87c7f98e7a3fd2697742c Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 5 Dec 2011 17:28:06 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145811 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/Module.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/Basic/Module.cpp') diff --git a/lib/Basic/Module.cpp b/lib/Basic/Module.cpp index 6bca55c754..59fced5f16 100644 --- a/lib/Basic/Module.cpp +++ b/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 Names; -- cgit v1.2.3-18-g5258