Add restrict specifier support for C

This commit is contained in:
2024-12-16 20:53:49 -05:00
parent 28aa2c4dec
commit 46e816d7ce
7 changed files with 38 additions and 11 deletions

View File

@@ -23,6 +23,7 @@ enum Specifier : u32
Spec_Ptr,
Spec_Ref,
Spec_Register,
Spec_Restrict,
Spec_RValue,
Spec_Static,
Spec_Thread_Local,
@@ -56,6 +57,7 @@ inline Str spec_to_str( Specifier type )
{ "*", sizeof( "*" ) - 1 },
{ "&", sizeof( "&" ) - 1 },
{ "register", sizeof( "register" ) - 1 },
{ "restrict", sizeof( "restrict" ) - 1 },
{ "&&", sizeof( "&&" ) - 1 },
{ "static", sizeof( "static" ) - 1 },
{ "thread_local", sizeof( "thread_local" ) - 1 },

View File

@@ -83,6 +83,7 @@ enum TokType : u32
Tok_Spec_Mutable,
Tok_Spec_NeverInline,
Tok_Spec_Override,
Tok_Spec_Restrict,
Tok_Spec_Static,
Tok_Spec_ThreadLocal,
Tok_Spec_Volatile,
@@ -188,6 +189,7 @@ inline Str toktype_to_str( TokType type )
{ "mutable", sizeof( "mutable" ) - 1 },
{ "neverinline", sizeof( "neverinline" ) - 1 },
{ "override", sizeof( "override" ) - 1 },
{ "restrict", sizeof( "restrict" ) - 1 },
{ "static", sizeof( "static" ) - 1 },
{ "thread_local", sizeof( "thread_local" ) - 1 },
{ "volatile", sizeof( "volatile" ) - 1 },