mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[TypeID] Use .def files to introduce TypeID specializations.
Simplify the static registration of types for use with TypeID by introducing a more declarative approach. Each zone provides a .def file listing the types and templates defined by that zone. The .def file is processed by include/swift/Basic/DefineTypeIDZone.h with its zone number, which assigns values to each of the types/templates and introduces the TypeID specializations.
This commit is contained in:
@@ -169,10 +169,11 @@ struct ExternallyCachedEvaluationRule :
|
||||
: EvaluationRule{expr} { }
|
||||
};
|
||||
|
||||
// Define the arithmetic evaluator's zone.
|
||||
namespace swift {
|
||||
SWIFT_TYPEID(UnitTests, UncachedEvaluationRule, 1);
|
||||
SWIFT_TYPEID(UnitTests, InternallyCachedEvaluationRule, 2);
|
||||
SWIFT_TYPEID(UnitTests, ExternallyCachedEvaluationRule, 3);
|
||||
#define SWIFT_TYPEID_ZONE 255
|
||||
#define SWIFT_TYPEID_HEADER "ArithmeticEvaluatorTypeIDZone.def"
|
||||
#include "swift/Basic/DefineTypeIDZone.h"
|
||||
}
|
||||
|
||||
TEST(ArithmeticEvaluator, Simple) {
|
||||
|
||||
Reference in New Issue
Block a user