Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: refactor access to Val values to use node methods #27212
For accessing e.g the string value of a node n that is a string literal the cmd/compile code base (walk.go, typecheck.go...) often uses
Some types such as CTBOOL and CTINT already have node methods (
We can abstract away how values are represented with node methods and use these outside
This should make the compiler code more readable, maintainable and help efforts to easier replace how the compiler stores and handles constants e.g. #4617.
Instead of methods on the level of node they could be methods on the level of Val.