Skip to content

Commit

Permalink
Make base type of PASS enum ubyte (#13215)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkorpel authored Oct 25, 2021
1 parent 684952d commit 6a913ba
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/dmd/dsymbol.d
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ struct Visibility
}
}

enum PASS : int
enum PASS : ubyte
{
init, // initial state
semantic, // semantic() started
Expand Down
16 changes: 15 additions & 1 deletion src/dmd/dsymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,21 @@ struct Visibility

/* State of symbol in winding its way through the passes of the compiler
*/
enum PASS
enum class PASS : uint8_t
{
init, // initial state
semantic, // semantic() started
semanticdone, // semantic() done
semantic2, // semantic2() started
semantic2done, // semantic2() done
semantic3, // semantic3() started
semantic3done, // semantic3() done
inline_, // inline started
inlinedone, // inline done
obj // toObjFile() run
};

enum
{
PASSinit, // initial state
PASSsemantic, // semantic() started
Expand Down
24 changes: 12 additions & 12 deletions src/dmd/frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -918,18 +918,18 @@ struct Loc final
}
};

enum class PASS
{
init = 0,
semantic = 1,
semanticdone = 2,
semantic2 = 3,
semantic2done = 4,
semantic3 = 5,
semantic3done = 6,
inline_ = 7,
inlinedone = 8,
obj = 9,
enum class PASS : uint8_t
{
init = 0u,
semantic = 1u,
semanticdone = 2u,
semantic2 = 3u,
semantic2done = 4u,
semantic3 = 5u,
semantic3done = 6u,
inline_ = 7u,
inlinedone = 8u,
obj = 9u,
};

struct Ungag final
Expand Down

0 comments on commit 6a913ba

Please sign in to comment.