diff options
author | Björn Gustavsson <[email protected]> | 2017-11-03 10:13:56 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-11-06 08:08:09 +0100 |
commit | fe35a4f6a26a1242fef0b7d728403d162812679c (patch) | |
tree | dadfc9828b6f6974ae74353898601a211f513f88 /erts/emulator/utils/beam_makeops | |
parent | 6b5efa639ae8723745f860b793e74910c8d6798b (diff) | |
download | otp-fe35a4f6a26a1242fef0b7d728403d162812679c.tar.gz otp-fe35a4f6a26a1242fef0b7d728403d162812679c.tar.bz2 otp-fe35a4f6a26a1242fef0b7d728403d162812679c.zip |
Clean up definition of built-in macros
Make it easier to define new macros.
Diffstat (limited to 'erts/emulator/utils/beam_makeops')
-rwxr-xr-x | erts/emulator/utils/beam_makeops | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index 02227bbdfd..296fbc9d5f 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -306,9 +306,14 @@ if ($wordsize == 64) { # Add placeholders for built-in macros. # -$c_code{'IS_PACKED'} = ['$Expr',"built-in macro",('Expr')]; -$c_code{'ARG_POSITION'} = ['$Expr',"built-in macro",('Expr')]; -foreach my $name (keys %c_code) { +my %predef_macros = + (IS_PACKED => ['Expr'], + ARG_POSITION => ['Expr'], + ); +foreach my $name (keys %predef_macros) { + my @args = @{$predef_macros{$name}}; + my $body = join(':', map { '$' . $_ } @args); + $c_code{$name} = [$body,"built-in macro",@args], $c_code_used{$name} = 1; } |