Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/akyoto/q
/ functions
Functions
1,095 in github.com/akyoto/q
⨍
Functions
1,095
◇
Types & classes
241
↓ 222 callers
Method
Append
Append adds a new value to the last block.
src/ssa/IR.go:14
↓ 119 callers
Function
New
New generates an error message at the current token position. The error message is clickable in popular editors and leads you directly to the faulty f
src/errors/New.go:10
↓ 110 callers
Method
String
String returns a human-readable form of the value.
src/ssa/Value.go:19
↓ 102 callers
Method
Append
Append adds another instruction.
src/asm/Assembler.go:19
↓ 102 callers
Method
Source
Source returns the byte offsets inside the file.
src/errors/FileError.go:105
↓ 88 callers
Method
Type
Type returns the data type of the value.
src/ssa/Value.go:22
↓ 71 callers
Method
Name
()
src/types/Type.go:5
↓ 70 callers
Function
Tokenize
Tokenize turns the file contents into a list of tokens.
src/token/Tokenize.go:4
↓ 63 callers
Method
append
(code uint32)
src/asm/compilerARM.go:15
↓ 55 callers
Method
StringFrom
([]byte)
src/errors/Source.go:9
↓ 48 callers
Function
NewAt
NewAt is the same as New but with an exact position.
src/errors/NewAt.go:9
↓ 48 callers
Function
String
String creates a static error message without parameters.
src/errors/String.go:4
↓ 47 callers
Method
Block
Block returns the last block.
src/ssa/IR.go:26
↓ 43 callers
Function
NewBlock
NewBlock creates a new basic block.
src/ssa/Block.go:24
↓ 42 callers
Method
Write
(_ []byte)
src/exe/Discard.go:6
↓ 41 callers
Function
Is
Is returns true if the encountered type `a` can be converted into the expected type `b`.
src/types/Is.go:4
↓ 38 callers
Method
Equals
Equals check for equality which is useful for common subexpression elimination.
src/ssa/Value.go:7
↓ 37 callers
Method
End
()
src/errors/Source.go:7
↓ 37 callers
Method
Size
()
src/types/Type.go:6
↓ 34 callers
Method
CanReachPredecessor
CanReachPredecessor checks if the `other` block appears as a predecessor or is the block itself.
src/ssa/Block.go:170
↓ 33 callers
Function
Exec
Exec runs the command included in the first argument and returns the exit code.
src/cli/Exec.go:4
↓ 29 callers
Function
MoveRegisterRegister
MoveRegisterRegister copies a register to another register.
src/x86/Move.go:43
↓ 27 callers
Method
evaluateRight
evaluateRight evaluates the expression and automatically dereferences it if needed.
src/core/evaluateRight.go:9
↓ 26 callers
Method
AddBlock
AddBlock adds a new block to the function.
src/ssa/IR.go:9
↓ 25 callers
Function
Unwrap
Unwrap returns the underlying type without a resource wrapper.
src/types/Unwrap.go:4
↓ 24 callers
Function
SizeInt
SizeInt tells you how many bytes are needed to encode this signed number.
src/cpu/SizeInt.go:6
↓ 22 callers
Method
Contains
Contains returns true if the library exists.
src/dll/List.go:43
↓ 22 callers
Function
New
New creates a new build.
src/config/New.go:8
↓ 22 callers
Function
Parse
Parse generates an expression tree from tokens.
src/expression/Parse.go:8
↓ 22 callers
Function
encode
encode is the core function that encodes an instruction.
src/x86/encode.go:6
↓ 21 callers
Method
AddSuccessor
AddSuccessor adds the given block as a successor.
src/ssa/Block.go:32
↓ 21 callers
Method
Identify
Identify adds a new identifier or changes an existing one.
src/ssa/Block.go:251
↓ 21 callers
Method
Start
()
src/errors/Source.go:8
↓ 20 callers
Method
FindIdentifier
FindIdentifier searches for all the possible values the identifier can have and combines them to a phi instruction if necessary.
src/ssa/Block.go:224
↓ 20 callers
Method
Index
Index returns the position of the given function name.
src/dll/List.go:59
↓ 19 callers
Function
Compile
Compile waits for the scan to finish and compiles all functions.
src/compiler/Compile.go:11
↓ 18 callers
Method
Set
Set marks the given register as used.
src/codegen/bitset.go:9
↓ 16 callers
Method
Run
Run compiles a debug and release version and tests both.
tests/run_test.go:28
↓ 16 callers
Method
SourceString
SourceString returns the string that was parsed in this expression.
src/expression/Expression.go:123
↓ 16 callers
Function
exit
exit returns the exit code depending on the error type.
src/cli/exit.go:18
↓ 15 callers
Method
Add
Add adds a value to the set if it doesn't exist yet. It returns `false` if it already exists, `true` if it was added.
src/set/Ordered.go:15
↓ 15 callers
Method
IsComparison
IsComparison returns true if the token is a comparison operator.
src/token/Kind.go:111
↓ 14 callers
Method
CreateLabel
CreateLabel creates a label that is tied to this function by using a suffix.
src/codegen/CreateLabel.go:9
↓ 14 callers
Function
IsUnsigned
IsUnsigned returns true if the type represents an unsigned value.
src/types/IsUnsigned.go:4
↓ 13 callers
Method
AddChild
AddChild adds a child to the expression.
src/expression/Expression.go:19
↓ 13 callers
Function
ModRM
ModRM is used to generate a mode-register-memory suffix. - mod: 2 bits. The addressing mode. - reg: 3 bits. Second register operand or opcode extensio
src/x86/ModRM.go:7
↓ 12 callers
Function
Nop
Nop instruction encodes a No Operation instruction with the given length, usually used for alignment. Source: Intel Software Developer Manual ("Recomm
src/x86/Nop.go:6
↓ 12 callers
Method
SetImmutable
SetImmutable sets the readonly data for the given label.
src/data/Insert.go:4
↓ 12 callers
Method
hint
hint adds a register hint to the step.
src/codegen/Step.go:21
↓ 11 callers
Function
reg3
reg3 encodes an instruction with 3 registers.
src/arm/encode.go:39
↓ 10 callers
Method
MemoryAlign
MemoryAlign returns the memory alignment.
src/config/MemoryAlign.go:4
↓ 10 callers
Method
Unidentify
Unidentify deletes the identifier for the given value.
src/ssa/Block.go:346
↓ 10 callers
Method
assignFreeRegister
assignFreeRegister assigns a free registers to the step.
src/codegen/assignFreeRegister.go:4
↓ 10 callers
Function
branchCond
branchCond performs a conditional branch to the new 19 bit offset multiplied by 4.
src/arm/Jump.go:63
↓ 10 callers
Function
cset
cset encodes a conditional set instruction.
src/arm/Set.go:56
↓ 9 callers
Function
CleanLabel
CleanLabel removes the function name from the label.
src/ssa/CleanLabel.go:6
↓ 9 callers
Method
FieldByName
FieldByName returns the field with the given name if it exists.
src/types/Struct.go:28
↓ 9 callers
Function
NewSource
NewSource creates a new source region.
src/token/Source.go:10
↓ 9 callers
Method
jump
jump inserts a `jump` instruction to the block and adds it as a successor if the last instruction was not a `jump` or `return`.
src/core/jump.go:7
↓ 8 callers
Method
Function
Function looks up a function by the package name and raw function name.
src/core/Environment.go:46
↓ 8 callers
Method
Has
Has returns true if the given register is used.
src/codegen/bitset.go:14
↓ 8 callers
Method
Merge
Merge combines the contents of this assembler with another one.
src/asm/Assembler.go:72
↓ 8 callers
Function
SizeUint
SizeUint tells you how many bytes are needed to encode this unsigned number.
src/cpu/SizeUint.go:6
↓ 8 callers
Method
compileAST
compileAST compiles an abstract syntax tree.
src/core/compileAST.go:8
↓ 8 callers
Method
makeStruct
makeStruct creates a struct and saves a reference to it for every field. This is later used in dead code removal to know if a value is part of a parti
src/core/makeStruct.go:10
↓ 7 callers
Method
Append
Append adds a new value to the block.
src/ssa/Block.go:165
↓ 7 callers
Function
BringToFront
BringToFront brings the element at `index` within the `slice` to the front.
src/set/BringToFront.go:4
↓ 7 callers
Method
FileAlign
FileAlign returns the file alignment.
src/config/FileAlign.go:4
↓ 7 callers
Method
Index
Index returns the position of the child or `-1` if it's not a child of this expression.
src/expression/Expression.go:44
↓ 7 callers
Method
Index
Index returns the position of the value or -1 if it doesn't exist within the block.
src/ssa/Block.go:271
↓ 7 callers
Function
LoadAddress
LoadAddress calculates the address with the PC-relative offset in the range -1048576 to 1048575 and writes the result to the destination register.
src/arm/LoadAddress.go:7
↓ 7 callers
Method
PatchLast4Bytes
PatchLast4Bytes creates a late patch for the last 4 bytes.
src/asm/patcher.go:58
↓ 7 callers
Method
Seek
(_ int64, _ int)
src/exe/Discard.go:7
↓ 7 callers
Method
Users
Users returns all values that reference this value as an input.
src/ssa/HasUsers.go:11
↓ 7 callers
Function
Walk
Walk calls your callback function for every file name inside the directory. It doesn't distinguish between files and directories.
src/fs/Walk_slow.go:9
↓ 7 callers
Function
encodeNum
encodeNum encodes an instruction with up to two registers and a number parameter.
src/x86/encodeNum.go:10
↓ 7 callers
Function
memAccess
memAccess encodes a memory access using the value of a register as an offset.
src/x86/memAccess.go:8
↓ 7 callers
Function
parse
(code string)
src/ast/ast_test.go:76
↓ 6 callers
Function
AddRegisterNumber
AddRegisterNumber adds a number to a register.
src/arm/Add.go:6
↓ 6 callers
Method
Append
Append adds a function for the given DLL if it doesn't exist yet.
src/dll/List.go:25
↓ 6 callers
Function
Complexity
Complexity returns the number of registers needed to evaluate the expression.
src/optimizer/Complexity.go:11
↓ 6 callers
Method
Count
Count returns the number of elements in the set.
src/set/Ordered.go:36
↓ 6 callers
Method
IndexKind
IndexKind returns the position of a token kind within a token list.
src/token/List.go:11
↓ 6 callers
Method
IsOperator
IsOperator returns true if the token is an operator.
src/token/Kind.go:136
↓ 6 callers
Method
IsPure
IsPure returns true if the calculation of the value has no side effects.
src/ssa/Value.go:13
↓ 6 callers
Method
Leaves
Leaves iterates through all leaves in the tree.
src/expression/Expression.go:77
↓ 6 callers
Function
New
New creates a new executable.
src/exe/Executable.go:14
↓ 6 callers
Method
Optimize
Optimize enables or disables the optimizer.
src/config/Optimize.go:4
↓ 6 callers
Function
OrRegisterNumber
OrRegisterNumber performs a bitwise OR using a register and a number.
src/arm/Or.go:6
↓ 6 callers
Function
REX
REX is used to generate a REX prefix. w, r, x and b can only be set to either 0 or 1.
src/x86/REX.go:5
↓ 6 callers
Method
Replace
Replace replaces the uses of a value with another value.
src/ssa/Value.go:16
↓ 6 callers
Function
Scan
Scan scans all the files included in the build.
src/scanner/Scan.go:14
↓ 6 callers
Method
Slice
Slice returns the type that is a slice of the given type.
src/core/typeCache.go:43
↓ 6 callers
Function
StoreFixedOffsetRegister
StoreFixedOffsetRegister writes the contents of the register to a memory address with a signed offset from -256 to 255.
src/arm/Store.go:13
↓ 6 callers
Method
TypeFromTokens
TypeFromTokens returns the type with the given tokens or `nil` if it doesn't exist.
src/core/TypeFromTokens.go:11
↓ 6 callers
Function
Write
Write writes an executable to the given writer.
src/linker/Write.go:17
↓ 6 callers
Function
newBuild
newBuild creates a new build with the given arguments.
src/cli/newBuild.go:11
↓ 6 callers
Function
newLeaf
newLeaf creates a new leaf node.
src/expression/newLeaf.go:6
↓ 6 callers
Method
queueDirectory
queueDirectory queues an entire directory to be scanned.
src/scanner/queueDirectory.go:12
↓ 6 callers
Function
reg2BitmaskImm
reg2BitmaskImm encodes an instruction with 2 registers and a bitmask immediate.
src/arm/encode.go:34
next →
1–100 of 1,095, ranked by callers