MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / compile

Method compile

src/SourceCompile/Compiler.cpp:1030–1192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1028}
1029
1030bool Compiler::compile() {
1031 FileSystem* const fileSystem = FileSystem::getInstance();
1032 std::string profile;
1033 Timer tmr;
1034 Timer tmrTotal;
1035 // Scan the libraries definition
1036 if (!parseLibrariesDef_()) return false;
1037
1038 if (m_commandLineParser->profile()) {
1039 std::string msg = "Scan libraries took " +
1040 StringUtils::to_string(tmr.elapsed_rounded()) + "s\n";
1041 std::cout << msg << std::endl;
1042 profile += msg;
1043 tmr.reset();
1044 }
1045
1046 // Preprocess
1047 ppinit_();
1048 createMultiProcessPreProcessor_();
1049 if (!compileFileSet_(CompileSourceFile::Preprocess,
1050 m_commandLineParser->fileunit(), m_compilers)) {
1051 return false;
1052 }
1053 // Single thread post Preprocess
1054 if (!compileFileSet_(CompileSourceFile::PostPreprocess, false, m_compilers)) {
1055 return false;
1056 }
1057
1058 if (m_commandLineParser->profile()) {
1059 std::string msg = "Preprocessing took " +
1060 StringUtils::to_string(tmr.elapsed_rounded()) + "s\n";
1061 std::cout << msg << std::endl;
1062 for (const CompileSourceFile* compiler : m_compilers) {
1063 msg += compiler->getPreprocessor()->getProfileInfo();
1064 }
1065 std::cout << msg << std::endl;
1066 profile += msg;
1067 tmr.reset();
1068 }
1069
1070 // Parse
1071 bool parserInitialized = false;
1072 if (m_commandLineParser->parse() || m_commandLineParser->pythonListener() ||
1073 m_commandLineParser->pythonEvalScriptPerFile() ||
1074 m_commandLineParser->pythonEvalScript()) {
1075 parseinit_();
1076 createFileList_();
1077 createMultiProcessParser_();
1078 parserInitialized = true;
1079 if (!compileFileSet_(CompileSourceFile::Parse, true, m_compilers)) {
1080 return false; // Small files and large file chunks
1081 }
1082 if (!compileFileSet_(CompileSourceFile::Parse, true,
1083 m_compilersParentFiles)) {
1084 return false; // Recombine chunks
1085 }
1086 } else {
1087 createFileList_();

Callers 3

operator()Method · 0.45
compileOneFile_Method · 0.45
compileFileSet_Method · 0.45

Calls 15

profileMethod · 0.80
elapsed_roundedMethod · 0.80
resetMethod · 0.80
fileunitMethod · 0.80
getPreprocessorMethod · 0.80
pythonListenerMethod · 0.80
pythonEvalScriptMethod · 0.80
getParserMethod · 0.80
printMessagesMethod · 0.80
muteStdoutMethod · 0.80
toPathMethod · 0.80

Tested by

no test coverage detected