{%hackmd theme-dark %} # LLVM IR Notes ###### tags: `Lucid Dreams` `Development` ## Basic Constructs ### Variables Register/Temp Var ```llvm ; Define symbols with % %reg = add i32 4, 2 ``` Stack `%stack` isn't actually stack ptr or anything, use `alloca` to get the stack ptr for the variable ``` %stack = alloca i32 ``` ### Structs accessed by index, not by name, using the GEP ~~gun~~ instruction Definition ```llvm %Foo = type { i32, i8*, double } ``` Getting attribs ```llvm %foo = alloca %Foo %fooptr.1 = getelementptr %Foo, %Foo %foo, i32 0, i32 1 ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up