GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc

Rename value_range::set_type for Clarity

Renamed `value_range::set_type` to `value_range::set_range_class` to better reflect its purpose.

This commit renames the value_range::set_type method to value_range::set_range_class to improve code clarity. The method does not set the underlying type of the value_range object, but rather selects an appropriate subclass for the given type. The renaming avoids confusion and makes the code easier to understand.

In Details

This is a pure refactoring commit, renaming value_range::set_type to value_range::set_range_class across multiple files (data-streamer-in.cc, gimple-range-gori.cc, ipa-cp.cc, ipa-fnsummary.cc, ipa-prop.cc, range-op.h, value-range.h, svalue.cc). The change clarifies that the method selects a vrange subclass rather than setting the underlying type. No functional changes are intended.

For Context

In GCC, a value range represents the possible values that a variable or expression can hold. The value_range class helps the compiler reason about these ranges and perform optimizations. This commit improves the clarity of the code by renaming a method to better reflect its function. This kind of change makes the compiler's code easier to understand and maintain, which can lead to fewer bugs and better performance in the long run.

Filed Under: refactorcode clarity