-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for nautilus::val<T> and T is a enum class
- Loading branch information
1 parent
c0dd0ad
commit 5720d19
Showing
17 changed files
with
137 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
B0($1:ui8) | ||
CALL $2 nautilus::enumClassFunction(nautilus::LogLevel)($1) :i32 | ||
RETURN $2 :i32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
B0($1:ui32) | ||
CALL $2 nautilus::enumFunction(nautilus::Color)($1) :i32 | ||
RETURN $2 :i32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
B0() | ||
CONST $1 0 :ui32 | ||
RETURN $1 :ui32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
B0($1:ui32) | ||
CONST $2 0 :ui32 | ||
EQ $3 $1 $2 :bool | ||
RETURN $3 :bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
B0($1:ui8) | ||
CONST $2 6 :ui8 | ||
EQ $3 $1 $2 :bool | ||
CONST $4 5 :ui8 | ||
EQ $5 $1 $4 :bool | ||
OR $6 $3 $5 :bool | ||
RETURN $6 :bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
B0($1:ui32) | ||
CONST $2 0 :ui32 | ||
EQ $3 $1 $2 :bool | ||
CMP $4 $3 B1() B2($1) :void | ||
B1() | ||
CONST $5 1 :i32 | ||
JMP $0 B5($5) :void | ||
B2($1:ui32) | ||
CONST $7 1 :ui32 | ||
EQ $8 $1 $7 :bool | ||
CMP $9 $8 B3() B4() :void | ||
B3() | ||
CONST $10 2 :i32 | ||
JMP $0 B5($10) :void | ||
B4() | ||
CONST $12 42 :i32 | ||
JMP $0 B5($12) :void | ||
B5($5:i32) | ||
RETURN $5 :i32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
NESIR { | ||
execute() { | ||
Block_0($1:ui8): | ||
$2 = nautilus::enumClassFunction(nautilus::LogLevel)($1) :i32 | ||
return ($2) :i32 | ||
} | ||
} //NESIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
NESIR { | ||
execute() { | ||
Block_0($1:ui32): | ||
$2 = nautilus::enumFunction(nautilus::Color)($1) :i32 | ||
return ($2) :i32 | ||
} | ||
} //NESIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
NESIR { | ||
execute() { | ||
Block_0(): | ||
$1 = 0 :ui32 | ||
return ($1) :ui32 | ||
} | ||
} //NESIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
NESIR { | ||
execute() { | ||
Block_0($1:ui32): | ||
$2 = 0 :ui32 | ||
$3 = $1 == $2 :bool | ||
return ($3) :bool | ||
} | ||
} //NESIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
NESIR { | ||
execute() { | ||
Block_0($1:ui8): | ||
$2 = 6 :ui8 | ||
$3 = $1 == $2 :bool | ||
$4 = 5 :ui8 | ||
$5 = $1 == $4 :bool | ||
$6 = $3 or $5 :bool | ||
return ($6) :bool | ||
} | ||
} //NESIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
NESIR { | ||
execute() { | ||
Block_0($1:ui32): | ||
$2 = 0 :ui32 | ||
$3 = $1 == $2 :bool | ||
if $3 ? Block_1() : Block_2($1) :void | ||
|
||
Block_1(): | ||
$5 = 1 :i32 | ||
br Block_5($5) :void | ||
|
||
Block_5($5:i32): | ||
return ($5) :i32 | ||
|
||
Block_2($1:ui32): | ||
$7 = 1 :ui32 | ||
$8 = $1 == $7 :bool | ||
if $8 ? Block_3() : Block_4() :void | ||
|
||
Block_3(): | ||
$10 = 2 :i32 | ||
br Block_5($10) :void | ||
|
||
Block_4(): | ||
$12 = 42 :i32 | ||
br Block_5($12) :void | ||
} | ||
} //NESIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
B0($1:ui8) | ||
CALL $2 nautilus::enumClassFunction(nautilus::LogLevel)($1) :i32 | ||
RETURN $2 :i32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
B0($1:ui32) | ||
CALL $2 nautilus::enumFunction(nautilus::Color)($1) :i32 | ||
RETURN $2 :i32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
B0() | ||
CONST $1 0 :ui32 | ||
RETURN $1 :ui32 |
20 changes: 4 additions & 16 deletions
20
nautilus/test/data/enum-tests/tracing/handleEnumLogLevel.trace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,7 @@ | ||
B0($1:ui8) | ||
CONST $2 6 :ui8 | ||
EQ $3 $1 $2 :bool | ||
CMP $4 $3 B1() B2() :void | ||
B1() | ||
CONST $5 true :bool | ||
RETURN $5 :bool | ||
B2() | ||
CONST $7 5 :ui8 | ||
EQ $8 $1 $7 :bool | ||
CMP $9 $8 B3() B4() :void | ||
B3() | ||
CONST $10 true :bool | ||
ASSIGN $5 $10 :bool | ||
RETURN $5 :bool | ||
B4() | ||
CONST $12 false :bool | ||
ASSIGN $5 $12 :bool | ||
RETURN $5 :bool | ||
CONST $4 5 :ui8 | ||
EQ $5 $1 $4 :bool | ||
OR $6 $3 $5 :bool | ||
RETURN $6 :bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
B0($1:ui32) | ||
CONST $2 0 :ui32 | ||
EQ $3 $1 $2 :bool | ||
CMP $4 $3 B1() B2() :void | ||
B1() | ||
CONST $5 1 :i32 | ||
RETURN $5 :i32 | ||
B2() | ||
CONST $7 1 :ui32 | ||
EQ $8 $1 $7 :bool | ||
CMP $9 $8 B3() B4() :void | ||
B3() | ||
CONST $10 2 :i32 | ||
RETURN $10 :i32 | ||
B4() | ||
CONST $12 42 :i32 | ||
RETURN $12 :i32 |