Add syntax for cold blocks to CLIF.
This commit adds support for denoting cold blocks in the CLIF text
format as follows:
```plain
function %f() {
block0(...):
...
block1 cold:
...
block2(...) cold:
...
block3:
...
```
With this syntax, we are able to see the cold-block flag in CLIF, we can
write tests using it, and it is preserved when round-tripping.
Fixes #3701.
This commit is contained in:
@@ -34,6 +34,7 @@ pub enum Token<'a> {
|
||||
Type(types::Type), // i32, f32, b32x4, ...
|
||||
Value(Value), // v12, v7
|
||||
Block(Block), // block3
|
||||
Cold, // cold (flag on block)
|
||||
StackSlot(u32), // ss3
|
||||
GlobalValue(u32), // gv3
|
||||
Heap(u32), // heap2
|
||||
@@ -326,6 +327,7 @@ impl<'a> Lexer<'a> {
|
||||
.unwrap_or_else(|| match text {
|
||||
"iflags" => Token::Type(types::IFLAGS),
|
||||
"fflags" => Token::Type(types::FFLAGS),
|
||||
"cold" => Token::Cold,
|
||||
_ => Token::Identifier(text),
|
||||
}),
|
||||
loc,
|
||||
|
||||
Reference in New Issue
Block a user