[gcmole] Add heap-snapshot-generator.cc to ignored_files

Bug: v8:9993
Change-Id: I06428edd7f01805d08927718e4711298c731d2e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2253844
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68450}
This commit is contained in:
Maya Lekova 2020-06-22 10:08:01 +02:00 committed by Commit Bot
parent 7a52c4e219
commit c74e9596ec
3 changed files with 28 additions and 3 deletions

View File

@ -16,6 +16,7 @@ group("v8_run_gcmole") {
"parallel.py",
"run-gcmole.py",
"suspects.whitelist",
"ignored_files",
"test-expectations.txt",
# The following contains all relevant source and build files.
@ -37,9 +38,7 @@ group("v8_run_gcmole") {
"$target_gen_dir/../../torque-generated/",
]
deps = [
"../../:run_torque",
]
deps = [ "../../:run_torque" ]
if (v8_gcmole) {
# This assumes gcmole tools have been fetched by a hook

View File

@ -1519,7 +1519,29 @@ class ProblemsFinder : public clang::ASTConsumer,
}
}
bool TranslationUnitIgnored() {
if (!ignored_files_loaded_) {
std::ifstream fin("tools/gcmole/ignored_files");
std::string s;
while (fin >> s) ignored_files_.insert(s);
ignored_files_loaded_ = true;
}
clang::FileID main_file_id = sm_.getMainFileID();
std::string filename = sm_.getFileEntryForID(main_file_id)->getName().str();
bool result = ignored_files_.find(filename) != ignored_files_.end();
if (result) {
llvm::outs() << "Ignoring file " << filename << "\n";
}
return result;
}
virtual void HandleTranslationUnit(clang::ASTContext &ctx) {
if (TranslationUnitIgnored()) {
return;
}
Resolver r(ctx);
// It is a valid situation that no_gc_decl == NULL when the
@ -1596,6 +1618,9 @@ class ProblemsFinder : public clang::ASTConsumer,
clang::DiagnosticsEngine& d_;
clang::SourceManager& sm_;
bool ignored_files_loaded_ = false;
std::set<std::string> ignored_files_;
FunctionAnalyzer* function_analyzer_;
};

View File

@ -0,0 +1 @@
src/profiler/heap-snapshot-generator.cc