[IDE] Handle annotation of clang submodule imports properly.

rdar://17780613

Swift SVN r20595
This commit is contained in:
Argyrios Kyrtzidis
2014-07-26 20:58:19 +00:00
parent c2dee83422
commit 3175251bb1
8 changed files with 147 additions and 45 deletions

View File

@@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//
#include "swift/IDE/CodeCompletion.h"
#include "swift/IDE/Utils.h"
#include "swift/Basic/Cache.h"
#include "swift/Basic/Fallthrough.h"
#include "swift/Basic/ThreadSafeRefCounted.h"
@@ -2223,12 +2224,8 @@ static bool isDynamicLookup(Type T) {
}
static bool isClangSubModule(Module *TheModule) {
auto Files = TheModule->getFiles();
assert(!Files.empty());
if (auto CMU = dyn_cast<ClangModuleUnit>(Files.front())) {
if (auto ClangMod = CMU->getClangModule())
return ClangMod->isSubModule();
}
if (auto ClangMod = ide::findUnderlyingClangModule(TheModule))
return ClangMod->isSubModule();
return false;
}