xref: /third_party/node/deps/v8/tools/find-builtin
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/deps/v8/tools/
11cb0ef41Sopenharmony_ci#!/bin/bash
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciset -euo pipefail
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ciBUILTIN_NAME="$1"
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciif ! which rg >/dev/null ; then
81cb0ef41Sopenharmony_ci    echo >&2 "This tool requires 'rg', install it with 'sudo apt install ripgrep'"
91cb0ef41Sopenharmony_ci    exit 1
101cb0ef41Sopenharmony_cifi
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ciTOOLS_DIRNAME="$(dirname "$0")"
131cb0ef41Sopenharmony_ciV8_DIRNAME="$(dirname "$TOOLS_DIRNAME")"
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ciif rg --type-add 'tq:*.tq' --type tq --with-filename --line-number "\bbuiltin $BUILTIN_NAME\b" "$V8_DIRNAME" | rg -v '\bextern builtin\b' | cut -f1-2 -d: ; then
161cb0ef41Sopenharmony_ci    exit 0
171cb0ef41Sopenharmony_cifi
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_ciif rg --type cpp --with-filename --line-number "\b(TF_BUILTIN\(|::Generate_?)$BUILTIN_NAME\b" "$V8_DIRNAME" | cut -f1-2 -d: ; then
201cb0ef41Sopenharmony_ci    exit 0
211cb0ef41Sopenharmony_cifi
221cb0ef41Sopenharmony_ci
231cb0ef41Sopenharmony_ciecho >&2 "Builtin '$BUILTIN_NAME' not found"
241cb0ef41Sopenharmony_ciexit 1

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