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
Copy file name to clipboardExpand all lines: joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/GlobalBuiltins.scala
+30-5Lines changed: 30 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ object GlobalBuiltins {
8
8
"print", // Prints values to standard output
9
9
"debugPrint", // Prints debug description of values
10
10
"dump", // Dumps detailed object structure information
11
+
"readLine", // Returns a string read from standard input through the end of the current line or until EOF is reached
11
12
12
13
// Type Conversion Functions
13
14
"String", // Converts a value to a string
@@ -19,6 +20,12 @@ object GlobalBuiltins {
19
20
"Dictionary", // Creates a dictionary from a sequence of key-value pairs
20
21
"Set", // Creates a set from a sequence
21
22
23
+
// Types and type casting
24
+
"type", // Returns the dynamic type of a value
25
+
"numericCast", // Returns the given integer as the equivalent value in a different integer type
26
+
"unsafeDowncast", // Returns the given instance cast unconditionally to the specified type
27
+
"unsafeBitCast", // Returns the bits of the given instance, interpreted as having the specified type
28
+
22
29
// Collection Functions
23
30
"min", // Returns the minimum element in a sequence
24
31
"max", // Returns the maximum element in a sequence
@@ -46,18 +53,20 @@ object GlobalBuiltins {
46
53
"ceil", // Returns the smallest integer not less than the given number
47
54
48
55
// Memory Management Functions
56
+
"extendLifetime", // Extends the lifetime of the given instance
57
+
"withExtendedLifetime", // Extends the lifetime of an object during the execution of a closure
58
+
"withoutActuallyEscaping", // Temporarily treats a non-escaping closure as an escaping one
49
59
"withUnsafePointer", // Invokes a closure with a pointer to a value
50
60
"withUnsafeMutablePointer", // Invokes a closure with a mutable pointer to a value
51
61
"withUnsafeBytes", // Invokes a closure with the bytes of a value
52
62
"withUnsafeMutableBytes", // Invokes a closure with mutable bytes of a value
53
-
"autoreleasepool", // Creates an autorelease pool and executes the given closure within it
63
+
"withUnsafeTemporaryAllocation", // Provides scoped access to a buffer pointer to memory of the specified type and with the specified capacity
64
+
"autoreleasepool", // Creates an autorelease pool and executes the given closure within it
54
65
55
66
// Runtime Functions
56
-
"type", // Returns the dynamic type of a value
57
67
"MemoryLayout.size", // Returns the size in bytes of the given value's type
58
68
"MemoryLayout.stride", // Returns the stride in bytes of the given value's type
59
69
"MemoryLayout.alignment", // Returns the alignment in bytes of the given value's type
60
-
"unsafeBitCast", // Reinterprets the bits of a value of one type as another type
61
70
62
71
// Error Handling Functions
63
72
"assert", // Checks a condition and stops execution if it's false (in debug builds)
@@ -66,9 +75,25 @@ object GlobalBuiltins {
66
75
"preconditionFailure", // Indicates that a precondition has failed (in all builds)
67
76
"fatalError", // Unconditionally prints a message and stops execution
68
77
78
+
// Concurrrency
79
+
"withTaskGroup", // Starts a new scope that can contain a dynamic number of child tasks
80
+
"withThrowingTaskGroup", // Starts a new scope that can contain a dynamic number of throwing child tasks
81
+
"withDiscardingTaskGroup", // Starts a new scope that can contain a dynamic number of child tasks
82
+
"withThrowingDiscardingTaskGroup", // Starts a new scope that can contain a dynamic number of child tasks
83
+
"withCheckedContinuation", // Invokes the passed in closure with a checked continuation for the current task
84
+
"withCheckedThrowingContinuation", // Invokes the passed in closure with a checked continuation for the current task
85
+
"withUnsafeContinuation", // Invokes the passed in closure with a unsafe continuation for the current task
86
+
"withUnsafeThrowingContinuation", // Invokes the passed in closure with a unsafe continuation for the current task
87
+
"extractIsolation", // Returns a reference to the actor to which the function is isolated, or nil if it is nonisolated
88
+
"withTaskExecutorPreference", // Configure the current task hierarchy’s task executor preference to the passed TaskExecutor, and execute the passed in closure by immediately hopping to that executor
89
+
90
+
// C Interoperability
91
+
"withVaList", // Invokes the given closure with a C va_list argument derived from the given array of arguments
92
+
"getVaList", // Returns a CVaListPointer that is backed by autoreleased storage, built from the given array of arguments
93
+
69
94
// Miscellaneous Functions
70
-
"swap", // Exchanges the values of two variables
71
-
"withExtendedLifetime"//Extends the lifetime of an object during the execution of a closure
95
+
"swap", // Exchanges the values of two variables
96
+
"exchange"//Replaces the value of a mutable value with the supplied new value, returning the original.
0 commit comments