49 lines
1.0 KiB
C++
49 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "Support/Struct.h"
|
|
#include "Support/Error.h"
|
|
|
|
namespace clice {
|
|
|
|
class ASTInfo;
|
|
|
|
struct CompilationParams;
|
|
|
|
struct ModuleInfo {
|
|
/// Whether this module is an interface unit.
|
|
/// i.e. has export module declaration.
|
|
bool isInterfaceUnit = false;
|
|
|
|
/// Module name.
|
|
std::string name;
|
|
|
|
/// Dependent modules of this module.
|
|
std::vector<std::string> mods;
|
|
};
|
|
|
|
inherited_struct(PCMInfo, ModuleInfo) {
|
|
/// PCM file path.
|
|
std::string path;
|
|
|
|
/// Source file path.
|
|
std::string srcPath;
|
|
|
|
/// Files involved in building this PCM(not include module).
|
|
std::vector<std::string> deps;
|
|
};
|
|
|
|
/// If input file is module interface unit, return its module name.
|
|
/// Otherwise, return an empty string.
|
|
std::string scanModuleName(CompilationParams& params);
|
|
|
|
/// Run the preprocessor to scan the given module unit to
|
|
/// collect its module name and dependencies.
|
|
llvm::Expected<ModuleInfo> scanModule(CompilationParams& params);
|
|
|
|
|
|
|
|
} // namespace clice
|