summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-09-15 01:21:15 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-09-15 01:21:15 +0000
commitd6509cf21dd017392f82da0eb9b0345fbfc8970b (patch)
tree2b3223d4aabe04fc1205a9e2158019bd3c87275b /clang/lib/Frontend/CompilerInstance.cpp
parent66f3dc031d7922cb87b115ce8e5ca38db67aadd2 (diff)
downloadbcm5719-llvm-d6509cf21dd017392f82da0eb9b0345fbfc8970b.tar.gz
bcm5719-llvm-d6509cf21dd017392f82da0eb9b0345fbfc8970b.zip
[modules] Frontend support for building a header module from a list of
headaer files. llvm-svn: 342304
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 38a09a0dac3..05ba3c0265a 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -911,6 +911,9 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
// taking it as an input instead of hard-coding llvm::errs.
raw_ostream &OS = llvm::errs();
+ if (!Act.PrepareToExecute(*this))
+ return false;
+
// Create the target instance.
setTarget(TargetInfo::CreateTargetInfo(getDiagnostics(),
getInvocation().TargetOpts));
@@ -1615,22 +1618,7 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
Module::NameVisibilityKind Visibility,
bool IsInclusionDirective) {
// Determine what file we're searching from.
- // FIXME: Should we be deciding whether this is a submodule (here and
- // below) based on -fmodules-ts or should we pass a flag and make the
- // caller decide?
- std::string ModuleName;
- if (getLangOpts().ModulesTS) {
- // FIXME: Same code as Sema::ActOnModuleDecl() so there is probably a
- // better place/way to do this.
- for (auto &Piece : Path) {
- if (!ModuleName.empty())
- ModuleName += ".";
- ModuleName += Piece.first->getName();
- }
- }
- else
- ModuleName = Path[0].first->getName();
-
+ StringRef ModuleName = Path[0].first->getName();
SourceLocation ModuleNameLoc = Path[0].second;
// If we've already handled this import, just return the cached result.
@@ -1859,7 +1847,7 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
// Verify that the rest of the module path actually corresponds to
// a submodule.
bool MapPrivateSubModToTopLevel = false;
- if (!getLangOpts().ModulesTS && Path.size() > 1) {
+ if (Path.size() > 1) {
for (unsigned I = 1, N = Path.size(); I != N; ++I) {
StringRef Name = Path[I].first->getName();
clang::Module *Sub = Module->findSubmodule(Name);
OpenPOWER on IntegriCloud