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

Method preprocess_

src/SourceCompile/CompileSourceFile.cpp:216–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216bool CompileSourceFile::preprocess_() {
217 PreprocessFile::SpecialInstructions instructions(
218 PreprocessFile::SpecialInstructions::DontMute,
219 PreprocessFile::SpecialInstructions::DontMark,
220 m_commandLineParser->filterFileLine()
221 ? PreprocessFile::SpecialInstructions::Filter
222 : PreprocessFile::SpecialInstructions::DontFilter,
223 PreprocessFile::SpecialInstructions::CheckLoop,
224 PreprocessFile::SpecialInstructions::ComplainUndefinedMacro);
225 if (m_text.empty()) {
226 m_pp = new PreprocessFile(m_fileId, this, instructions, m_compilationUnit,
227 m_library);
228 } else {
229 m_pp = new PreprocessFile(BadSymbolId, this, instructions,
230 m_compilationUnit, m_library,
231 /* includer */ nullptr, /* includerLine */ 0,
232 m_text, nullptr, 0, BadPathId);
233 }
234 registerPP(m_pp);
235
236 if (!m_pp->preprocess()) {
237 return false;
238 }
239 bool fatalErrors = m_errors->hasFatalErrors();
240 if (fatalErrors) {
241 return false;
242 }
243
244 if (m_commandLineParser->getDebugIncludeFileInfo())
245 std::cerr << m_pp->reportIncludeInfo();
246
247 Precompiled* prec = Precompiled::getSingleton();
248 if ((!m_commandLineParser->createCache()) &&
249 prec->isFilePrecompiled(m_fileId, getSymbolTable()))
250 return true;
251
252 m_pp->saveCache();
253 return true;
254}
255
256bool CompileSourceFile::postPreprocess_() {
257 FileSystem* const fileSystem = FileSystem::getInstance();

Callers

nothing calls this directly

Calls 8

filterFileLineMethod · 0.80
hasFatalErrorsMethod · 0.80
reportIncludeInfoMethod · 0.80
createCacheMethod · 0.80
isFilePrecompiledMethod · 0.80
saveCacheMethod · 0.80
preprocessMethod · 0.45

Tested by

no test coverage detected