You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement Phase 1: Add 'custom' keyword and basic parsing support
This commit implements the core infrastructure for customizable functions:
Keyword and Language Support:
- Added 'custom' keyword to TokenKinds.def with KEYCUSTOMFN flag
- Added CustomizableFunctions language option to LangOptions.def
- Keyword is enabled with -fcustomizable-functions flag
Parser Support:
- Extended DeclSpec with FS_custom_specified flag and FS_customLoc
- Added setFunctionSpecCustom() method to DeclSpec
- Modified ParseDeclarationSpecifiers() to recognize tok::kw_custom
- Parser sets custom flag when 'custom' keyword is encountered
AST Support:
- Added IsCustomFunction bitfield to FunctionDeclBitfields in DeclBase.h
- Added isCustomFunction() and setCustomFunction() accessors to FunctionDecl
- Updated NumFunctionDeclBits from 32 to 33 bits
- Semantic analysis in ActOnFunctionDeclarator sets flag from DeclSpec
Testing:
- Added basic parser test in cxx-customizable-functions-basic.cpp
- Test verifies keyword recognition and feature flag requirement
At this point, the compiler can successfully parse:
custom void foo() { }
The keyword is recognized and the AST is properly annotated. No code
generation or transformation is implemented yet (Phase 2).
0 commit comments