Commit c74e9596 authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

[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: 's avatarClemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68450}
parent 7a52c4e2
...@@ -16,6 +16,7 @@ group("v8_run_gcmole") { ...@@ -16,6 +16,7 @@ group("v8_run_gcmole") {
"parallel.py", "parallel.py",
"run-gcmole.py", "run-gcmole.py",
"suspects.whitelist", "suspects.whitelist",
"ignored_files",
"test-expectations.txt", "test-expectations.txt",
# The following contains all relevant source and build files. # The following contains all relevant source and build files.
...@@ -37,9 +38,7 @@ group("v8_run_gcmole") { ...@@ -37,9 +38,7 @@ group("v8_run_gcmole") {
"$target_gen_dir/../../torque-generated/", "$target_gen_dir/../../torque-generated/",
] ]
deps = [ deps = [ "../../:run_torque" ]
"../../:run_torque",
]
if (v8_gcmole) { if (v8_gcmole) {
# This assumes gcmole tools have been fetched by a hook # This assumes gcmole tools have been fetched by a hook
......
...@@ -1519,7 +1519,29 @@ class ProblemsFinder : public clang::ASTConsumer, ...@@ -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) { virtual void HandleTranslationUnit(clang::ASTContext &ctx) {
if (TranslationUnitIgnored()) {
return;
}
Resolver r(ctx); Resolver r(ctx);
// It is a valid situation that no_gc_decl == NULL when the // It is a valid situation that no_gc_decl == NULL when the
...@@ -1596,6 +1618,9 @@ class ProblemsFinder : public clang::ASTConsumer, ...@@ -1596,6 +1618,9 @@ class ProblemsFinder : public clang::ASTConsumer,
clang::DiagnosticsEngine& d_; clang::DiagnosticsEngine& d_;
clang::SourceManager& sm_; clang::SourceManager& sm_;
bool ignored_files_loaded_ = false;
std::set<std::string> ignored_files_;
FunctionAnalyzer* function_analyzer_; FunctionAnalyzer* function_analyzer_;
}; };
......
src/profiler/heap-snapshot-generator.cc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment