Skip to content

Commit

Permalink
Fix global timer start
Browse files Browse the repository at this point in the history
  • Loading branch information
marcauberer committed Dec 9, 2023
1 parent 91fde2d commit 3e71017
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/SourceFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ SourceFile::SourceFile(GlobalResourceManager &resourceManager, SourceFile *paren
objectFilePath = resourceManager.cliOptions.outputDir / filePath.filename();
objectFilePath.replace_extension("o");

if (mainFile)
resourceManager.totalTimer.start();

// Deduce fileName and fileDir
fileName = std::filesystem::path(filePath).filename().string();
fileDir = std::filesystem::path(filePath).parent_path().string();
}

void SourceFile::runLexer() {
if (mainFile)
resourceManager.totalTimer.start();

// Check if this stage has already been done
if (previousStage >= LEXER)
return;
Expand Down Expand Up @@ -283,12 +283,6 @@ void SourceFile::runTypeCheckerPost() { // NOLINT(misc-no-recursion)
// Then type-check all dependencies
for (const auto &[importName, sourceFile] : dependencies)
sourceFile->runTypeCheckerPost();

// GCOV_EXCL_START
if (typeCheckerRuns >= 500 || totalTypeCheckerRuns >= 1000)
throw CompilerError(TYPE_CHECKER_RUNS_EXCEEDED, "Number of type checker runs for source file " + name +
" exceeded. Please report this as a bug on GitHub.");
// GCOV_EXCL_STOP
} while (typeChecker.reVisitRequested);

checkForSoftErrors();
Expand Down

0 comments on commit 3e71017

Please sign in to comment.