xref: /third_party/node/deps/v8/tools/check-unused-symbols.sh
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/deps/v8/tools/
11cb0ef41Sopenharmony_ci#!/bin/bash
21cb0ef41Sopenharmony_ci# Copyright 2018 the V8 project authors. All rights reserved.
31cb0ef41Sopenharmony_ci# Use of this source code is governed by a BSD-style license that can be
41cb0ef41Sopenharmony_ci# found in the LICENSE file.
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_civ8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
71cb0ef41Sopenharmony_cisymbols=$(
81cb0ef41Sopenharmony_ci    grep \
91cb0ef41Sopenharmony_ci        --only-matching \
101cb0ef41Sopenharmony_ci        --perl-regexp 'V\(_, \K([^,\)]*)' \
111cb0ef41Sopenharmony_ci        -- "$v8_root/src/heap-symbols.h")
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ci# Find symbols which appear exactly once (in heap-symbols.h)
141cb0ef41Sopenharmony_cigrep \
151cb0ef41Sopenharmony_ci    --only-matching \
161cb0ef41Sopenharmony_ci    --no-filename \
171cb0ef41Sopenharmony_ci    --recursive \
181cb0ef41Sopenharmony_ci    --fixed-strings "$symbols" \
191cb0ef41Sopenharmony_ci    -- "$v8_root/src" "$v8_root/test/cctest" \
201cb0ef41Sopenharmony_ci| sort \
211cb0ef41Sopenharmony_ci| uniq -u \
221cb0ef41Sopenharmony_ci| sed -e 's/.*/Heap symbol "&" seems to be unused./'
231cb0ef41Sopenharmony_ci
241cb0ef41Sopenharmony_ciecho "Kthxbye."
25

Indexes created Thu Nov 07 10:32:03 CST 2024