summaryrefslogtreecommitdiff
path: root/src/cfg
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-11-15 10:02:27 -0800
committerGitHub <noreply@github.com>2022-11-15 18:02:27 +0000
commit59cbdd818dc3397a823a37e9821fd32f4522b2fc (patch)
tree58470bfc11591d2e70f1b79645061c1a23beb75d /src/cfg
parent236f12f7df64f10e1238bf2d66b1216f700b15df (diff)
downloadbinaryen-59cbdd818dc3397a823a37e9821fd32f4522b2fc.tar.gz
binaryen-59cbdd818dc3397a823a37e9821fd32f4522b2fc.tar.bz2
binaryen-59cbdd818dc3397a823a37e9821fd32f4522b2fc.zip
Switch from `typedef` to `using` in C++ code. NFC (#5258)
This is more modern and (IMHO) easier to read than that old C typedef syntax.
Diffstat (limited to 'src/cfg')
-rw-r--r--src/cfg/Relooper.cpp6
-rw-r--r--src/cfg/Relooper.h8
-rw-r--r--src/cfg/liveness-traversal.h2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/cfg/Relooper.cpp b/src/cfg/Relooper.cpp
index 1cdcbe2d0..80d1926c9 100644
--- a/src/cfg/Relooper.cpp
+++ b/src/cfg/Relooper.cpp
@@ -526,7 +526,7 @@ LoopShape* Relooper::AddLoopShape() {
namespace {
-typedef std::list<Block*> BlockList;
+using BlockList = std::list<Block*>;
struct RelooperRecursor {
Relooper* Parent;
@@ -554,7 +554,7 @@ struct Liveness : public RelooperRecursor {
}
};
-typedef std::pair<Branch*, Block*> BranchBlock;
+using BranchBlock = std::pair<Branch*, Block*>;
struct Optimizer : public RelooperRecursor {
Block* Entry;
@@ -1251,7 +1251,7 @@ void Relooper::Calculate(Block* Entry) {
void FindIndependentGroups(BlockSet& Entries,
BlockBlockSetMap& IndependentGroups,
BlockSet* Ignore = nullptr) {
- typedef std::map<Block*, Block*> BlockBlockMap;
+ using BlockBlockMap = std::map<Block*, Block*>;
struct HelperClass {
BlockBlockSetMap& IndependentGroups;
diff --git a/src/cfg/Relooper.h b/src/cfg/Relooper.h
index 37d262e7d..7fa23b279 100644
--- a/src/cfg/Relooper.h
+++ b/src/cfg/Relooper.h
@@ -124,8 +124,8 @@ struct Branch {
Render(RelooperBuilder& Builder, Block* Target, bool SetLabel);
};
-typedef wasm::InsertOrderedSet<Block*> BlockSet;
-typedef wasm::InsertOrderedMap<Block*, Branch*> BlockBranchMap;
+using BlockSet = wasm::InsertOrderedSet<Block*>;
+using BlockBranchMap = wasm::InsertOrderedMap<Block*, Branch*>;
// Represents a basic block of code - some instructions that end with a
// control flow modifier (a branch, return or throw).
@@ -241,7 +241,7 @@ struct SimpleShape : public Shape {
wasm::Expression* Render(RelooperBuilder& Builder, bool InLoop) override;
};
-typedef std::map<int, Shape*> IdShapeMap;
+using IdShapeMap = std::map<int, Shape*>;
struct MultipleShape : public Shape {
IdShapeMap InnerMap; // entry block ID -> shape
@@ -313,7 +313,7 @@ struct Relooper {
void SetMinSize(bool MinSize_) { MinSize = MinSize_; }
};
-typedef wasm::InsertOrderedMap<Block*, BlockSet> BlockBlockSetMap;
+using BlockBlockSetMap = wasm::InsertOrderedMap<Block*, BlockSet>;
#ifdef RELOOPER_DEBUG
struct Debugging {
diff --git a/src/cfg/liveness-traversal.h b/src/cfg/liveness-traversal.h
index 3193cbd1f..d9b310d6f 100644
--- a/src/cfg/liveness-traversal.h
+++ b/src/cfg/liveness-traversal.h
@@ -36,7 +36,7 @@ namespace wasm {
// may be a great many potential elements but actual sets
// may be fairly small. Specifically, we use a sorted
// vector.
-typedef SortedVector SetOfLocals;
+using SetOfLocals = SortedVector;
// A liveness-relevant action. Supports a get, a set, or an
// "other" which can be used for other purposes, to mark