-
Notifications
You must be signed in to change notification settings - Fork 86
Attributes
Aman Priyadarshi edited this page Dec 23, 2016
·
5 revisions
- To Emit Assembly Stubs in Method
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] public class NoExceptionAttribute : Attribute { public NoExceptionAttribute() { ... } }
It forces compiler to disable Exception check
- After calling a function, Compiler checks if
ECX
is NULL or not. NoException Attribute disables this feature- It is useful for non-Atomixilc build code. like C-Library and other stuffs.
- It is recommended to Add NoException Attribute where ever Assembly(false) is used.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class LabelAttribute : Attribute { public readonly string RefLabel; public LabelAttribute(string label) { ... } }
- Assign an identifier to the Method function
- It does not change symbol name.
- Resolved internally by Compiler.
- Usage
[Label("Hello")] internal static void Test() { ... } // somewhere in assembly stub new Call { DestinationRef = "Hello", IsLabel = true };
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class LabelAttribute : Attribute { public readonly string RefLabel; public LabelAttribute(string label) { ... } }
- To manipulate generated symbol name
- Basically It changes global symbol name for given method function.
- Example
- C# Code (without plug attribute)
internal static void Test() { ... }
- Output
System_Void_Test__: ; ...
- C# Code (with plug attribute)
[Plug("Hello")] internal static void Test() { ... }
- Output
Hello: ; ...