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

Method getPreProcessedFileContent

src/SourceCompile/PreprocessFile.cpp:1246–1269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1244}
1245
1246std::string PreprocessFile::getPreProcessedFileContent() {
1247 FileSystem* const fileSystem = FileSystem::getInstance();
1248 // If File is empty (Only CR) return an empty string
1249 bool nonEmpty = false;
1250 uint32_t pp_result_size = m_result.size();
1251 for (uint32_t i = 0; i < pp_result_size; i++) {
1252 if ((m_result[i] != '\n') && (m_result[i] != ' ')) {
1253 nonEmpty = true;
1254 break;
1255 }
1256 }
1257 if (!nonEmpty) m_result.clear();
1258 if (m_debugPPResult) {
1259 std::string objName =
1260 m_macroBody.empty()
1261 ? std::string("file ").append(fileSystem->toPath(m_fileId))
1262 : std::string("macro ").append(m_macroBody);
1263 std::cout << "PP RESULT for " << objName
1264 << " : \nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n"
1265 << m_result << "\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
1266 << std::endl;
1267 }
1268 return m_result;
1269}
1270
1271PreprocessFile::IfElseStack& PreprocessFile::getStack() {
1272 PreprocessFile* tmp = this;

Callers 6

saveMethod · 0.80
postPreprocess_Method · 0.80
preprocessMethod · 0.80
evaluateMacroInstanceMethod · 0.80
evaluateMacro_Method · 0.80

Calls 3

clearMethod · 0.80
toPathMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected