Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[cxxmodules] Add prebuilt module paths.
  • Loading branch information
vgvassilev committed Mar 21, 2018
commit 3ed20f24aa55cbd61290ee59746e44faa81ccd8e
19 changes: 14 additions & 5 deletions core/metacling/src/TCling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ clang/LLVM technology.
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Program.h"

#include <algorithm>
#include <iostream>
Expand Down Expand Up @@ -1268,11 +1269,19 @@ TCling::TCling(const char *name, const char *title)
fMetaProcessor = new cling::MetaProcessor(*fInterpreter, fMPOuts);

if (fInterpreter->getCI()->getLangOpts().Modules) {
HeaderSearch& hdrSearch = fInterpreter->getCI()->getPreprocessor().getHeaderSearchInfo();
hdrSearch.loadTopLevelSystemModules();
loadModulePath(hdrSearch, gSystem->GetDynamicPath());
fInterpreter->getCI()->getHeaderSearchOpts().AddPrebuiltModulePath(".");

// HeaderSearch& hdrSearch = fInterpreter->getCI()->getPreprocessor().getHeaderSearchInfo();
// hdrSearch.loadTopLevelSystemModules();
// loadModulePath(hdrSearch, gSystem->GetDynamicPath());
// fInterpreter->getCI()->getHeaderSearchOpts().AddPrebuiltModulePath(".");

auto &HdrSearchOpts = fInterpreter->getCI()->getHeaderSearchOpts();
llvm::StringRef DynPath = gSystem->GetDynamicPath();
while (!DynPath.empty()) {
std::pair<StringRef, StringRef> Split = DynPath.split(llvm::sys::EnvPathSeparator);
HdrSearchOpts.AddPrebuiltModulePath(Split.first);
DynPath = Split.second;
}
HdrSearchOpts.AddPrebuiltModulePath(".");
// Setup core C++ modules if we have any to setup.

// Load libc and stl first.
Expand Down