check-unused-symbols.sh 662 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. # Copyright 2018 the V8 project authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
  6. symbols=$(
  7. grep \
  8. --only-matching \
  9. --perl-regexp 'V\(_, \K([^,\)]*)' \
  10. -- "$v8_root/src/heap-symbols.h")
  11. # Find symbols which appear exactly once (in heap-symbols.h)
  12. grep \
  13. --only-matching \
  14. --no-filename \
  15. --recursive \
  16. --fixed-strings "$symbols" \
  17. -- "$v8_root/src" "$v8_root/test/cctest" \
  18. | sort \
  19. | uniq -u \
  20. | sed -e 's/.*/Heap symbol "&" seems to be unused./'
  21. echo "Kthxbye."