Mass rename Ebb and relatives to Block (#1365)

* Manually rename BasicBlock to BlockPredecessor

BasicBlock is a pair of (Ebb, Inst) that is used to represent the
basic block subcomponent of an Ebb that is a predecessor to an Ebb.

Eventually we will be able to remove this struct, but for now it
makes sense to give it a non-conflicting name so that we can start
to transition Ebb to represent a basic block.

I have not updated any comments that refer to BasicBlock, as
eventually we will remove BlockPredecessor and replace with Block,
which is a basic block, so the comments will become correct.

* Manually rename SSABuilder block types to avoid conflict

SSABuilder has its own Block and BlockData types. These along with
associated identifier will cause conflicts in a later commit, so
they are renamed to be more verbose here.

* Automatically rename 'Ebb' to 'Block' in *.rs

* Automatically rename 'EBB' to 'block' in *.rs

* Automatically rename 'ebb' to 'block' in *.rs

* Automatically rename 'extended basic block' to 'basic block' in *.rs

* Automatically rename 'an basic block' to 'a basic block' in *.rs

* Manually update comment for `Block`

`Block`'s wikipedia article required an update.

* Automatically rename 'an `Block`' to 'a `Block`' in *.rs

* Automatically rename 'extended_basic_block' to 'basic_block' in *.rs

* Automatically rename 'ebb' to 'block' in *.clif

* Manually rename clif constant that contains 'ebb' as substring to avoid conflict

* Automatically rename filecheck uses of 'EBB' to 'BB'

'regex: EBB' -> 'regex: BB'
'$EBB' -> '$BB'

* Automatically rename 'EBB' 'Ebb' to 'block' in *.clif

* Automatically rename 'an block' to 'a block' in *.clif

* Fix broken testcase when function name length increases

Test function names are limited to 16 characters. This causes
the new longer name to be truncated and fail a filecheck test. An
outdated comment was also fixed.
This commit is contained in:
Ryan Hunt
2020-02-07 10:46:47 -06:00
committed by GitHub
parent a136d1cb00
commit 832666c45e
370 changed files with 8090 additions and 7988 deletions

View File

@@ -2,7 +2,7 @@
use crate::error::Location;
use cranelift_codegen::ir::types;
use cranelift_codegen::ir::{Ebb, Value};
use cranelift_codegen::ir::{Block, Value};
#[allow(unused_imports, deprecated)]
use std::ascii::AsciiExt;
use std::str::CharIndices;
@@ -33,7 +33,7 @@ pub enum Token<'a> {
Integer(&'a str), // Integer immediate
Type(types::Type), // i32, f32, b32x4, ...
Value(Value), // v12, v7
Ebb(Ebb), // ebb3
Block(Block), // block3
StackSlot(u32), // ss3
GlobalValue(u32), // gv3
Heap(u32), // heap2
@@ -318,7 +318,7 @@ impl<'a> Lexer<'a> {
}
let text = &self.source[begin..self.pos];
// Look for numbered well-known entities like ebb15, v45, ...
// Look for numbered well-known entities like block15, v45, ...
token(
split_entity_name(text)
.and_then(|(prefix, number)| {
@@ -339,7 +339,7 @@ impl<'a> Lexer<'a> {
fn numbered_entity(prefix: &str, number: u32) -> Option<Token<'a>> {
match prefix {
"v" => Value::with_number(number).map(Token::Value),
"ebb" => Ebb::with_number(number).map(Token::Ebb),
"block" => Block::with_number(number).map(Token::Block),
"ss" => Some(Token::StackSlot(number)),
"gv" => Some(Token::GlobalValue(number)),
"heap" => Some(Token::Heap(number)),
@@ -519,7 +519,7 @@ mod tests {
use super::*;
use crate::error::Location;
use cranelift_codegen::ir::types;
use cranelift_codegen::ir::{Ebb, Value};
use cranelift_codegen::ir::{Block, Value};
#[test]
fn digits() {
@@ -616,7 +616,7 @@ mod tests {
#[test]
fn lex_identifiers() {
let mut lex = Lexer::new(
"v0 v00 vx01 ebb1234567890 ebb5234567890 v1x vx1 vxvx4 \
"v0 v00 vx01 block1234567890 block5234567890 v1x vx1 vxvx4 \
function0 function b1 i32x4 f32x5 \
iflags fflags iflagss",
);
@@ -628,9 +628,9 @@ mod tests {
assert_eq!(lex.next(), token(Token::Identifier("vx01"), 1));
assert_eq!(
lex.next(),
token(Token::Ebb(Ebb::with_number(1234567890).unwrap()), 1)
token(Token::Block(Block::with_number(1234567890).unwrap()), 1)
);
assert_eq!(lex.next(), token(Token::Identifier("ebb5234567890"), 1));
assert_eq!(lex.next(), token(Token::Identifier("block5234567890"), 1));
assert_eq!(lex.next(), token(Token::Identifier("v1x"), 1));
assert_eq!(lex.next(), token(Token::Identifier("vx1"), 1));
assert_eq!(lex.next(), token(Token::Identifier("vxvx4"), 1));
@@ -656,7 +656,7 @@ mod tests {
#[test]
fn lex_names() {
let mut lex = Lexer::new("%0 %x3 %function %123_abc %ss0 %v3 %ebb11 %_");
let mut lex = Lexer::new("%0 %x3 %function %123_abc %ss0 %v3 %block11 %_");
assert_eq!(lex.next(), token(Token::Name("0"), 1));
assert_eq!(lex.next(), token(Token::Name("x3"), 1));
@@ -664,7 +664,7 @@ mod tests {
assert_eq!(lex.next(), token(Token::Name("123_abc"), 1));
assert_eq!(lex.next(), token(Token::Name("ss0"), 1));
assert_eq!(lex.next(), token(Token::Name("v3"), 1));
assert_eq!(lex.next(), token(Token::Name("ebb11"), 1));
assert_eq!(lex.next(), token(Token::Name("block11"), 1));
assert_eq!(lex.next(), token(Token::Name("_"), 1));
}