Improve compiling (#140)
This commit is contained in:
@@ -13,12 +13,16 @@ std::string scanModuleName(CompilationParams& params) {
|
||||
langOpts.Modules = true;
|
||||
langOpts.CPlusPlus20 = true;
|
||||
|
||||
/// FIXME: Figure out main file from command line.
|
||||
assert(params.buffers.size() == 1);
|
||||
auto content = params.buffers.begin()->second->getBuffer();
|
||||
|
||||
/// We use raw mode of lexer to avoid the preprocessor.
|
||||
clang::Lexer lexer(clang::SourceLocation(),
|
||||
langOpts,
|
||||
params.content.begin(),
|
||||
params.content.begin(),
|
||||
params.content.end());
|
||||
content.begin(),
|
||||
content.begin(),
|
||||
content.end());
|
||||
|
||||
/// Whether we are in a condition directive.
|
||||
bool isInDirective = false;
|
||||
@@ -104,7 +108,7 @@ std::expected<ModuleInfo, std::string> scanModule(CompilationParams& params) {
|
||||
return std::unexpected(unit.error());
|
||||
}
|
||||
|
||||
for(auto& import: unit->directives()[unit->getInterestedFile()].imports) {
|
||||
for(auto& import: unit->directives()[unit->interested_file()].imports) {
|
||||
info.mods.emplace_back(import.name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user