Revert "[cxxmodules] Use common-rooted valid source location."

This reverts commit 03febcbd899610de1188886a132fe78c804d3a00.

This commit broke the modules bots. Investigating...
This commit is contained in:
Vassil Vassilev 2019-09-04 16:04:53 +03:00 committed by SFT
parent b47bbaf546
commit 1a53d8241d

View File

@ -840,10 +840,18 @@ namespace cling {
if (getSema().isModuleVisible(M))
return true;
Interpreter::PushTransactionRAII RAII(this);
if (declare("#pragma clang module import " + M->Name) == kSuccess)
return true;
Preprocessor& PP = getCI()->getPreprocessor();
IdentifierInfo *II = PP.getIdentifierInfo(M->Name);
SourceLocation ValidLoc = M->DefinitionLoc;
Interpreter::PushTransactionRAII RAII(this);
bool success = !getCI()->getSema().ActOnModuleImport(ValidLoc, ValidLoc,
std::make_pair(II, ValidLoc)).isInvalid();
if (success) {
// Also make the module visible in the preprocessor to export its macros.
PP.makeModuleVisible(M, ValidLoc);
return success;
}
if (complain) {
if (M->IsSystem)
llvm::errs() << "Failed to load module " << M->Name << "\n";