summaryrefslogblamecommitdiff
path: root/scripts/orc_hash.sh
blob: 466611aa0053f82d10f11da87f73bc5284948995 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                    
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) Meta Platforms, Inc. and affiliates.

set -e

printf '%s' '#define ORC_HASH '

awk '
/^#define ORC_(REG|TYPE)_/ { print }
/^struct orc_entry {$/ { p=1 }
p { print }
/^}/ { p=0 }' |
	sha1sum |
	cut -d " " -f 1 |
	sed 's/\([0-9a-f]\{2\}\)/0x\1,/g'